1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski #ifndef __ACCTABLE_H_ 23*b1cdbd2cSJim Jagielski #define __ACCTABLE_H_ 24*b1cdbd2cSJim Jagielski 25*b1cdbd2cSJim Jagielski #include "resource.h" // main symbols 26*b1cdbd2cSJim Jagielski 27*b1cdbd2cSJim Jagielski #include <com/sun/star/uno/reference.hxx> 28*b1cdbd2cSJim Jagielski #include <com/sun/star/accessibility/XAccessibleTable.hpp> 29*b1cdbd2cSJim Jagielski #include "UNOXWrapper.h" 30*b1cdbd2cSJim Jagielski 31*b1cdbd2cSJim Jagielski /** 32*b1cdbd2cSJim Jagielski * CAccTable implements IAccessibleTable interface. 33*b1cdbd2cSJim Jagielski */ 34*b1cdbd2cSJim Jagielski class ATL_NO_VTABLE CAccTable : 35*b1cdbd2cSJim Jagielski public CComObjectRoot, 36*b1cdbd2cSJim Jagielski public CComCoClass<CAccTable, &CLSID_AccTable>, 37*b1cdbd2cSJim Jagielski public IAccessibleTable, 38*b1cdbd2cSJim Jagielski public CUNOXWrapper 39*b1cdbd2cSJim Jagielski 40*b1cdbd2cSJim Jagielski { 41*b1cdbd2cSJim Jagielski public: CAccTable()42*b1cdbd2cSJim Jagielski CAccTable() 43*b1cdbd2cSJim Jagielski { 44*b1cdbd2cSJim Jagielski } ~CAccTable()45*b1cdbd2cSJim Jagielski virtual ~CAccTable() 46*b1cdbd2cSJim Jagielski { 47*b1cdbd2cSJim Jagielski } 48*b1cdbd2cSJim Jagielski 49*b1cdbd2cSJim Jagielski BEGIN_COM_MAP(CAccTable) COM_INTERFACE_ENTRY(IAccessibleTable)50*b1cdbd2cSJim Jagielski COM_INTERFACE_ENTRY(IAccessibleTable) 51*b1cdbd2cSJim Jagielski COM_INTERFACE_ENTRY(IUNOXWrapper) 52*b1cdbd2cSJim Jagielski COM_INTERFACE_ENTRY_FUNC_BLIND(NULL,_SmartQI) 53*b1cdbd2cSJim Jagielski END_COM_MAP() 54*b1cdbd2cSJim Jagielski 55*b1cdbd2cSJim Jagielski static HRESULT WINAPI _SmartQI(void* pv, 56*b1cdbd2cSJim Jagielski REFIID iid, void** ppvObject, DWORD) 57*b1cdbd2cSJim Jagielski { 58*b1cdbd2cSJim Jagielski return ((CAccTable*)pv)->SmartQI(iid,ppvObject); 59*b1cdbd2cSJim Jagielski } 60*b1cdbd2cSJim Jagielski SmartQI(REFIID iid,void ** ppvObject)61*b1cdbd2cSJim Jagielski HRESULT SmartQI(REFIID iid, void** ppvObject) 62*b1cdbd2cSJim Jagielski { 63*b1cdbd2cSJim Jagielski if( m_pOuterUnknown ) 64*b1cdbd2cSJim Jagielski return OuterQueryInterface(iid,ppvObject); 65*b1cdbd2cSJim Jagielski return E_FAIL; 66*b1cdbd2cSJim Jagielski } 67*b1cdbd2cSJim Jagielski 68*b1cdbd2cSJim Jagielski DECLARE_REGISTRY_RESOURCEID(IDR_ACCTABLE) 69*b1cdbd2cSJim Jagielski 70*b1cdbd2cSJim Jagielski // IAccessibleTable 71*b1cdbd2cSJim Jagielski public: 72*b1cdbd2cSJim Jagielski // IAccessibleTable 73*b1cdbd2cSJim Jagielski 74*b1cdbd2cSJim Jagielski // Gets accessible table cell. 75*b1cdbd2cSJim Jagielski STDMETHOD(get_accessibleAt)(long row, long column, IUnknown * * accessible); 76*b1cdbd2cSJim Jagielski 77*b1cdbd2cSJim Jagielski // Gets accessible table caption. 78*b1cdbd2cSJim Jagielski STDMETHOD(get_caption)(IUnknown * * accessible); 79*b1cdbd2cSJim Jagielski 80*b1cdbd2cSJim Jagielski // Gets accessible column description (as string). 81*b1cdbd2cSJim Jagielski STDMETHOD(get_columnDescription)(long column, BSTR * description); 82*b1cdbd2cSJim Jagielski 83*b1cdbd2cSJim Jagielski // Gets number of columns spanned by table cell. 84*b1cdbd2cSJim Jagielski STDMETHOD(get_columnExtentAt)(long row, long column, long * nColumnsSpanned); 85*b1cdbd2cSJim Jagielski 86*b1cdbd2cSJim Jagielski // Gets accessible column header. 87*b1cdbd2cSJim Jagielski STDMETHOD(get_columnHeader)(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingRowIndex); 88*b1cdbd2cSJim Jagielski 89*b1cdbd2cSJim Jagielski // Gets total number of columns in table. 90*b1cdbd2cSJim Jagielski STDMETHOD(get_nColumns)(long * columnCount); 91*b1cdbd2cSJim Jagielski 92*b1cdbd2cSJim Jagielski // Gets total number of rows in table. 93*b1cdbd2cSJim Jagielski STDMETHOD(get_nRows)(long * rowCount); 94*b1cdbd2cSJim Jagielski 95*b1cdbd2cSJim Jagielski // Gets total number of selected columns. 96*b1cdbd2cSJim Jagielski STDMETHOD(get_nSelectedColumns)(long * columnCount); 97*b1cdbd2cSJim Jagielski 98*b1cdbd2cSJim Jagielski // Gets total number of selected rows. 99*b1cdbd2cSJim Jagielski STDMETHOD(get_nSelectedRows)(long * rowCount); 100*b1cdbd2cSJim Jagielski 101*b1cdbd2cSJim Jagielski // Gets accessible row description (as string). 102*b1cdbd2cSJim Jagielski STDMETHOD(get_rowDescription)(long row, BSTR * description); 103*b1cdbd2cSJim Jagielski 104*b1cdbd2cSJim Jagielski // Gets number of rows spanned by a table cell. 105*b1cdbd2cSJim Jagielski STDMETHOD(get_rowExtentAt)(long row, long column, long * nRowsSpanned); 106*b1cdbd2cSJim Jagielski 107*b1cdbd2cSJim Jagielski // Gets accessible row header. 108*b1cdbd2cSJim Jagielski STDMETHOD(get_rowHeader)(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingColumnIndex); 109*b1cdbd2cSJim Jagielski 110*b1cdbd2cSJim Jagielski // Gets list of row indexes currently selected (0-based). 111*b1cdbd2cSJim Jagielski STDMETHOD(get_selectedRows)(long maxRows, long **rows, long * nRows); 112*b1cdbd2cSJim Jagielski 113*b1cdbd2cSJim Jagielski // Gets list of column indexes currently selected (0-based). 114*b1cdbd2cSJim Jagielski STDMETHOD(get_selectedColumns)(long maxColumns, long **columns, long * numColumns); 115*b1cdbd2cSJim Jagielski 116*b1cdbd2cSJim Jagielski // Gets accessible table summary. 117*b1cdbd2cSJim Jagielski STDMETHOD(get_summary)(IUnknown * * accessible); 118*b1cdbd2cSJim Jagielski 119*b1cdbd2cSJim Jagielski // Determines if table column is selected. 120*b1cdbd2cSJim Jagielski STDMETHOD(get_isColumnSelected)(long column, unsigned char * isSelected); 121*b1cdbd2cSJim Jagielski 122*b1cdbd2cSJim Jagielski // Determines if table row is selected. 123*b1cdbd2cSJim Jagielski STDMETHOD(get_isRowSelected)(long row, unsigned char * isSelected); 124*b1cdbd2cSJim Jagielski 125*b1cdbd2cSJim Jagielski // Determines if table cell is selected. 126*b1cdbd2cSJim Jagielski STDMETHOD(get_isSelected)(long row, long column, unsigned char * isSelected); 127*b1cdbd2cSJim Jagielski 128*b1cdbd2cSJim Jagielski // Selects a row and unselect all previously selected rows. 129*b1cdbd2cSJim Jagielski STDMETHOD(selectRow)(long row ); 130*b1cdbd2cSJim Jagielski 131*b1cdbd2cSJim Jagielski 132*b1cdbd2cSJim Jagielski // Selects a column and unselect all previously selected columns. 133*b1cdbd2cSJim Jagielski 134*b1cdbd2cSJim Jagielski STDMETHOD(selectColumn)(long column); 135*b1cdbd2cSJim Jagielski 136*b1cdbd2cSJim Jagielski // Unselects one row, leaving other selected rows selected (if any). 137*b1cdbd2cSJim Jagielski STDMETHOD(unselectRow)(long row); 138*b1cdbd2cSJim Jagielski 139*b1cdbd2cSJim Jagielski // Unselects one column, leaving other selected columns selected (if any). 140*b1cdbd2cSJim Jagielski STDMETHOD(unselectColumn)(long column); 141*b1cdbd2cSJim Jagielski 142*b1cdbd2cSJim Jagielski //get Column index 143*b1cdbd2cSJim Jagielski STDMETHOD(get_columnIndex)(long childIndex, long * columnIndex); 144*b1cdbd2cSJim Jagielski 145*b1cdbd2cSJim Jagielski STDMETHOD(get_rowIndex)(long childIndex, long * rowIndex); 146*b1cdbd2cSJim Jagielski 147*b1cdbd2cSJim Jagielski STDMETHOD(get_childIndex)(long rowIndex,long columnIndex, long * childIndex); 148*b1cdbd2cSJim Jagielski 149*b1cdbd2cSJim Jagielski STDMETHOD(get_nSelectedChildren)(long *childCount); 150*b1cdbd2cSJim Jagielski 151*b1cdbd2cSJim Jagielski STDMETHOD(get_selectedChildren)(long maxChildren, long **children, long *nChildren); 152*b1cdbd2cSJim Jagielski 153*b1cdbd2cSJim Jagielski STDMETHOD(get_rowColumnExtentsAtIndex)( long index, 154*b1cdbd2cSJim Jagielski long *row, 155*b1cdbd2cSJim Jagielski long *column, 156*b1cdbd2cSJim Jagielski long *rowExtents, 157*b1cdbd2cSJim Jagielski long *columnExtents, 158*b1cdbd2cSJim Jagielski boolean *isSelected) ; 159*b1cdbd2cSJim Jagielski 160*b1cdbd2cSJim Jagielski STDMETHOD(get_modelChange)(IA2TableModelChange *modelChange); 161*b1cdbd2cSJim Jagielski 162*b1cdbd2cSJim Jagielski // Overide of IUNOXWrapper. 163*b1cdbd2cSJim Jagielski STDMETHOD(put_XInterface)(long pXInterface); 164*b1cdbd2cSJim Jagielski 165*b1cdbd2cSJim Jagielski private: 166*b1cdbd2cSJim Jagielski 167*b1cdbd2cSJim Jagielski com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleTable> pRXTable; 168*b1cdbd2cSJim Jagielski GetXInterface()169*b1cdbd2cSJim Jagielski inline com::sun::star::accessibility::XAccessibleTable* GetXInterface() 170*b1cdbd2cSJim Jagielski { 171*b1cdbd2cSJim Jagielski return pRXTable.get(); 172*b1cdbd2cSJim Jagielski } 173*b1cdbd2cSJim Jagielski }; 174*b1cdbd2cSJim Jagielski 175*b1cdbd2cSJim Jagielski #endif //__ACCTABLE_H_ 176