1*3a700b0aSSteve Yin /**************************************************************
2*3a700b0aSSteve 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
10*3a700b0aSSteve Yin  *
11*3a700b0aSSteve Yin  *   http://www.apache.org/licenses/LICENSE-2.0
12*3a700b0aSSteve 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.
19*3a700b0aSSteve Yin  *
20*3a700b0aSSteve Yin  *************************************************************/
215fdc4257SSteve Yin 
225fdc4257SSteve Yin #ifndef __ACCRELATION_H_
235fdc4257SSteve Yin #define __ACCRELATION_H_
245fdc4257SSteve Yin 
255fdc4257SSteve Yin #include "resource.h"       // main symbols
265fdc4257SSteve Yin 
275fdc4257SSteve Yin 
285fdc4257SSteve Yin #include <com/sun/star/uno/reference.hxx>
295fdc4257SSteve Yin #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
305fdc4257SSteve Yin #include "UNOXWrapper.h"
315fdc4257SSteve Yin 
325fdc4257SSteve Yin /**
335fdc4257SSteve Yin  * CAccRelation implements IAccessibleRelation interface.
345fdc4257SSteve Yin  */
355fdc4257SSteve Yin class ATL_NO_VTABLE CAccRelation :
365fdc4257SSteve Yin             public CComObjectRoot,
375fdc4257SSteve Yin             public CComCoClass<CAccRelation, &CLSID_AccRelation>,
385fdc4257SSteve Yin             public IAccessibleRelation,
395fdc4257SSteve Yin             public CUNOXWrapper
405fdc4257SSteve Yin {
415fdc4257SSteve Yin public:
CAccRelation()425fdc4257SSteve Yin     CAccRelation()
435fdc4257SSteve Yin     {
445fdc4257SSteve Yin             }
~CAccRelation()455fdc4257SSteve Yin     virtual ~CAccRelation()
465fdc4257SSteve Yin     {
475fdc4257SSteve Yin             }
485fdc4257SSteve Yin 
495fdc4257SSteve Yin     DECLARE_REGISTRY_RESOURCEID(IDR_ACCRELATION)
505fdc4257SSteve Yin 
515fdc4257SSteve Yin     DECLARE_PROTECT_FINAL_CONSTRUCT()
525fdc4257SSteve Yin 
535fdc4257SSteve Yin     BEGIN_COM_MAP(CAccRelation)
545fdc4257SSteve Yin     COM_INTERFACE_ENTRY(IAccessibleRelation)
555fdc4257SSteve Yin     COM_INTERFACE_ENTRY(IUNOXWrapper)
565fdc4257SSteve Yin     END_COM_MAP()
575fdc4257SSteve Yin 
585fdc4257SSteve Yin     // IAccessibleRelation
595fdc4257SSteve Yin public:
605fdc4257SSteve Yin     // IAccessibleRelation
615fdc4257SSteve Yin 
625fdc4257SSteve Yin     // Gets what the type of relation is.
635fdc4257SSteve Yin     STDMETHOD(get_relationType)(BSTR * relationType);
645fdc4257SSteve Yin 
655fdc4257SSteve Yin     // Gets what the type of localized relation is.
665fdc4257SSteve Yin     STDMETHOD(get_localizedRelationType)(BSTR * relationType);
675fdc4257SSteve Yin 
685fdc4257SSteve Yin     // Gets how many targets this relation have.
695fdc4257SSteve Yin     STDMETHOD(get_nTargets)(long * nTargets);
705fdc4257SSteve Yin 
715fdc4257SSteve Yin     // Gets one accessible relation target.
725fdc4257SSteve Yin     STDMETHOD(get_target)(long targetIndex, IUnknown * * target);
735fdc4257SSteve Yin 
745fdc4257SSteve Yin     // Gets multiple accessible relation targets.
755fdc4257SSteve Yin     STDMETHOD(get_targets)(long maxTargets, IUnknown * * target, long * nTargets);
765fdc4257SSteve Yin 
775fdc4257SSteve Yin     // Overide of IUNOXWrapper.
785fdc4257SSteve Yin     STDMETHOD(put_XSubInterface)(long pXSubInterface);
795fdc4257SSteve Yin 
805fdc4257SSteve Yin     //static OLECHAR* getRelationTypeOLECHAR(int type);
815fdc4257SSteve Yin     static BSTR getRelationTypeBSTR(int type);
825fdc4257SSteve Yin 
835fdc4257SSteve Yin private:
845fdc4257SSteve Yin 
855fdc4257SSteve Yin     com::sun::star::accessibility::AccessibleRelation relation;
865fdc4257SSteve Yin };
875fdc4257SSteve Yin 
885fdc4257SSteve Yin #endif //__ACCRELATION_H_
89