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_
)
52 #pragma clang diagnostic push
53 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
57 #pragma clang diagnostic pop
60 static HRESULT WINAPI
SmartQI_(void* pv
,
61 REFIID iid
, void** ppvObject
, DWORD_PTR
)
63 return static_cast<CAccTable
*>(pv
)->SmartQI(iid
,ppvObject
);
66 HRESULT
SmartQI(REFIID iid
, void** ppvObject
)
69 return OuterQueryInterface(iid
,ppvObject
);
78 // Gets accessible table cell.
79 STDMETHOD(get_accessibleAt
)(long row
, long column
, IUnknown
* * accessible
) override
;
81 // Gets accessible table caption.
82 STDMETHOD(get_caption
)(IUnknown
* * accessible
) override
;
84 // Gets accessible column description (as string).
85 STDMETHOD(get_columnDescription
)(long column
, BSTR
* description
) override
;
87 // Gets number of columns spanned by table cell.
88 STDMETHOD(get_columnExtentAt
)(long row
, long column
, long * nColumnsSpanned
) override
;
90 // Gets accessible column header.
91 STDMETHOD(get_columnHeader
)(IAccessibleTable __RPC_FAR
*__RPC_FAR
*accessibleTable
, long *startingRowIndex
) override
;
93 // Gets total number of columns in table.
94 STDMETHOD(get_nColumns
)(long * columnCount
) override
;
96 // Gets total number of rows in table.
97 STDMETHOD(get_nRows
)(long * rowCount
) override
;
99 // Gets total number of selected columns.
100 STDMETHOD(get_nSelectedColumns
)(long * columnCount
) override
;
102 // Gets total number of selected rows.
103 STDMETHOD(get_nSelectedRows
)(long * rowCount
) override
;
105 // Gets accessible row description (as string).
106 STDMETHOD(get_rowDescription
)(long row
, BSTR
* description
) override
;
108 // Gets number of rows spanned by a table cell.
109 STDMETHOD(get_rowExtentAt
)(long row
, long column
, long * nRowsSpanned
) override
;
111 // Gets accessible row header.
112 STDMETHOD(get_rowHeader
)(IAccessibleTable __RPC_FAR
*__RPC_FAR
*accessibleTable
, long *startingColumnIndex
) override
;
114 // Gets list of row indexes currently selected (0-based).
115 STDMETHOD(get_selectedRows
)(long maxRows
, long **rows
, long * nRows
) override
;
117 // Gets list of column indexes currently selected (0-based).
118 STDMETHOD(get_selectedColumns
)(long maxColumns
, long **columns
, long * numColumns
) override
;
120 // Gets accessible table summary.
121 STDMETHOD(get_summary
)(IUnknown
* * accessible
) override
;
123 // Determines if table column is selected.
124 STDMETHOD(get_isColumnSelected
)(long column
, boolean
* isSelected
) override
;
126 // Determines if table row is selected.
127 STDMETHOD(get_isRowSelected
)(long row
, boolean
* isSelected
) override
;
129 // Determines if table cell is selected.
130 STDMETHOD(get_isSelected
)(long row
, long column
, boolean
* isSelected
) override
;
132 // Selects a row and unselect all previously selected rows.
133 STDMETHOD(selectRow
)(long row
) override
;
136 // Selects a column and unselect all previously selected columns.
138 STDMETHOD(selectColumn
)(long column
) override
;
140 // Unselects one row, leaving other selected rows selected (if any).
141 STDMETHOD(unselectRow
)(long row
) override
;
143 // Unselects one column, leaving other selected columns selected (if any).
144 STDMETHOD(unselectColumn
)(long column
) override
;
147 STDMETHOD(get_columnIndex
)(long childIndex
, long * columnIndex
) override
;
149 STDMETHOD(get_rowIndex
)(long childIndex
, long * rowIndex
) override
;
151 STDMETHOD(get_childIndex
)(long rowIndex
,long columnIndex
, long * childIndex
) override
;
153 STDMETHOD(get_nSelectedChildren
)(long *childCount
) override
;
155 STDMETHOD(get_selectedChildren
)(long maxChildren
, long **children
, long *nChildren
) override
;
157 STDMETHOD(get_rowColumnExtentsAtIndex
)( long index
,
162 boolean
*isSelected
) override
;
164 STDMETHOD(get_modelChange
)(IA2TableModelChange
*modelChange
) override
;
166 // Override of IUNOXWrapper.
167 STDMETHOD(put_XInterface
)(hyper pXInterface
) override
;
171 css::uno::Reference
<css::accessibility::XAccessibleTable
> pRXTable
;
173 css::accessibility::XAccessibleTable
* GetXInterface()
175 return pRXTable
.get();
179 #endif // INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCTABLE_H
181 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */