calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / winaccessibility / inc / AccObjectWinManager.hxx
blob5c162dfed1ead3650b4b57ea66154f58569ec282
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 <map>
23 #if !defined WIN32_LEAN_AND_MEAN
24 # define WIN32_LEAN_AND_MEAN
25 #endif
26 #include <windows.h>
27 #include <rtl/ref.hxx>
28 #include "ResIDGenerator.hxx"
29 #include <UAccCOM.h>
31 namespace com::sun::star::accessibility {
32 class XAccessible;
34 class ResIDGenerator;
35 class AccObjectManagerAgent;
36 class AccEventListener;
37 class AccObject;
38 enum class UnoMSAAEvent;
40 /*******************************************************************
41 AccObjectWinManager complete the functions:
42 1. Insert, delete,query,update Acc objects
43 2. Create, delete,fire AccEventLister, the lifecycle of AccEventListener is as same as
44 Acc Object
45 3.Return COM interface for AT,by the call back in salframe
46 4.Pass accessible information to Acc objects
47 *******************************************************************/
48 class AccObjectWinManager
50 friend class AccObjectManagerAgent;
52 private:
53 typedef std::map<com::sun::star::accessibility::XAccessible*, AccObject> XIdToAccObjHash;
54 typedef std::map<HWND, com::sun::star::accessibility::XAccessible*> XHWNDToXAccHash;
55 typedef std::map<const long, AccObject*> XResIdToAccObjHash;
57 typedef std::map<const HWND, css::accessibility::XAccessible* >
58 XHWNDToDocumentHash;
60 //XAccessible to AccObject
61 XIdToAccObjHash XIdAccList;
63 //HWND to All XAccessible pointer
64 XHWNDToXAccHash HwndXAcc;
66 //id_Child to AccObject
67 XResIdToAccObjHash XResIdAccList;
69 //for file name support
70 XHWNDToDocumentHash XHWNDDocList;
72 css::accessibility::XAccessible* oldFocus;
74 AccObjectManagerAgent* pAgent;
75 ResIDGenerator ResIdGen;
77 AccObjectWinManager(AccObjectManagerAgent* Agent=nullptr);
79 private:
80 long ImpleGenerateResID();
81 AccObject* GetAccObjByXAcc( css::accessibility::XAccessible* pXAcc);
83 AccObject* GetTopWindowAccObj(HWND hWnd);
85 css::accessibility::XAccessible* GetAccDocByHWND(HWND hWnd);
87 static void DeleteAccListener( AccObject* pAccObj );
88 static void InsertAccChildNode(AccObject* pCurObj,AccObject* pParentObj,HWND pWnd);
89 static void DeleteAccChildNode(AccObject* pChild);
90 void DeleteFromHwndXAcc(css::accessibility::XAccessible const * pXAcc );
92 ::rtl::Reference<AccEventListener> CreateAccEventListener(
93 css::accessibility::XAccessible* pXAcc);
94 public:
95 virtual ~AccObjectWinManager();
96 bool InsertAccObj( css::accessibility::XAccessible* pXAcc,css::accessibility::XAccessible* pParentXAcc,HWND pWnd);
97 bool InsertChildrenAccObj( css::accessibility::XAccessible* pXAcc,HWND pWnd=nullptr);
98 void DeleteAccObj( css::accessibility::XAccessible* pXAcc );
99 void DeleteChildrenAccObj(css::accessibility::XAccessible* pAccObj);
101 bool NotifyAccEvent(css::accessibility::XAccessible* pXAcc, UnoMSAAEvent eEvent);
103 LRESULT Get_ToATInterface(HWND hWnd, long lParam, WPARAM wParam);
105 void DecreaseState(css::accessibility::XAccessible* pXAcc, sal_Int64 nState);
106 void IncreaseState(css::accessibility::XAccessible* pXAcc, sal_Int64 nState);
107 void UpdateState( css::accessibility::XAccessible* pXAcc );
109 void SetValue( css::accessibility::XAccessible* pXAcc, css::uno::Any pAny );
110 void UpdateValue( css::accessibility::XAccessible* pXAcc );
112 void SetAccName( css::accessibility::XAccessible* pXAcc, css::uno::Any newName);
113 void UpdateAccName( css::accessibility::XAccessible* pXAcc );
115 void UpdateAccFocus( css::accessibility::XAccessible* newFocus );
116 void UpdateAction( css::accessibility::XAccessible* pXAcc );
118 static bool IsContainer( css::accessibility::XAccessible* pAccessible );
120 IMAccessible* GetIMAccByXAcc( css::accessibility::XAccessible* pXAcc );
121 IMAccessible* GetIAccessibleFromResID(long resID);
123 void NotifyDestroy( css::accessibility::XAccessible* pXAcc );
124 css::accessibility::XAccessible* GetParentXAccessible( css::accessibility::XAccessible* pXAcc );
125 short GetParentRole( css::accessibility::XAccessible* pXAcc );
127 void SaveTopWindowHandle(HWND hWnd, css::accessibility::XAccessible* pXAcc);
129 void UpdateChildState(css::accessibility::XAccessible* pXAcc);
131 bool IsSpecialToolbarItem(css::accessibility::XAccessible* pXAcc);
133 static short GetRole(css::accessibility::XAccessible* pXAcc);
135 css::accessibility::XAccessible* GetAccDocByAccTopWin( css::accessibility::XAccessible* pXAcc );
136 bool IsTopWinAcc( css::accessibility::XAccessible* pXAcc );
138 static bool IsStateManageDescendant(css::accessibility::XAccessible* pAccessible);
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */