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 class AccEventListener
;
40 class AccObjectWinManager
;
43 typedef std::vector
<AccObject
*> IAccChildList
;
53 IMAccessible
* const m_pIMAcc
; // AccObjectManager::GetTopWindowIMAccessible relies on this being const
54 AccObject
* m_pParentObj
;
55 IAccChildList m_childrenList
;
56 ::rtl::Reference
<AccEventListener
> m_pListener
;
58 css::uno::Reference
< css::accessibility::XAccessible
> m_xAccRef
;
59 css::uno::Reference
< css::accessibility::XAccessibleAction
> m_xAccActionRef
;
60 css::uno::Reference
< css::accessibility::XAccessibleContext
> m_xAccContextRef
;
62 void ImplInitializeCreateObj();//create COM object
64 void UpdateActionDesc();
67 DWORD
GetMSAAStateFromUNO(sal_Int64 xState
);//translate state from UNO to MSAA value
68 css::accessibility::XAccessibleSelection
* GetXAccessibleSelection();
69 void GetExpandedState(sal_Bool
* isExpandable
, sal_Bool
* isExpanded
);
70 OUString
GetMAccessibleValueFromAny(css::uno::Any pAny
);
74 AccObject(css::accessibility::XAccessible
* pXAcc
= nullptr, AccObjectWinManager
* pManager
= nullptr,
75 AccEventListener
* accListener
=nullptr);
78 bool UpdateAccessibleInfoFromUnoToMSAA( ); //implement accessible information mapping
79 void UpdateDefaultAction();
81 IMAccessible
* GetIMAccessible(); //return COM interface in acc object
82 css::uno::Reference
<css::accessibility::XAccessible
> const& GetXAccessible();
84 void SetResID(long id
);//ResID means ChildID in MSAA
88 void SetParentHWND(HWND hWnd
);//need to set top window handle when send event to AT
91 ::rtl::Reference
<AccEventListener
> SetListener(::rtl::Reference
<AccEventListener
> const& pListener
);
92 AccEventListener
* getListener();
94 void SetParentObj(AccObject
* pParentAccObj
);
95 AccObject
* GetParentObj();
97 void InsertChild( AccObject
* pChild
,short pos
= LAST_CHILD
);
98 void DeleteChild( AccObject
* pChild
);
99 AccObject
* NextChild();
101 void NotifyDestroy();
103 void DecreaseState( sal_Int64 xState
);//call COM interface DecreaseState method
104 void IncreaseState( sal_Int64 xState
);//call COM interface IncreaseState method
106 void SetName( css::uno::Any newName
);
107 void SetValue( css::uno::Any pAny
);
109 short GetRole() const;
115 void UpdateValidWindow();
120 void setLocalizedResourceString();
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */