1*5fdc4257SSteve Yin /************************************************************************* 2*5fdc4257SSteve Yin * 3*5fdc4257SSteve Yin * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*5fdc4257SSteve Yin * 5*5fdc4257SSteve Yin * Copyright IBM Corporation 2010. 6*5fdc4257SSteve Yin * Copyright 2000, 2010 Oracle and/or its affiliates. 7*5fdc4257SSteve Yin * 8*5fdc4257SSteve Yin * OpenOffice.org - a multi-platform office productivity suite 9*5fdc4257SSteve Yin * 10*5fdc4257SSteve Yin * This file is part of OpenOffice.org. 11*5fdc4257SSteve Yin * 12*5fdc4257SSteve Yin * OpenOffice.org is free software: you can redistribute it and/or modify 13*5fdc4257SSteve Yin * it under the terms of the GNU Lesser General Public License version 3 14*5fdc4257SSteve Yin * only, as published by the Free Software Foundation. 15*5fdc4257SSteve Yin * 16*5fdc4257SSteve Yin * OpenOffice.org is distributed in the hope that it will be useful, 17*5fdc4257SSteve Yin * but WITHOUT ANY WARRANTY; without even the implied warranty of 18*5fdc4257SSteve Yin * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19*5fdc4257SSteve Yin * GNU Lesser General Public License version 3 for more details 20*5fdc4257SSteve Yin * (a copy is included in the LICENSE file that accompanied this code). 21*5fdc4257SSteve Yin * 22*5fdc4257SSteve Yin * You should have received a copy of the GNU Lesser General Public License 23*5fdc4257SSteve Yin * version 3 along with OpenOffice.org. If not, see 24*5fdc4257SSteve Yin * <http://www.openoffice.org/license.html> 25*5fdc4257SSteve Yin * for a copy of the LGPLv3 License. 26*5fdc4257SSteve Yin * 27*5fdc4257SSteve Yin ************************************************************************/ 28*5fdc4257SSteve Yin 29*5fdc4257SSteve Yin #ifndef __ACCTABLE_H_ 30*5fdc4257SSteve Yin #define __ACCTABLE_H_ 31*5fdc4257SSteve Yin 32*5fdc4257SSteve Yin #include "resource.h" // main symbols 33*5fdc4257SSteve Yin 34*5fdc4257SSteve Yin #include <com/sun/star/uno/reference.hxx> 35*5fdc4257SSteve Yin #include <com/sun/star/accessibility/XAccessibleTable.hpp> 36*5fdc4257SSteve Yin #include "UNOXWrapper.h" 37*5fdc4257SSteve Yin 38*5fdc4257SSteve Yin /** 39*5fdc4257SSteve Yin * CAccTable implements IAccessibleTable interface. 40*5fdc4257SSteve Yin */ 41*5fdc4257SSteve Yin class ATL_NO_VTABLE CAccTable : 42*5fdc4257SSteve Yin public CComObjectRoot, 43*5fdc4257SSteve Yin public CComCoClass<CAccTable, &CLSID_AccTable>, 44*5fdc4257SSteve Yin public IAccessibleTable, 45*5fdc4257SSteve Yin public CUNOXWrapper 46*5fdc4257SSteve Yin 47*5fdc4257SSteve Yin { 48*5fdc4257SSteve Yin public: 49*5fdc4257SSteve Yin CAccTable() 50*5fdc4257SSteve Yin { 51*5fdc4257SSteve Yin } 52*5fdc4257SSteve Yin virtual ~CAccTable() 53*5fdc4257SSteve Yin { 54*5fdc4257SSteve Yin } 55*5fdc4257SSteve Yin 56*5fdc4257SSteve Yin BEGIN_COM_MAP(CAccTable) 57*5fdc4257SSteve Yin COM_INTERFACE_ENTRY(IAccessibleTable) 58*5fdc4257SSteve Yin COM_INTERFACE_ENTRY(IUNOXWrapper) 59*5fdc4257SSteve Yin COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI) 60*5fdc4257SSteve Yin END_COM_MAP() 61*5fdc4257SSteve Yin 62*5fdc4257SSteve Yin static HRESULT WINAPI _SmartQI(void* pv, 63*5fdc4257SSteve Yin REFIID iid, void** ppvObject, DWORD) 64*5fdc4257SSteve Yin { 65*5fdc4257SSteve Yin return ((CAccTable*)pv)->SmartQI(iid,ppvObject); 66*5fdc4257SSteve Yin } 67*5fdc4257SSteve Yin 68*5fdc4257SSteve Yin HRESULT SmartQI(REFIID iid, void** ppvObject) 69*5fdc4257SSteve Yin { 70*5fdc4257SSteve Yin if( m_pOuterUnknown ) 71*5fdc4257SSteve Yin return OuterQueryInterface(iid,ppvObject); 72*5fdc4257SSteve Yin return E_FAIL; 73*5fdc4257SSteve Yin } 74*5fdc4257SSteve Yin 75*5fdc4257SSteve Yin DECLARE_REGISTRY_RESOURCEID(IDR_ACCTABLE) 76*5fdc4257SSteve Yin 77*5fdc4257SSteve Yin // IAccessibleTable 78*5fdc4257SSteve Yin public: 79*5fdc4257SSteve Yin // IAccessibleTable 80*5fdc4257SSteve Yin 81*5fdc4257SSteve Yin // Gets accessible table cell. 82*5fdc4257SSteve Yin STDMETHOD(get_accessibleAt)(long row, long column, IUnknown * * accessible); 83*5fdc4257SSteve Yin 84*5fdc4257SSteve Yin // Gets accessible table caption. 85*5fdc4257SSteve Yin STDMETHOD(get_caption)(IUnknown * * accessible); 86*5fdc4257SSteve Yin 87*5fdc4257SSteve Yin // Gets accessible column description (as string). 88*5fdc4257SSteve Yin STDMETHOD(get_columnDescription)(long column, BSTR * description); 89*5fdc4257SSteve Yin 90*5fdc4257SSteve Yin // Gets number of columns spanned by table cell. 91*5fdc4257SSteve Yin STDMETHOD(get_columnExtentAt)(long row, long column, long * nColumnsSpanned); 92*5fdc4257SSteve Yin 93*5fdc4257SSteve Yin // Gets accessible column header. 94*5fdc4257SSteve Yin STDMETHOD(get_columnHeader)(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingRowIndex); 95*5fdc4257SSteve Yin 96*5fdc4257SSteve Yin // Gets total number of columns in table. 97*5fdc4257SSteve Yin STDMETHOD(get_nColumns)(long * columnCount); 98*5fdc4257SSteve Yin 99*5fdc4257SSteve Yin // Gets total number of rows in table. 100*5fdc4257SSteve Yin STDMETHOD(get_nRows)(long * rowCount); 101*5fdc4257SSteve Yin 102*5fdc4257SSteve Yin // Gets total number of selected columns. 103*5fdc4257SSteve Yin STDMETHOD(get_nSelectedColumns)(long * columnCount); 104*5fdc4257SSteve Yin 105*5fdc4257SSteve Yin // Gets total number of selected rows. 106*5fdc4257SSteve Yin STDMETHOD(get_nSelectedRows)(long * rowCount); 107*5fdc4257SSteve Yin 108*5fdc4257SSteve Yin // Gets accessible row description (as string). 109*5fdc4257SSteve Yin STDMETHOD(get_rowDescription)(long row, BSTR * description); 110*5fdc4257SSteve Yin 111*5fdc4257SSteve Yin // Gets number of rows spanned by a table cell. 112*5fdc4257SSteve Yin STDMETHOD(get_rowExtentAt)(long row, long column, long * nRowsSpanned); 113*5fdc4257SSteve Yin 114*5fdc4257SSteve Yin // Gets accessible row header. 115*5fdc4257SSteve Yin STDMETHOD(get_rowHeader)(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingColumnIndex); 116*5fdc4257SSteve Yin 117*5fdc4257SSteve Yin // Gets list of row indexes currently selected (0-based). 118*5fdc4257SSteve Yin STDMETHOD(get_selectedRows)(long maxRows, long **rows, long * nRows); 119*5fdc4257SSteve Yin 120*5fdc4257SSteve Yin // Gets list of column indexes currently selected (0-based). 121*5fdc4257SSteve Yin STDMETHOD(get_selectedColumns)(long maxColumns, long **columns, long * numColumns); 122*5fdc4257SSteve Yin 123*5fdc4257SSteve Yin // Gets accessible table summary. 124*5fdc4257SSteve Yin STDMETHOD(get_summary)(IUnknown * * accessible); 125*5fdc4257SSteve Yin 126*5fdc4257SSteve Yin // Determines if table column is selected. 127*5fdc4257SSteve Yin STDMETHOD(get_isColumnSelected)(long column, unsigned char * isSelected); 128*5fdc4257SSteve Yin 129*5fdc4257SSteve Yin // Determines if table row is selected. 130*5fdc4257SSteve Yin STDMETHOD(get_isRowSelected)(long row, unsigned char * isSelected); 131*5fdc4257SSteve Yin 132*5fdc4257SSteve Yin // Determines if table cell is selected. 133*5fdc4257SSteve Yin STDMETHOD(get_isSelected)(long row, long column, unsigned char * isSelected); 134*5fdc4257SSteve Yin 135*5fdc4257SSteve Yin // Selects a row and unselect all previously selected rows. 136*5fdc4257SSteve Yin STDMETHOD(selectRow)(long row ); 137*5fdc4257SSteve Yin 138*5fdc4257SSteve Yin 139*5fdc4257SSteve Yin // Selects a column and unselect all previously selected columns. 140*5fdc4257SSteve Yin 141*5fdc4257SSteve Yin STDMETHOD(selectColumn)(long column); 142*5fdc4257SSteve Yin 143*5fdc4257SSteve Yin // Unselects one row, leaving other selected rows selected (if any). 144*5fdc4257SSteve Yin STDMETHOD(unselectRow)(long row); 145*5fdc4257SSteve Yin 146*5fdc4257SSteve Yin // Unselects one column, leaving other selected columns selected (if any). 147*5fdc4257SSteve Yin STDMETHOD(unselectColumn)(long column); 148*5fdc4257SSteve Yin 149*5fdc4257SSteve Yin //get Column index 150*5fdc4257SSteve Yin STDMETHOD(get_columnIndex)(long childIndex, long * columnIndex); 151*5fdc4257SSteve Yin 152*5fdc4257SSteve Yin STDMETHOD(get_rowIndex)(long childIndex, long * rowIndex); 153*5fdc4257SSteve Yin 154*5fdc4257SSteve Yin STDMETHOD(get_childIndex)(long rowIndex,long columnIndex, long * childIndex); 155*5fdc4257SSteve Yin 156*5fdc4257SSteve Yin STDMETHOD(get_nSelectedChildren)(long *childCount); 157*5fdc4257SSteve Yin 158*5fdc4257SSteve Yin STDMETHOD(get_selectedChildren)(long maxChildren, long **children, long *nChildren); 159*5fdc4257SSteve Yin 160*5fdc4257SSteve Yin STDMETHOD(get_rowColumnExtentsAtIndex)( long index, 161*5fdc4257SSteve Yin long *row, 162*5fdc4257SSteve Yin long *column, 163*5fdc4257SSteve Yin long *rowExtents, 164*5fdc4257SSteve Yin long *columnExtents, 165*5fdc4257SSteve Yin boolean *isSelected) ; 166*5fdc4257SSteve Yin 167*5fdc4257SSteve Yin STDMETHOD(get_modelChange)(IA2TableModelChange *modelChange); 168*5fdc4257SSteve Yin 169*5fdc4257SSteve Yin // Overide of IUNOXWrapper. 170*5fdc4257SSteve Yin STDMETHOD(put_XInterface)(long pXInterface); 171*5fdc4257SSteve Yin 172*5fdc4257SSteve Yin private: 173*5fdc4257SSteve Yin 174*5fdc4257SSteve Yin com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleTable> pRXTable; 175*5fdc4257SSteve Yin 176*5fdc4257SSteve Yin inline com::sun::star::accessibility::XAccessibleTable* GetXInterface() 177*5fdc4257SSteve Yin { 178*5fdc4257SSteve Yin return pRXTable.get(); 179*5fdc4257SSteve Yin } 180*5fdc4257SSteve Yin }; 181*5fdc4257SSteve Yin 182*5fdc4257SSteve Yin #endif //__ACCTABLE_H_ 183