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 #if !defined(AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_)
23 #define AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_
24 
25 #if _MSC_VER > 1000
26 #pragma once
27 #endif // _MSC_VER > 1000
28 
29 #include "resource.h"       // main symbols
30 
31 #include "AccessibleComponent.h"
32 
33 
34 #include <com/sun/star/accessibility/XAccessible.hpp>
35 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
36 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
37 #include "UNOXWrapper.h"
38 #include "AccComponentBase.h"
39 
40 using namespace com::sun::star::accessibility;
41 using namespace com::sun::star::uno;
42 
43 /**
44  * CAccComponent implements IAccessibleComponent interface.
45  */
46 class ATL_NO_VTABLE CAccComponent :
47             public CComObjectRoot,
48             public CComCoClass<CAccComponent,&CLSID_AccComponent>,
49             public IAccessibleComponent,
50             public CAccComponentBase
51 {
52 public:
53     CAccComponent()
54     {
55             }
56     ~CAccComponent()
57     {
58             }
59 
60     BEGIN_COM_MAP(CAccComponent)
61     COM_INTERFACE_ENTRY(IAccessibleComponent)
62     COM_INTERFACE_ENTRY(IUNOXWrapper)
63     COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
64     END_COM_MAP()
65 
66     static HRESULT WINAPI _SmartQI(void* pv,
67                                    REFIID iid, void** ppvObject, DWORD)
68     {
69         return ((CAccComponent*)pv)->SmartQI(iid,ppvObject);
70     }
71 
72     HRESULT SmartQI(REFIID iid, void** ppvObject)
73     {
74         if( m_pOuterUnknown )
75             return OuterQueryInterface(iid,ppvObject);
76         return E_FAIL;
77     }
78 
79     DECLARE_REGISTRY_RESOURCEID(IDR_AccComponent)
80 
81     // IAccessibleComponent
82 public:
83     // IAccessibleComponent
84 
85     // Returns the location of the upper left corner of the object's bounding
86     // box relative to the parent.
87     STDMETHOD(get_locationInParent)(long *x, long *y);
88 
89     // Returns the foreground color of this object.
90     STDMETHOD(get_foreground)(IA2Color * foreground);
91 
92     // Returns the background color of this object.
93     STDMETHOD(get_background)(IA2Color * background);
94 
95     // Overide of IUNOXWrapper.
96     STDMETHOD(put_XInterface)(long pXInterface);
97 
98 };
99 
100 #endif // !defined(AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_)
101