calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / winaccessibility / inc / AccObject.hxx
blob3e259592e5be423a9ca9bfda33160612e438a33f
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 AccObjectManagerAgent;
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* m_pIMAcc;
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();
65 void UpdateRole();
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);
72 public:
74 AccObject ( css::accessibility::XAccessible* pXAcc = nullptr,AccObjectManagerAgent* pAgent = nullptr ,AccEventListener* accListener=nullptr);
75 virtual ~AccObject();
77 bool UpdateAccessibleInfoFromUnoToMSAA( ); //implement accessible information mapping
78 void UpdateDefaultAction();
80 IMAccessible* GetIMAccessible(); //return COM interface in acc object
81 css::uno::Reference<css::accessibility::XAccessible> const& GetXAccessible();
83 void SetResID(long id);//ResID means ChildID in MSAA
84 long GetResID();
87 void SetParentHWND(HWND hWnd);//need to set top window handle when send event to AT
88 HWND GetParentHWND();
90 void SetListener(::rtl::Reference<AccEventListener> const& pListener);
91 AccEventListener* getListener();
93 void SetParentObj(AccObject* pParentAccObj);
94 AccObject* GetParentObj();
96 void InsertChild( AccObject* pChild,short pos = LAST_CHILD);
97 void DeleteChild( AccObject* pChild );
98 AccObject* NextChild();
100 void NotifyDestroy();
102 void DecreaseState( sal_Int64 xState );//call COM interface DecreaseState method
103 void IncreaseState( sal_Int64 xState );//call COM interface IncreaseState method
105 void SetName( css::uno::Any newName);
106 void SetValue( css::uno::Any pAny );
108 short GetRole() const;
110 void UpdateState();
111 void UpdateName();
112 void UpdateValue();
113 void UpdateAction();
114 void UpdateValidWindow();
116 void setFocus();
117 void unsetFocus();
119 void setLocalizedResourceString();
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */