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 __ACCRELATION_H_
23 #define __ACCRELATION_H_
24 
25 #include "resource.h"       // main symbols
26 
27 
28 #include <com/sun/star/uno/reference.hxx>
29 #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
30 #include "UNOXWrapper.h"
31 
32 /**
33  * CAccRelation implements IAccessibleRelation interface.
34  */
35 class ATL_NO_VTABLE CAccRelation :
36             public CComObjectRoot,
37             public CComCoClass<CAccRelation, &CLSID_AccRelation>,
38             public IAccessibleRelation,
39             public CUNOXWrapper
40 {
41 public:
CAccRelation()42     CAccRelation()
43     {
44             }
~CAccRelation()45     virtual ~CAccRelation()
46     {
47             }
48 
49     DECLARE_REGISTRY_RESOURCEID(IDR_ACCRELATION)
50 
51     DECLARE_PROTECT_FINAL_CONSTRUCT()
52 
53     BEGIN_COM_MAP(CAccRelation)
54     COM_INTERFACE_ENTRY(IAccessibleRelation)
55     COM_INTERFACE_ENTRY(IUNOXWrapper)
56     END_COM_MAP()
57 
58     // IAccessibleRelation
59 public:
60     // IAccessibleRelation
61 
62     // Gets what the type of relation is.
63     STDMETHOD(get_relationType)(BSTR * relationType);
64 
65     // Gets what the type of localized relation is.
66     STDMETHOD(get_localizedRelationType)(BSTR * relationType);
67 
68     // Gets how many targets this relation have.
69     STDMETHOD(get_nTargets)(long * nTargets);
70 
71     // Gets one accessible relation target.
72     STDMETHOD(get_target)(long targetIndex, IUnknown * * target);
73 
74     // Gets multiple accessible relation targets.
75     STDMETHOD(get_targets)(long maxTargets, IUnknown * * target, long * nTargets);
76 
77     // Overide of IUNOXWrapper.
78     STDMETHOD(put_XSubInterface)(long pXSubInterface);
79 
80     //static OLECHAR* getRelationTypeOLECHAR(int type);
81     static BSTR getRelationTypeBSTR(int type);
82 
83 private:
84 
85     com::sun::star::accessibility::AccessibleRelation relation;
86 };
87 
88 #endif //__ACCRELATION_H_
89