a11y: No longer use AccessibleListBoxEntry::GetBoundingBox
[LibreOffice.git] / winaccessibility / inc / AccObject.hxx
blob1811b8f9b033ff8d44a8499502fbd29f0937fc67
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"
37 #include <UAccCOM.h>
39 class AccEventListener;
40 class AccObjectWinManager;
41 class AccObject;
43 typedef std::vector<AccObject *> IAccChildList;
46 class AccObject
48 private:
50 short m_accRole;
51 long m_resID;
52 HWND m_pParantID;
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::XAccessibleContext > m_xAccContextRef;
61 void UpdateRole();
63 DWORD GetMSAAStateFromUNO(sal_Int64 xState);//translate state from UNO to MSAA value
64 css::accessibility::XAccessibleSelection* GetXAccessibleSelection();
65 static OUString GetMAccessibleValueFromAny(css::uno::Any pAny);
67 public:
69 AccObject(css::accessibility::XAccessible* pXAcc, AccObjectWinManager* pManager);
70 virtual ~AccObject();
72 bool UpdateAccessibleInfoFromUnoToMSAA( ); //implement accessible information mapping
74 IMAccessible* GetIMAccessible(); //return COM interface in acc object
75 css::uno::Reference<css::accessibility::XAccessible> const& GetXAccessible();
77 void SetResID(long id);//ResID means ChildID in MSAA
78 long GetResID();
81 void SetParentHWND(HWND hWnd);//need to set top window handle when send event to AT
82 HWND GetParentHWND();
84 ::rtl::Reference<AccEventListener> SetListener(::rtl::Reference<AccEventListener> const& pListener);
86 void SetParentObj(AccObject* pParentAccObj);
87 AccObject* GetParentObj();
89 void InsertChild(AccObject* pChild);
90 void DeleteChild( AccObject* pChild );
91 AccObject* NextChild();
93 void NotifyDestroy();
95 void DecreaseState( sal_Int64 xState );//call COM interface DecreaseState method
96 void IncreaseState( sal_Int64 xState );//call COM interface IncreaseState method
98 void SetValue( css::uno::Any pAny );
100 short GetRole() const;
102 void UpdateState();
103 void UpdateValue();
104 void UpdateValidWindow();
106 void setFocus();
107 void unsetFocus();
109 void setLocalizedResourceString();
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */