bump product version to 6.4.0.3
[LibreOffice.git] / UnoControls / inc / basecontainercontrol.hxx
blob500313fc909640c36d83a3422938983e01aa3b3a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_UNOCONTROLS_INC_BASECONTAINERCONTROL_HXX
21 #define INCLUDED_UNOCONTROLS_INC_BASECONTAINERCONTROL_HXX
23 #include <memory>
24 #include <vector>
26 #include "basecontrol.hxx"
27 #include <com/sun/star/awt/XControlContainer.hpp>
29 namespace unocontrols {
31 struct IMPL_ControlInfo
33 css::uno::Reference< css::awt::XControl > xControl;
34 OUString sName;
37 class BaseContainerControl : public css::awt::XControlModel
38 , public css::awt::XControlContainer
39 , public BaseControl
41 public:
43 BaseContainerControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
45 virtual ~BaseContainerControl() override;
47 // XInterface
49 /**
50 @short give answer, if interface is supported
51 @descr The interfaces are searched by type.
53 @seealso XInterface
55 @param "rType" is the type of searched interface.
57 @return Any information about found interface
59 @onerror A RuntimeException is thrown.
62 virtual css::uno::Any SAL_CALL queryInterface(
63 const css::uno::Type& aType
64 ) override;
66 // XTypeProvider
68 /**
69 @short get information about supported interfaces
70 @seealso XTypeProvider
71 @return Sequence of types of all supported interfaces
73 @onerror A RuntimeException is thrown.
76 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
78 // XAggregation
80 virtual css::uno::Any SAL_CALL queryAggregation(
81 const css::uno::Type& aType
82 ) override;
84 // XControl
86 virtual void SAL_CALL createPeer(
87 const css::uno::Reference< css::awt::XToolkit >& xToolkit ,
88 const css::uno::Reference< css::awt::XWindowPeer >& xParent
89 ) override;
91 virtual sal_Bool SAL_CALL setModel(
92 const css::uno::Reference< css::awt::XControlModel >& xModel
93 ) override;
95 virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override;
97 // XComponent
99 virtual void SAL_CALL dispose() override;
101 // XEventListener
103 virtual void SAL_CALL disposing( const css::lang::EventObject& rEvent ) override;
105 // XControlContainer
107 virtual void SAL_CALL addControl(
108 const OUString& sName ,
109 const css::uno::Reference< css::awt::XControl >& xControl
110 ) override;
112 virtual void SAL_CALL removeControl(
113 const css::uno::Reference< css::awt::XControl >& xControl
114 ) override;
116 virtual void SAL_CALL setStatusText(
117 const OUString& sStatusText
118 ) override;
120 virtual css::uno::Reference< css::awt::XControl > SAL_CALL getControl(
121 const OUString& sName
122 ) override;
124 virtual css::uno::Sequence< css::uno::Reference< css::awt::XControl > > SAL_CALL getControls() override;
126 // XWindow
128 virtual void SAL_CALL setVisible( sal_Bool bVisible ) override;
130 protected:
131 using OComponentHelper::disposing;
133 virtual css::awt::WindowDescriptor impl_getWindowDescriptor(
134 const css::uno::Reference< css::awt::XWindowPeer >& xParentPeer
135 ) override;
138 virtual void impl_paint(
139 sal_Int32 nX ,
140 sal_Int32 nY ,
141 const css::uno::Reference< css::awt::XGraphics >& xGraphics
142 ) override;
144 private:
145 // list of pointer of "struct IMPL_ControlInfo" to hold child-controls
146 ::std::vector< std::unique_ptr<IMPL_ControlInfo> > maControlInfoList;
148 ::cppu::OMultiTypeInterfaceContainerHelper m_aListeners;
154 #endif // INCLUDED_UNOCONTROLS_INC_BASECONTAINERCONTROL_HXX
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */