don't use common PCH with sc_parallelism test
[LibreOffice.git] / winaccessibility / inc / AccObject.hxx
blob2a246ce43b2920943aabb206a49dc971de52fe5f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <vector>
23 #include <map>
24 #if !defined WIN32_LEAN_AND_MEAN
25 # define WIN32_LEAN_AND_MEAN
26 #endif
27 #include <windows.h>
28 #include <oleacc.h>
30 #include <rtl/ref.hxx>
32 #include <com/sun/star/accessibility/XAccessible.hpp>
33 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
34 #include <com/sun/star/accessibility/XAccessibleAction.hpp>
36 #include "accHelper.hxx"
38 #if defined __clang__
39 #pragma clang diagnostic push
40 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
41 #endif
42 #include <UAccCOM.h>
43 #if defined __clang__
44 #pragma clang diagnostic pop
45 #endif
47 class AccEventListener;
48 class AccObjectManagerAgent;
49 class AccObject;
51 typedef std::map<const long, AccObject*> IAccSelectionList;
52 typedef std::vector<AccObject *> IAccChildList;
55 class AccObject
57 private:
59 short m_accRole;
60 long m_resID;
61 HWND m_pParantID;
62 IMAccessible* m_pIMAcc;
63 AccObject* m_pParentObj;
64 IAccChildList m_childrenList;
65 ::rtl::Reference<AccEventListener> m_pListener;
66 IAccSelectionList m_selectionList;
68 css::uno::Reference < css::accessibility::XAccessible > m_xAccRef;
69 css::uno::Reference < css::accessibility::XAccessibleAction > m_xAccActionRef;
70 css::uno::Reference < css::accessibility::XAccessibleContext > m_xAccContextRef;
72 void ImplInitializeCreateObj();//create COM object
74 void UpdateActionDesc();
75 void UpdateRole();
77 DWORD GetMSAAStateFromUNO(short xState);//translate state from UNO to MSAA value
78 css::accessibility::XAccessibleSelection* GetXAccessibleSelection();
79 void GetExpandedState(sal_Bool* isExpandable, sal_Bool* isExpanded);
80 OUString GetMAccessibleValueFromAny(css::uno::Any pAny);
82 public:
84 AccObject ( css::accessibility::XAccessible* pXAcc = nullptr,AccObjectManagerAgent* pAgent = nullptr ,AccEventListener* accListener=nullptr);
85 virtual ~AccObject();
87 bool UpdateAccessibleInfoFromUnoToMSAA( ); //implement accessible information mapping
88 void UpdateDefaultAction();
90 IMAccessible* GetIMAccessible(); //return COM interface in acc object
91 css::uno::Reference<css::accessibility::XAccessible> const& GetXAccessible();
93 void SetResID(long id);//ResID means ChildID in MSAA
94 long GetResID();
97 void SetParentHWND(HWND hWnd);//need to set top window handle when send event to AT
98 HWND GetParentHWND();
100 void SetListener(::rtl::Reference<AccEventListener> const& pListener);
101 AccEventListener* getListener();
103 void SetParentObj(AccObject* pParentAccObj);
104 AccObject* GetParentObj();
106 void InsertChild( AccObject* pChild,short pos = LAST_CHILD);
107 void DeleteChild( AccObject* pChild );
108 AccObject* NextChild();
110 void NotifyDestroy();
112 void DecreaseState(short xState );//call COM interface DecreaseState method
113 void IncreaseState( short xState );//call COM interface IncreaseState method
115 void SetName( css::uno::Any newName);
116 void SetValue( css::uno::Any pAny );
117 void SetDescription( css::uno::Any newDesc );
118 void SetRole( short Role );
120 short GetRole() const;
122 void UpdateState();
123 void UpdateName();
124 void UpdateValue();
125 void UpdateAction();
126 void UpdateDescription();
127 void UpdateValidWindow();
128 void UpdateLocation();
130 void setFocus();
131 void unsetFocus();
133 void AddSelect(long index, AccObject* accObj);
134 IAccSelectionList& GetSelection();
135 void setLocalizedResourceString();
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */