LibreOffice Module winaccessibility (master) 1
AccTable.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include "Resource.h" // main symbols
23
24#include <com/sun/star/uno/Reference.hxx>
25#include <com/sun/star/accessibility/XAccessibleTable.hpp>
26#include "UNOXWrapper.h"
27
31class ATL_NO_VTABLE CAccTable :
32 public CComObjectRoot,
33 public CComCoClass<CAccTable, &CLSID_AccTable>,
34 public IAccessibleTable,
35 public IAccessibleTable2,
36 public CUNOXWrapper
37
38{
39public:
41 {
42 }
43 virtual ~CAccTable()
44 {
45 }
46
47 BEGIN_COM_MAP(CAccTable)
48 COM_INTERFACE_ENTRY(IAccessibleTable)
49 COM_INTERFACE_ENTRY(IAccessibleTable2)
50 COM_INTERFACE_ENTRY(IUNOXWrapper)
51 COM_INTERFACE_ENTRY_FUNC_BLIND(0,SmartQI_)
52#if defined __clang__
53#pragma clang diagnostic push
54#pragma clang diagnostic ignored "-Winconsistent-missing-override"
55#endif
56 END_COM_MAP()
57#if defined __clang__
58#pragma clang diagnostic pop
59#endif
60
61 static HRESULT WINAPI SmartQI_(void* pv,
62 REFIID iid, void** ppvObject, DWORD_PTR)
63 {
64 return static_cast<CAccTable*>(pv)->SmartQI(iid,ppvObject);
65 }
66
67 HRESULT SmartQI(REFIID iid, void** ppvObject)
68 {
69 if( m_pOuterUnknown )
70 return OuterQueryInterface(iid,ppvObject);
71 return E_FAIL;
72 }
73
74 DECLARE_NO_REGISTRY()
75
76public:
77 // IAccessibleTable and IAccessibleTable2
78
79 // Gets accessible table cell (IAccessibleTable version).
80 STDMETHOD(get_accessibleAt)(long row, long column, IUnknown * * accessible) override;
81
82 // Gets accessible table cell (IAccessibleTable2 version).
83 STDMETHOD(get_cellAt)(long row, long column, IUnknown * * cell) override;
84
85 // Gets accessible table caption.
86 STDMETHOD(get_caption)(IUnknown * * accessible) override;
87
88 // Gets accessible column description (as string).
89 STDMETHOD(get_columnDescription)(long column, BSTR * description) override;
90
91 // Gets number of columns spanned by table cell.
92 STDMETHOD(get_columnExtentAt)(long row, long column, long * nColumnsSpanned) override;
93
94 // Gets accessible column header.
95 STDMETHOD(get_columnHeader)(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingRowIndex) override;
96
97 // Gets total number of columns in table.
98 STDMETHOD(get_nColumns)(long * columnCount) override;
99
100 // Gets total number of rows in table.
101 STDMETHOD(get_nRows)(long * rowCount) override;
102
103 // Gets total number of selected columns.
104 STDMETHOD(get_nSelectedColumns)(long * columnCount) override;
105
106 // Gets total number of selected rows.
107 STDMETHOD(get_nSelectedRows)(long * rowCount) override;
108
109 // Gets accessible row description (as string).
110 STDMETHOD(get_rowDescription)(long row, BSTR * description) override;
111
112 // Gets number of rows spanned by a table cell.
113 STDMETHOD(get_rowExtentAt)(long row, long column, long * nRowsSpanned) override;
114
115 // Gets accessible row header.
116 STDMETHOD(get_rowHeader)(IAccessibleTable __RPC_FAR *__RPC_FAR *accessibleTable, long *startingColumnIndex) override;
117
118 // Gets list of row indexes currently selected (0-based).
119 STDMETHOD(get_selectedRows)(long **rows, long * nRows) override;
120 STDMETHOD(get_selectedRows)(long maxRows, long **rows, long * nRows) override;
121
122 // Gets list of column indexes currently selected (0-based).
123 STDMETHOD(get_selectedColumns)(long **columns, long * numColumns) override;
124 STDMETHOD(get_selectedColumns)(long maxColumns, long **columns, long * numColumns) override;
125
126 // Gets accessible table summary.
127 STDMETHOD(get_summary)(IUnknown * * accessible) override;
128
129 // Determines if table column is selected.
130 STDMETHOD(get_isColumnSelected)(long column, boolean * isSelected) override;
131
132 // Determines if table row is selected.
133 STDMETHOD(get_isRowSelected)(long row, boolean * isSelected) override;
134
135 // Determines if table cell is selected.
136 STDMETHOD(get_isSelected)(long row, long column, boolean * isSelected) override;
137
138 // Selects a row and unselect all previously selected rows.
139 STDMETHOD(selectRow)(long row ) override;
140
141
142 // Selects a column and unselect all previously selected columns.
143
144 STDMETHOD(selectColumn)(long column) override;
145
146 // Unselects one row, leaving other selected rows selected (if any).
147 STDMETHOD(unselectRow)(long row) override;
148
149 // Unselects one column, leaving other selected columns selected (if any).
150 STDMETHOD(unselectColumn)(long column) override;
151
152 //get Column index
153 STDMETHOD(get_columnIndex)(long childIndex, long * columnIndex) override;
154
155 STDMETHOD(get_rowIndex)(long childIndex, long * rowIndex) override;
156
157 STDMETHOD(get_childIndex)(long rowIndex,long columnIndex, long * childIndex) override;
158
159 // get total number of selected cells
160 STDMETHOD(get_nSelectedChildren)(long *childCount) override;
161 STDMETHOD(get_nSelectedCells)(long *childCount) override;
162
163 STDMETHOD(get_selectedChildren)(long maxChildren, long **children, long *nChildren) override;
164
165 // Returns a list of accessibles currently selected
166 STDMETHOD(get_selectedCells)(IUnknown * * * cells, long *nSelectedCells) override;
167
168 STDMETHOD(get_rowColumnExtentsAtIndex)( long index,
169 long *row,
170 long *column,
171 long *rowExtents,
172 long *columnExtents,
173 boolean *isSelected) override;
174
175 STDMETHOD(get_modelChange)(IA2TableModelChange *modelChange) override;
176
177 // Override of IUNOXWrapper.
178 STDMETHOD(put_XInterface)(hyper pXInterface) override;
179
180private:
181 css::uno::Reference<css::accessibility::XAccessibleTable> pRXTable;
182};
183
184/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CAccTable implements the IAccessibleTable and IAccessibleTable2 interfaces.
Definition: AccTable.h:38
CAccTable()
Definition: AccTable.h:40
virtual ~CAccTable()
Definition: AccTable.h:43
static HRESULT WINAPI SmartQI_(void *pv, REFIID iid, void **ppvObject, DWORD_PTR)
Definition: AccTable.h:61
HRESULT SmartQI(REFIID iid, void **ppvObject)
Definition: AccTable.h:67
CUNOXWrapper implements IUNOXWrapper interface.
Definition: UNOXWrapper.h:32
This interface gives access to a two-dimensional table.
This interface gives access to a two-dimensional table.
A structure defining the type of and extents of changes made to a table.