LibreOffice Module toolkit (master) 1
gridcontrol.hxx
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#ifndef INCLUDED_TOOLKIT_SOURCE_CONTROLS_GRID_GRIDCONTROL_HXX
21#define INCLUDED_TOOLKIT_SOURCE_CONTROLS_GRID_GRIDCONTROL_HXX
22
23#include <com/sun/star/awt/grid/XGridControl.hpp>
24#include <com/sun/star/awt/grid/XGridRowSelection.hpp>
25
30
31#include <memory>
32
33namespace toolkit
34{
35
36class GridEventForwarder;
37
38
39// = UnoGridModel
40
42{
43protected:
44 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
46
47public:
48 explicit UnoGridModel( const css::uno::Reference< css::uno::XComponentContext >& i_factory );
49 UnoGridModel( const UnoGridModel& rModel );
50
52
53 // css::lang::XComponent
54 void SAL_CALL dispose( ) override;
55
56 // css::beans::XMultiPropertySet
57 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
58
59 // css::io::XPersistObject
60 OUString SAL_CALL getServiceName() override;
61
62 // OPropertySetHelper
63 void setFastPropertyValue_NoBroadcast( std::unique_lock<std::mutex>& rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override;
64
65 // XServiceInfo
66 OUString SAL_CALL getImplementationName() override
67 { return "stardiv.Toolkit.GridControlModel"; }
68
69 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
70 {
72 s.realloc(s.getLength() + 1);
73 s.getArray()[s.getLength() - 1] = "com.sun.star.awt.grid.UnoControlGridModel";
74 return s;
75 }
76};
77
78
79// = UnoGridControl
80
82 , css::awt::grid::XGridControl
83 , css::awt::grid::XGridRowSelection
86{
87public:
89 OUString GetComponentServiceName() const override;
90
91 // css::lang::XComponent
92 void SAL_CALL dispose( ) override;
93
94 // css::awt::XControl
95 void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
96 sal_Bool SAL_CALL setModel( const css::uno::Reference< css::awt::XControlModel >& rxModel ) override;
97
98 // css::awt::grid::XGridControl
99 virtual ::sal_Int32 SAL_CALL getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) override;
100 virtual ::sal_Int32 SAL_CALL getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) override;
101 virtual ::sal_Int32 SAL_CALL getCurrentColumn( ) override;
102 virtual ::sal_Int32 SAL_CALL getCurrentRow( ) override;
103 virtual void SAL_CALL goToCell( ::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex ) override;
104
105 // css::awt::grid::XGridRowSelection
106 virtual void SAL_CALL selectRow( ::sal_Int32 i_rowIndex ) override;
107 virtual void SAL_CALL selectAllRows() override;
108 virtual void SAL_CALL deselectRow( ::sal_Int32 i_rowIndex ) override;
109 virtual void SAL_CALL deselectAllRows() override;
110 virtual css::uno::Sequence< ::sal_Int32 > SAL_CALL getSelectedRows() override;
111 virtual sal_Bool SAL_CALL hasSelectedRows() override;
112 virtual sal_Bool SAL_CALL isRowSelected(::sal_Int32 index) override;
113 virtual void SAL_CALL addSelectionListener(const css::uno::Reference< css::awt::grid::XGridSelectionListener > & listener) override;
114 virtual void SAL_CALL removeSelectionListener(const css::uno::Reference< css::awt::grid::XGridSelectionListener > & listener) override;
115
116 // css::lang::XServiceInfo
117 OUString SAL_CALL getImplementationName() override
118 { return "stardiv.Toolkit.GridControl"; }
119
120 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
121 {
123 s.realloc(s.getLength() + 1);
124 s.getArray()[s.getLength() - 1] = "com.sun.star.awt.grid.UnoControlGrid";
125 return s;
126 }
127
129
130protected:
131 virtual ~UnoGridControl() override;
132
133private:
134 SelectionListenerMultiplexer m_aSelectionListeners;
135 std::unique_ptr< GridEventForwarder > m_pEventForwarder;
136};
137
138} // toolkit
139
140#endif // _TOOLKIT_TREE_CONTROL_HXX
141
142/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::awt::XWindowPeer > SAL_CALL getPeer() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL hasSelectedRows() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual ::sal_Int32 SAL_CALL getCurrentRow() override
virtual void SAL_CALL deselectAllRows() override
virtual sal_Bool SAL_CALL isRowSelected(::sal_Int32 index) override
std::unique_ptr< GridEventForwarder > m_pEventForwarder
OUString GetComponentServiceName() const override
virtual void SAL_CALL goToCell(::sal_Int32 i_columnIndex, ::sal_Int32 i_rowIndex) override
virtual void SAL_CALL selectRow(::sal_Int32 i_rowIndex) override
virtual ::sal_Int32 SAL_CALL getColumnAtPoint(::sal_Int32 x, ::sal_Int32 y) override
virtual ~UnoGridControl() override
virtual void SAL_CALL selectAllRows() override
OUString SAL_CALL getImplementationName() override
virtual ::sal_Int32 SAL_CALL getCurrentColumn() override
virtual css::uno::Sequence< ::sal_Int32 > SAL_CALL getSelectedRows() override
virtual void SAL_CALL addSelectionListener(const css::uno::Reference< css::awt::grid::XGridSelectionListener > &listener) override
virtual ::sal_Int32 SAL_CALL getRowAtPoint(::sal_Int32 x, ::sal_Int32 y) override
void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
virtual void SAL_CALL deselectRow(::sal_Int32 i_rowIndex) override
SelectionListenerMultiplexer m_aSelectionListeners
void SAL_CALL dispose() override
virtual void SAL_CALL removeSelectionListener(const css::uno::Reference< css::awt::grid::XGridSelectionListener > &listener) override
sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &rxModel) override
::cppu::IPropertyArrayHelper & getInfoHelper() override
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: gridcontrol.hxx:69
rtl::Reference< UnoControlModel > Clone() const override
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
void SAL_CALL dispose() override
void setFastPropertyValue_NoBroadcast(std::unique_lock< std::mutex > &rGuard, sal_Int32 nHandle, const css::uno::Any &rValue) override
OUString SAL_CALL getServiceName() override
OUString SAL_CALL getImplementationName() override
Definition: gridcontrol.hxx:66
UnoGridModel(const css::uno::Reference< css::uno::XComponentContext > &i_factory)
Definition: gridcontrol.cxx:72
float y
float x
index
::cppu::AggImplInheritanceHelper2< UnoControlBase, css::awt::grid::XGridControl, css::awt::grid::XGridRowSelection > UnoGridControl_Base
Definition: gridcontrol.hxx:84
sal_Int32 nHandle
unsigned char sal_Bool