[en-GB] Added 13 words to autocorrect
[LibreOffice.git] / UnoControls / inc / basecontainercontrol.hxx
blob56e2f9373af35028ff85cd5074589f229d5fe675
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 #pragma once
22 #include <memory>
23 #include <vector>
25 #include "basecontrol.hxx"
26 #include <com/sun/star/awt/XControlContainer.hpp>
28 namespace unocontrols {
30 struct IMPL_ControlInfo
32 css::uno::Reference< css::awt::XControl > xControl;
33 OUString sName;
36 class BaseContainerControl : public css::awt::XControlModel
37 , public css::awt::XControlContainer
38 , public BaseControl
40 public:
42 BaseContainerControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
44 virtual ~BaseContainerControl() override;
46 // XInterface
48 /**
49 @short give answer, if interface is supported
50 @descr The interfaces are searched by type.
52 @seealso XInterface
54 @param "rType" is the type of searched interface.
56 @return Any information about found interface
58 @onerror A RuntimeException is thrown.
61 virtual css::uno::Any SAL_CALL queryInterface(
62 const css::uno::Type& aType
63 ) override;
65 // XTypeProvider
67 /**
68 @short get information about supported interfaces
69 @seealso XTypeProvider
70 @return Sequence of types of all supported interfaces
72 @onerror A RuntimeException is thrown.
75 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
77 // XAggregation
79 virtual css::uno::Any SAL_CALL queryAggregation(
80 const css::uno::Type& aType
81 ) override;
83 // XControl
85 virtual void SAL_CALL createPeer(
86 const css::uno::Reference< css::awt::XToolkit >& xToolkit ,
87 const css::uno::Reference< css::awt::XWindowPeer >& xParent
88 ) override;
90 virtual sal_Bool SAL_CALL setModel(
91 const css::uno::Reference< css::awt::XControlModel >& xModel
92 ) override;
94 virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override;
96 // XComponent
98 virtual void SAL_CALL dispose() override;
100 // XEventListener
102 virtual void SAL_CALL disposing( const css::lang::EventObject& rEvent ) override;
104 // XControlContainer
106 virtual void SAL_CALL addControl(
107 const OUString& sName ,
108 const css::uno::Reference< css::awt::XControl >& xControl
109 ) override;
111 virtual void SAL_CALL removeControl(
112 const css::uno::Reference< css::awt::XControl >& xControl
113 ) override;
115 virtual void SAL_CALL setStatusText(
116 const OUString& sStatusText
117 ) override;
119 virtual css::uno::Reference< css::awt::XControl > SAL_CALL getControl(
120 const OUString& sName
121 ) override;
123 virtual css::uno::Sequence< css::uno::Reference< css::awt::XControl > > SAL_CALL getControls() override;
125 // XWindow
127 virtual void SAL_CALL setVisible( sal_Bool bVisible ) override;
129 protected:
130 using OComponentHelper::disposing;
132 virtual css::awt::WindowDescriptor impl_getWindowDescriptor(
133 const css::uno::Reference< css::awt::XWindowPeer >& xParentPeer
134 ) override;
137 virtual void impl_paint(
138 sal_Int32 nX ,
139 sal_Int32 nY ,
140 const css::uno::Reference< css::awt::XGraphics >& xGraphics
141 ) override;
143 private:
144 // list of pointer of "struct IMPL_ControlInfo" to hold child-controls
145 ::std::vector< std::unique_ptr<IMPL_ControlInfo> > maControlInfoList;
147 ::cppu::OMultiTypeInterfaceContainerHelper m_aListeners;
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */