xref: /AOO41X/main/winaccessibility/source/UAccCOM/AccComponent.h (revision 3a700b0a41696060114082e659787022c6e2013f)
1*3a700b0aSSteve Yin /**************************************************************
25fdc4257SSteve Yin  *
3*3a700b0aSSteve Yin  * Licensed to the Apache Software Foundation (ASF) under one
4*3a700b0aSSteve Yin  * or more contributor license agreements.  See the NOTICE file
5*3a700b0aSSteve Yin  * distributed with this work for additional information
6*3a700b0aSSteve Yin  * regarding copyright ownership.  The ASF licenses this file
7*3a700b0aSSteve Yin  * to you under the Apache License, Version 2.0 (the
8*3a700b0aSSteve Yin  * "License"); you may not use this file except in compliance
9*3a700b0aSSteve Yin  * with the License.  You may obtain a copy of the License at
105fdc4257SSteve Yin  *
11*3a700b0aSSteve Yin  *   http://www.apache.org/licenses/LICENSE-2.0
125fdc4257SSteve Yin  *
13*3a700b0aSSteve Yin  * Unless required by applicable law or agreed to in writing,
14*3a700b0aSSteve Yin  * software distributed under the License is distributed on an
15*3a700b0aSSteve Yin  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3a700b0aSSteve Yin  * KIND, either express or implied.  See the License for the
17*3a700b0aSSteve Yin  * specific language governing permissions and limitations
18*3a700b0aSSteve Yin  * under the License.
195fdc4257SSteve Yin  *
20*3a700b0aSSteve Yin  *************************************************************/
215fdc4257SSteve Yin 
225fdc4257SSteve Yin #if !defined(AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_)
235fdc4257SSteve Yin #define AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_
245fdc4257SSteve Yin 
255fdc4257SSteve Yin #if _MSC_VER > 1000
265fdc4257SSteve Yin #pragma once
275fdc4257SSteve Yin #endif // _MSC_VER > 1000
285fdc4257SSteve Yin 
295fdc4257SSteve Yin #include "resource.h"       // main symbols
305fdc4257SSteve Yin 
315fdc4257SSteve Yin #include "AccessibleComponent.h"
325fdc4257SSteve Yin 
335fdc4257SSteve Yin 
345fdc4257SSteve Yin #include <com/sun/star/accessibility/XAccessible.hpp>
355fdc4257SSteve Yin #include <com/sun/star/accessibility/XAccessibleContext.hpp>
365fdc4257SSteve Yin #include <com/sun/star/accessibility/XAccessibleComponent.hpp>
375fdc4257SSteve Yin #include "UNOXWrapper.h"
385fdc4257SSteve Yin #include "AccComponentBase.h"
395fdc4257SSteve Yin 
405fdc4257SSteve Yin using namespace com::sun::star::accessibility;
415fdc4257SSteve Yin using namespace com::sun::star::uno;
425fdc4257SSteve Yin 
435fdc4257SSteve Yin /**
445fdc4257SSteve Yin  * CAccComponent implements IAccessibleComponent interface.
455fdc4257SSteve Yin  */
465fdc4257SSteve Yin class ATL_NO_VTABLE CAccComponent :
475fdc4257SSteve Yin             public CComObjectRoot,
485fdc4257SSteve Yin             public CComCoClass<CAccComponent,&CLSID_AccComponent>,
495fdc4257SSteve Yin             public IAccessibleComponent,
505fdc4257SSteve Yin             public CAccComponentBase
515fdc4257SSteve Yin {
525fdc4257SSteve Yin public:
535fdc4257SSteve Yin     CAccComponent()
545fdc4257SSteve Yin     {
555fdc4257SSteve Yin             }
565fdc4257SSteve Yin     ~CAccComponent()
575fdc4257SSteve Yin     {
585fdc4257SSteve Yin             }
595fdc4257SSteve Yin 
605fdc4257SSteve Yin     BEGIN_COM_MAP(CAccComponent)
615fdc4257SSteve Yin     COM_INTERFACE_ENTRY(IAccessibleComponent)
625fdc4257SSteve Yin     COM_INTERFACE_ENTRY(IUNOXWrapper)
635fdc4257SSteve Yin     COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI)
645fdc4257SSteve Yin     END_COM_MAP()
655fdc4257SSteve Yin 
665fdc4257SSteve Yin     static HRESULT WINAPI _SmartQI(void* pv,
675fdc4257SSteve Yin                                    REFIID iid, void** ppvObject, DWORD)
685fdc4257SSteve Yin     {
695fdc4257SSteve Yin         return ((CAccComponent*)pv)->SmartQI(iid,ppvObject);
705fdc4257SSteve Yin     }
715fdc4257SSteve Yin 
725fdc4257SSteve Yin     HRESULT SmartQI(REFIID iid, void** ppvObject)
735fdc4257SSteve Yin     {
745fdc4257SSteve Yin         if( m_pOuterUnknown )
755fdc4257SSteve Yin             return OuterQueryInterface(iid,ppvObject);
765fdc4257SSteve Yin         return E_FAIL;
775fdc4257SSteve Yin     }
785fdc4257SSteve Yin 
795fdc4257SSteve Yin     DECLARE_REGISTRY_RESOURCEID(IDR_AccComponent)
805fdc4257SSteve Yin 
815fdc4257SSteve Yin     // IAccessibleComponent
825fdc4257SSteve Yin public:
835fdc4257SSteve Yin     // IAccessibleComponent
845fdc4257SSteve Yin 
855fdc4257SSteve Yin     // Returns the location of the upper left corner of the object's bounding
865fdc4257SSteve Yin     // box relative to the parent.
875fdc4257SSteve Yin     STDMETHOD(get_locationInParent)(long *x, long *y);
885fdc4257SSteve Yin 
895fdc4257SSteve Yin     // Returns the foreground color of this object.
905fdc4257SSteve Yin     STDMETHOD(get_foreground)(IA2Color * foreground);
915fdc4257SSteve Yin 
925fdc4257SSteve Yin     // Returns the background color of this object.
935fdc4257SSteve Yin     STDMETHOD(get_background)(IA2Color * background);
945fdc4257SSteve Yin 
955fdc4257SSteve Yin     // Overide of IUNOXWrapper.
965fdc4257SSteve Yin     STDMETHOD(put_XInterface)(long pXInterface);
975fdc4257SSteve Yin 
985fdc4257SSteve Yin };
995fdc4257SSteve Yin 
1005fdc4257SSteve Yin #endif // !defined(AFX_ACCCOMPONENT_H__626D760C_3944_4B0E_BB4D_F0D20AEDF7DC__INCLUDED_)
101