1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright IBM Corporation 2010.
6  * Copyright 2000, 2010 Oracle and/or its affiliates.
7  *
8  * OpenOffice.org - a multi-platform office productivity suite
9  *
10  * This file is part of OpenOffice.org.
11  *
12  * OpenOffice.org is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 3
14  * only, as published by the Free Software Foundation.
15  *
16  * OpenOffice.org is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU Lesser General Public License version 3 for more details
20  * (a copy is included in the LICENSE file that accompanied this code).
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * version 3 along with OpenOffice.org.  If not, see
24  * <http://www.openoffice.org/license.html>
25  * for a copy of the LGPLv3 License.
26  *
27  ************************************************************************/
28 
29 #if !defined(AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_)
30 #define AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_
31 
32 #if _MSC_VER > 1000
33 #pragma once
34 #endif // _MSC_VER > 1000
35 
36 #include "resource.h"       // main symbols
37 
38 #include "AccessibleComponent.h"
39 
40 
41 #include <com/sun/star/accessibility/XAccessible.hpp>
42 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
43 #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
44 #include "UNOXWrapper.h"
45 #include "AccComponentBase.h"
46 
47 using namespace com::sun::star::accessibility;
48 using namespace com::sun::star::uno;
49 
50 /**
51  * CAccComponent implements IAccessibleComponent interface.
52  */
53 class ATL_NO_VTABLE CAccComponent :
54             public CComObjectRoot,
55             public CComCoClass<CAccComponent,&CLSID_AccComponent>,
56             public IAccessibleComponent,
57             public CAccComponentBase
58 {
59 public:
60     CAccComponent()
61     {
62             }
63     ~CAccComponent()
64     {
65             }
66 
67     BEGIN_COM_MAP(CAccComponent)
68     COM_INTERFACE_ENTRY(IAccessibleComponent)
69     COM_INTERFACE_ENTRY(IUNOXWrapper)
70     COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
71     END_COM_MAP()
72 
73     static HRESULT WINAPI _SmartQI(void* pv,
74                                    REFIID iid, void** ppvObject, DWORD)
75     {
76         return ((CAccComponent*)pv)->SmartQI(iid,ppvObject);
77     }
78 
79     HRESULT SmartQI(REFIID iid, void** ppvObject)
80     {
81         if( m_pOuterUnknown )
82             return OuterQueryInterface(iid,ppvObject);
83         return E_FAIL;
84     }
85 
86     DECLARE_REGISTRY_RESOURCEID(IDR_AccComponent)
87 
88     // IAccessibleComponent
89 public:
90     // IAccessibleComponent
91 
92     // Returns the location of the upper left corner of the object's bounding
93     // box relative to the parent.
94     STDMETHOD(get_locationInParent)(long *x, long *y);
95 
96     // Returns the foreground color of this object.
97     STDMETHOD(get_foreground)(IA2Color * foreground);
98 
99     // Returns the background color of this object.
100     STDMETHOD(get_background)(IA2Color * background);
101 
102     // Overide of IUNOXWrapper.
103     STDMETHOD(put_XInterface)(long pXInterface);
104 
105 };
106 
107 #endif // !defined(AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_)
108