LibreOffice Module UnoControls (master) 1
basecontainercontrol.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#include <vector>
23
24#include "basecontrol.hxx"
25#include <com/sun/star/awt/XControlContainer.hpp>
27
28namespace unocontrols {
29
31{
32 css::uno::Reference< css::awt::XControl > xControl;
33 OUString sName;
34};
35
36class BaseContainerControl : public css::awt::XControlModel
37 , public css::awt::XControlContainer
38 , public BaseControl
39{
40public:
41
42 BaseContainerControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
43
44 virtual ~BaseContainerControl() override;
45
46 // XInterface
47
61 virtual css::uno::Any SAL_CALL queryInterface(
62 const css::uno::Type& aType
63 ) override;
64
65 // XTypeProvider
66
75 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
76
77 // XControl
78
79 virtual void SAL_CALL createPeer(
80 const css::uno::Reference< css::awt::XToolkit >& xToolkit ,
81 const css::uno::Reference< css::awt::XWindowPeer >& xParent
82 ) override;
83
84 virtual sal_Bool SAL_CALL setModel(
85 const css::uno::Reference< css::awt::XControlModel >& xModel
86 ) override;
87
88 virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override;
89
90 // XComponent
91
92 virtual void SAL_CALL dispose() override;
93
94 // XEventListener
95
96 virtual void SAL_CALL disposing( const css::lang::EventObject& rEvent ) override;
97
98 // XControlContainer
99
100 virtual void SAL_CALL addControl(
101 const OUString& sName ,
102 const css::uno::Reference< css::awt::XControl >& xControl
103 ) override;
104
105 virtual void SAL_CALL removeControl(
106 const css::uno::Reference< css::awt::XControl >& xControl
107 ) override;
108
109 virtual void SAL_CALL setStatusText(
110 const OUString& sStatusText
111 ) override;
112
113 virtual css::uno::Reference< css::awt::XControl > SAL_CALL getControl(
114 const OUString& sName
115 ) override;
116
117 virtual css::uno::Sequence< css::uno::Reference< css::awt::XControl > > SAL_CALL getControls() override;
118
119 // XWindow
120
121 virtual void SAL_CALL setVisible( sal_Bool bVisible ) override;
122
123protected:
124 using WeakComponentImplHelper::disposing;
125
126 virtual css::awt::WindowDescriptor impl_getWindowDescriptor(
127 const css::uno::Reference< css::awt::XWindowPeer >& xParentPeer
128 ) override;
129
130
131 virtual void impl_paint(
132 sal_Int32 nX ,
133 sal_Int32 nY ,
134 const css::uno::Reference< css::awt::XGraphics >& xGraphics
135 ) override;
136
137private:
138 // list of pointer of "struct IMPL_ControlInfo" to hold child-controls
139 ::std::vector< IMPL_ControlInfo > maControlInfoList;
140
142
143};
144
145}
146
147
148/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::awt::XControl > SAL_CALL getControl(const OUString &sName) override
virtual void SAL_CALL dispose() override
virtual void impl_paint(sal_Int32 nX, sal_Int32 nY, const css::uno::Reference< css::awt::XGraphics > &xGraphics) override
virtual css::awt::WindowDescriptor impl_getWindowDescriptor(const css::uno::Reference< css::awt::XWindowPeer > &xParentPeer) override
comphelper::OMultiTypeInterfaceContainerHelper2 m_aListeners
BaseContainerControl(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
get information about supported interfaces @seealso XTypeProvider
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
give answer, if interface is supported @descr The interfaces are searched by type.
virtual void SAL_CALL disposing(const css::lang::EventObject &rEvent) override
virtual void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &xToolkit, const css::uno::Reference< css::awt::XWindowPeer > &xParent) override
virtual sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &xModel) override
virtual void SAL_CALL setVisible(sal_Bool bVisible) override
::std::vector< IMPL_ControlInfo > maControlInfoList
virtual void SAL_CALL setStatusText(const OUString &sStatusText) override
virtual css::uno::Sequence< css::uno::Reference< css::awt::XControl > > SAL_CALL getControls() override
virtual void SAL_CALL removeControl(const css::uno::Reference< css::awt::XControl > &xControl) override
virtual void SAL_CALL addControl(const OUString &sName, const css::uno::Reference< css::awt::XControl > &xControl) override
OUString sName
css::uno::Reference< css::awt::XControl > xControl
Reference< XModel > xModel
bool bVisible
unsigned char sal_Bool