1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef __ACCOBJECTMANAGERAGENT_HXX
23 #define __ACCOBJECTMANAGERAGENT_HXX
24 
25 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_
26 #include <com/sun/star/accessibility/XAccessible.hpp>
27 #endif
28 
29 struct IMAccessible;
30 struct IAccessible;
31 class AccObjectWinManager;
32 
33 /****************************************************************
34 AccObjectMangerAgent is used for manaing AccObjects,which encapsulates
35 platform differences,and call AccObjectWinManager for Windows platform. To do for
36 Linux platform
37 *****************************************************************/
38 class AccObjectManagerAgent
39 {
40 private:
41 
42     AccObjectWinManager* pWinManager;
43 
44 public:
45 
46     AccObjectManagerAgent();
47     virtual ~AccObjectManagerAgent();
48 
49     virtual unsigned char InsertAccObj( com::sun::star::accessibility::XAccessible* pXAcc,
50                                         com::sun::star::accessibility::XAccessible* pParentXAcc,
51                                         long pWnd=0);
52     virtual void GetIAccessibleFromResID(long childID,IMAccessible**);
53     virtual unsigned char GetIAccessibleFromXAccessible(com::sun::star::accessibility::XAccessible* pXAcc, IAccessible** ppIA);
54 
55     virtual void DeleteAccObj( com::sun::star::accessibility::XAccessible* pXAcc );
56     virtual IMAccessible*  GetIMAccByXAcc(com::sun::star::accessibility::XAccessible* pXAcc);
57 
58     unsigned char NotifyAccEvent( short pEvent = 0, com::sun::star::accessibility::XAccessible* pXAcc = 0 );
59 
60     unsigned char InsertChildrenAccObj( com::sun::star::accessibility::XAccessible* pXAcc,
61                                         long pWnd=0);
62     void DeleteChildrenAccObj( com::sun::star::accessibility::XAccessible* pXAcc );
63 
64     void  DecreaseState( com::sun::star::accessibility::XAccessible* pXAcc,unsigned short pState );
65     void  IncreaseState( com::sun::star::accessibility::XAccessible* pXAcc,unsigned short pState );
66     void  UpdateState( com::sun::star::accessibility::XAccessible* pXAcc );
67 
68     void  UpdateLocation( com::sun::star::accessibility::XAccessible* pXAcc,
69                           long Top = 0,long left = 0,long width = 0,long height = 0 );
70     void  UpdateAction( com::sun::star::accessibility::XAccessible* pXAcc );
71 
72     void  UpdateValue( com::sun::star::accessibility::XAccessible* pXAcc );
73     void  UpdateValue( com::sun::star::accessibility::XAccessible* pXAcc, com::sun::star::uno::Any );
74 
75     void  UpdateAccName( com::sun::star::accessibility::XAccessible* pXAcc,	com::sun::star::uno::Any newName);
76     void  UpdateAccName( com::sun::star::accessibility::XAccessible* pXAcc);
77 
78     void  UpdateDescription( com::sun::star::accessibility::XAccessible* pXAcc,	com::sun::star::uno::Any newDesc );
79     void  UpdateDescription( com::sun::star::accessibility::XAccessible* pXAcc );
80 
81     void NotifyDestroy(com::sun::star::accessibility::XAccessible* pXAcc);
82 
83     com::sun::star::accessibility::XAccessible* GetParentXAccessible(
84         com::sun::star::accessibility::XAccessible* pXAcc );
85     short GetParentRole(com::sun::star::accessibility::XAccessible* pXAcc );
86     unsigned short IsContainer(com::sun::star::accessibility::XAccessible* pXAcc);
87 
88     void SaveTopWindowHandle(long hWnd, com::sun::star::accessibility::XAccessible* pXAcc);
89 
90     void UpdateChildState(com::sun::star::accessibility::XAccessible* pXAcc);
91 
92     bool IsSpecialToolboItem(com::sun::star::accessibility::XAccessible* pXAcc);
93 
94     short GetRole(com::sun::star::accessibility::XAccessible* pXAcc);
95 
96     com::sun::star::accessibility::XAccessible* GetAccDocByAccTopWin( com::sun::star::accessibility::XAccessible* pXAcc );
97     bool IsTopWinAcc( com::sun::star::accessibility::XAccessible* pXAcc );
98 
99     bool IsStateManageDescendant(com::sun::star::accessibility::XAccessible* pXAcc);
100 };
101 
102 #endif
103