1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCTABLE_H
21 #define INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCTABLE_H
23 #include "resource.h" // main symbols
25 #include <com/sun/star/uno/reference.hxx>
26 #include <com/sun/star/accessibility/XAccessibleTable.hpp>
27 #include "UNOXWrapper.h"
30 * CAccTable implements IAccessibleTable interface.
32 class ATL_NO_VTABLE CAccTable
:
33 public CComObjectRoot
,
34 public CComCoClass
<CAccTable
, &CLSID_AccTable
>,
35 public IAccessibleTable
,
47 BEGIN_COM_MAP(CAccTable
)
48 COM_INTERFACE_ENTRY(IAccessibleTable
)
49 COM_INTERFACE_ENTRY(IUNOXWrapper
)
50 COM_INTERFACE_ENTRY_FUNC_BLIND(NULL
,_SmartQI
)
53 static HRESULT WINAPI
_SmartQI(void* pv
,
54 REFIID iid
, void** ppvObject
, DWORD_PTR
)
56 return ((CAccTable
*)pv
)->SmartQI(iid
,ppvObject
);
59 HRESULT
SmartQI(REFIID iid
, void** ppvObject
)
62 return OuterQueryInterface(iid
,ppvObject
);
71 // Gets accessible table cell.
72 STDMETHOD(get_accessibleAt
)(long row
, long column
, IUnknown
* * accessible
);
74 // Gets accessible table caption.
75 STDMETHOD(get_caption
)(IUnknown
* * accessible
);
77 // Gets accessible column description (as string).
78 STDMETHOD(get_columnDescription
)(long column
, BSTR
* description
);
80 // Gets number of columns spanned by table cell.
81 STDMETHOD(get_columnExtentAt
)(long row
, long column
, long * nColumnsSpanned
);
83 // Gets accessible column header.
84 STDMETHOD(get_columnHeader
)(IAccessibleTable __RPC_FAR
*__RPC_FAR
*accessibleTable
, long *startingRowIndex
);
86 // Gets total number of columns in table.
87 STDMETHOD(get_nColumns
)(long * columnCount
);
89 // Gets total number of rows in table.
90 STDMETHOD(get_nRows
)(long * rowCount
);
92 // Gets total number of selected columns.
93 STDMETHOD(get_nSelectedColumns
)(long * columnCount
);
95 // Gets total number of selected rows.
96 STDMETHOD(get_nSelectedRows
)(long * rowCount
);
98 // Gets accessible row description (as string).
99 STDMETHOD(get_rowDescription
)(long row
, BSTR
* description
);
101 // Gets number of rows spanned by a table cell.
102 STDMETHOD(get_rowExtentAt
)(long row
, long column
, long * nRowsSpanned
);
104 // Gets accessible row header.
105 STDMETHOD(get_rowHeader
)(IAccessibleTable __RPC_FAR
*__RPC_FAR
*accessibleTable
, long *startingColumnIndex
);
107 // Gets list of row indexes currently selected (0-based).
108 STDMETHOD(get_selectedRows
)(long maxRows
, long **rows
, long * nRows
);
110 // Gets list of column indexes currently selected (0-based).
111 STDMETHOD(get_selectedColumns
)(long maxColumns
, long **columns
, long * numColumns
);
113 // Gets accessible table summary.
114 STDMETHOD(get_summary
)(IUnknown
* * accessible
);
116 // Determines if table column is selected.
117 STDMETHOD(get_isColumnSelected
)(long column
, unsigned char * isSelected
);
119 // Determines if table row is selected.
120 STDMETHOD(get_isRowSelected
)(long row
, unsigned char * isSelected
);
122 // Determines if table cell is selected.
123 STDMETHOD(get_isSelected
)(long row
, long column
, unsigned char * isSelected
);
125 // Selects a row and unselect all previously selected rows.
126 STDMETHOD(selectRow
)(long row
);
129 // Selects a column and unselect all previously selected columns.
131 STDMETHOD(selectColumn
)(long column
);
133 // Unselects one row, leaving other selected rows selected (if any).
134 STDMETHOD(unselectRow
)(long row
);
136 // Unselects one column, leaving other selected columns selected (if any).
137 STDMETHOD(unselectColumn
)(long column
);
140 STDMETHOD(get_columnIndex
)(long childIndex
, long * columnIndex
);
142 STDMETHOD(get_rowIndex
)(long childIndex
, long * rowIndex
);
144 STDMETHOD(get_childIndex
)(long rowIndex
,long columnIndex
, long * childIndex
);
146 STDMETHOD(get_nSelectedChildren
)(long *childCount
);
148 STDMETHOD(get_selectedChildren
)(long maxChildren
, long **children
, long *nChildren
);
150 STDMETHOD(get_rowColumnExtentsAtIndex
)( long index
,
155 boolean
*isSelected
) ;
157 STDMETHOD(get_modelChange
)(IA2TableModelChange
*modelChange
);
159 // Override of IUNOXWrapper.
160 STDMETHOD(put_XInterface
)(hyper pXInterface
);
164 com::sun::star::uno::Reference
<com::sun::star::accessibility::XAccessibleTable
> pRXTable
;
166 inline com::sun::star::accessibility::XAccessibleTable
* GetXInterface()
168 return pRXTable
.get();
172 #endif // INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCTABLE_H
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */