LibreOffice Module toolkit (master) 1
roadmapcontrol.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#pragma once
21
22
25#include <com/sun/star/container/XContainer.hpp>
26#include <com/sun/star/lang/XSingleServiceFactory.hpp>
27#include <com/sun/star/beans/XPropertyChangeListener.hpp>
28#include <com/sun/star/container/XIndexContainer.hpp>
29#include <com/sun/star/container/XContainerListener.hpp>
30#include <com/sun/star/awt/XItemListener.hpp>
31#include <com/sun/star/awt/XItemEventBroadcaster.hpp>
35
36
37#include <comphelper/uno3.hxx>
38
39
40namespace toolkit
41{
42
43
45
46
47 typedef ::cppu::ImplHelper3 < css::lang::XSingleServiceFactory
48 , css::container::XContainer
49 , css::container::XIndexContainer
51
52
54 typedef ::cppu::ImplHelper4 < css::awt::XItemEventBroadcaster
55 , css::container::XContainerListener
56 , css::awt::XItemListener
57 , css::beans::XPropertyChangeListener
59
60
61 typedef ::cppu::ImplHelper2< css::container::XContainerListener,
62 css::awt::XItemEventBroadcaster> SVTXRoadmap_Base;
63
64
65 // = UnoControlRoadmapModel
66
69
70 {
71 private:
72// PropertyChangeListenerMultiplexer maPropertyListeners;
73
74 typedef ::std::vector< css::uno::Reference< XInterface > > RoadmapItemHolderList;
75
76 ContainerListenerMultiplexer maContainerListeners;
78
79 void MakeRMItemValidation( sal_Int32 Index, const css::uno::Reference< XInterface >& xRoadmapItem );
80 css::container::ContainerEvent GetContainerEvent(sal_Int32 Index, const css::uno::Reference< XInterface >& );
81 void SetRMItemDefaultProperties( const css::uno::Reference< XInterface >& );
82 static sal_Int16 GetCurrentItemID( const css::uno::Reference< css::beans::XPropertySet >& xPropertySet );
83 sal_Int32 GetUniqueID();
84
85 css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
87
88 public:
89 UnoControlRoadmapModel( const css::uno::Reference< css::uno::XComponentContext >& i_factory );
93 maContainerListeners( *this ) {}
94 rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlRoadmapModel( *this ); }
95
96
97 // XTypeProvider
99
100
101 // css::io::XPersistObject
102 OUString SAL_CALL getServiceName() override;
103
104 // css::lang::XServiceInfo
105 OUString SAL_CALL getImplementationName() override;
106
107 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
108
109 sal_Int32 SAL_CALL getCount() override;
110 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
111
112 virtual void SAL_CALL insertByIndex( sal_Int32 Index, const css::uno::Any & Element) override;
113 virtual void SAL_CALL removeByIndex( sal_Int32 Index ) override;
114 virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const css::uno::Any & Element) override;
115
116 virtual void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
117 virtual void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
118
119 css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoControlRoadmapModel_Base::queryInterface(rType); }
120 css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
121 void SAL_CALL acquire() noexcept override { UnoControlRoadmapModel_Base::acquire(); }
122 void SAL_CALL release() noexcept override { UnoControlRoadmapModel_Base::release(); }
123
124
125 // css::beans::XPropertySet
126 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
127
128
129 virtual css::uno::Reference< XInterface > SAL_CALL createInstance( ) override;
130 virtual css::uno::Reference< XInterface > SAL_CALL createInstanceWithArguments( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
131
132 virtual css::uno::Type SAL_CALL getElementType() override;
133
134 virtual sal_Bool SAL_CALL hasElements() override;
135
136 };
137
138
139 // = UnoRoadmapControl
140
143 {
144 private:
145 ItemListenerMultiplexer maItemListeners;
146 public:
148 OUString GetComponentServiceName() const override;
149
150 void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); }
151
152 void SAL_CALL dispose( ) override;
153
154
155 sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel >& Model) override;
156
157 void SAL_CALL elementInserted( const css::container::ContainerEvent& rEvent ) override;
158 void SAL_CALL elementRemoved( const css::container::ContainerEvent& rEvent ) override;
159 void SAL_CALL elementReplaced( const css::container::ContainerEvent& rEvent ) override;
160
161 virtual void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
162 virtual void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
163
164
165 virtual void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override;
166
167 virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
168
169 // XTypeProvider
171 DECLARE_UNO3_AGG_DEFAULTS(UnoRoadmapControl, UnoControlRoadmap_Base)
172
173 css::uno::Any SAL_CALL queryAggregation(css::uno::Type const & aType) override;
174
175 // css::lang::XServiceInfo
176 OUString SAL_CALL getImplementationName() override;
177
178 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
179 };
180
181
182} // toolkit
183
184
185/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOIndex Index
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
void SAL_CALL acquire() noexcept override
void SAL_CALL release() noexcept override
void SAL_CALL disposing(const css::lang::EventObject &Source) override
Definition: unocontrol.cxx:654
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString SAL_CALL getImplementationName() override
rtl::Reference< UnoControlModel > Clone() const override
virtual void SAL_CALL removeByIndex(sal_Int32 Index) override
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) override
virtual css::uno::Reference< XInterface > SAL_CALL createInstanceWithArguments(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual void SAL_CALL insertByIndex(sal_Int32 Index, const css::uno::Any &Element) override
virtual void SAL_CALL replaceByIndex(sal_Int32 Index, const css::uno::Any &Element) override
static sal_Int16 GetCurrentItemID(const css::uno::Reference< css::beans::XPropertySet > &xPropertySet)
css::uno::Any ImplGetDefaultValue(sal_uInt16 nPropId) const override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
void SAL_CALL acquire() noexcept override
UnoControlRoadmapModel(const UnoControlRoadmapModel &rModel)
virtual css::uno::Reference< XInterface > SAL_CALL createInstance() override
void SetRMItemDefaultProperties(const css::uno::Reference< XInterface > &)
::cppu::IPropertyArrayHelper & getInfoHelper() override
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
void SAL_CALL release() noexcept override
css::container::ContainerEvent GetContainerEvent(sal_Int32 Index, const css::uno::Reference< XInterface > &)
virtual css::uno::Type SAL_CALL getElementType() override
OUString SAL_CALL getServiceName() override
RoadmapItemHolderList maRoadmapItems
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
UnoControlRoadmapModel(const css::uno::Reference< css::uno::XComponentContext > &i_factory)
ContainerListenerMultiplexer maContainerListeners
sal_Int32 SAL_CALL getCount() override
virtual sal_Bool SAL_CALL hasElements() override
::std::vector< css::uno::Reference< XInterface > > RoadmapItemHolderList
void MakeRMItemValidation(sal_Int32 Index, const css::uno::Reference< XInterface > &xRoadmapItem)
virtual void SAL_CALL addItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
void SAL_CALL dispose() override
virtual void SAL_CALL removeItemListener(const css::uno::Reference< css::awt::XItemListener > &l) override
OUString GetComponentServiceName() const override
void SAL_CALL elementReplaced(const css::container::ContainerEvent &rEvent) override
void SAL_CALL disposing(const css::lang::EventObject &Source) override
OUString SAL_CALL getImplementationName() override
sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &Model) override
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
css::uno::Any SAL_CALL queryAggregation(css::uno::Type const &aType) override
void SAL_CALL elementInserted(const css::container::ContainerEvent &rEvent) override
void SAL_CALL elementRemoved(const css::container::ContainerEvent &rEvent) override
virtual void SAL_CALL itemStateChanged(const css::awt::ItemEvent &rEvent) override
ItemListenerMultiplexer maItemListeners
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Type
GraphicControlModel UnoControlRoadmapModel_Base
::cppu::ImplHelper4< css::awt::XItemEventBroadcaster, css::container::XContainerListener, css::awt::XItemListener, css::beans::XPropertyChangeListener > UnoControlRoadmap_IBase
::cppu::ImplHelper3< css::lang::XSingleServiceFactory, css::container::XContainer, css::container::XIndexContainer > UnoControlRoadmapModel_IBase
UnoControlBase UnoControlRoadmap_Base
::cppu::ImplHelper2< css::container::XContainerListener, css::awt::XItemEventBroadcaster > SVTXRoadmap_Base
unsigned char sal_Bool
#define DECLARE_XTYPEPROVIDER()