1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
24 #if !defined WIN32_LEAN_AND_MEAN
25 # define WIN32_LEAN_AND_MEAN
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"
39 #pragma clang diagnostic push
40 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
44 #pragma clang diagnostic pop
47 class AccEventListener
;
48 class AccObjectManagerAgent
;
51 typedef std::map
<const long, AccObject
*> IAccSelectionList
;
52 typedef std::vector
<AccObject
*> IAccChildList
;
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();
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
);
84 AccObject ( css::accessibility::XAccessible
* pXAcc
= nullptr,AccObjectManagerAgent
* pAgent
= nullptr ,AccEventListener
* accListener
=nullptr);
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
97 void SetParentHWND(HWND hWnd
);//need to set top window handle when send event to AT
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;
126 void UpdateDescription();
127 void UpdateValidWindow();
128 void UpdateLocation();
133 void AddSelect(long index
, AccObject
* accObj
);
134 IAccSelectionList
& GetSelection();
135 void setLocalizedResourceString();
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */