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 #ifndef __ACCCOMMON_H_ 30 #define __ACCCOMMON_H_ 31 32 33 //using namespace com::sun::star::accessibility; 34 //using namespace com::sun::star::uno; 35 36 37 //for MAccessible.cpp 38 struct ltComp 39 { 40 bool operator()(REFGUID rguid1, REFGUID rguid2) const 41 { 42 if(((PLONG) &rguid1)[0] < ((PLONG) &rguid2)[0]) 43 return TRUE; 44 else if(((PLONG) &rguid1)[0] > ((PLONG) &rguid2)[0]) 45 return FALSE; 46 if(((PLONG) &rguid1)[1] < ((PLONG) &rguid2)[1]) 47 return TRUE; 48 else if(((PLONG) &rguid1)[1] > ((PLONG) &rguid2)[1]) 49 return FALSE; 50 if(((PLONG) &rguid1)[2] < ((PLONG) &rguid2)[2]) 51 return TRUE; 52 else if(((PLONG) &rguid1)[2] > ((PLONG) &rguid2)[2]) 53 return FALSE; 54 if(((PLONG) &rguid1)[3] < ((PLONG) &rguid2)[3]) 55 return TRUE; 56 else if(((PLONG) &rguid1)[3] > ((PLONG) &rguid2)[3]) 57 return FALSE; 58 return FALSE; 59 } 60 }; 61 62 #define BEGIN_AGGOBJECT_MAP(x) \ 63 static _UNO_AGGMAP_ENTRY* WINAPI _GetAggEntries() { \ 64 static _UNO_AGGMAP_ENTRY _aggentries[] = { 65 #define END_AGGOBJECT_MAP() {NULL, NULL,NULL}}; \ 66 return _aggentries;} 67 #define AGGOBJECT_ENTRY(iid, clsid, ifindex) {&iid, \ 68 CComAggregateCreator< CComObject<CMAccessible>, &clsid >::CreateInstance,\ 69 XI_##ifindex}, 70 71 enum DM_NIR { 72 DM_FIRSTCHILD = 0x00, 73 DM_LASTCHILD = 0x01, 74 DM_NEXTCHILD = 0x02, 75 DM_PREVCHILD = 0x03 76 }; 77 78 inline BOOL ImplIsEqualGUID(REFGUID rguid1, REFGUID rguid2) 79 { 80 return ( 81 ((PLONG) &rguid1)[0] == ((PLONG) &rguid2)[0] && 82 ((PLONG) &rguid1)[1] == ((PLONG) &rguid2)[1] && 83 ((PLONG) &rguid1)[2] == ((PLONG) &rguid2)[2] && 84 ((PLONG) &rguid1)[3] == ((PLONG) &rguid2)[3]); 85 } 86 #define InlineIsEqualGUID ImplIsEqualGUID 87 //End 88 89 //for AccAction.cpp 90 #define CODEENTRY(key) \ 91 {KEYCODE_##key, L#key} 92 #define countof(x) (sizeof(x)/sizeof(x[0])) 93 94 #define SELECT L"Select" 95 #define PRESS L"Press" 96 #define UNCHECK L"UnCheck" 97 #define CHECK L"Check" 98 //End 99 100 static DWORD GetMSAAStateFromUNO(short xState); 101 102 #endif 103