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_CONTROLS_TABPAGEMODEL_HXX
21 #define INCLUDED_TOOLKIT_CONTROLS_TABPAGEMODEL_HXX
22 
23 #include <toolkit/controls/controlmodelcontainerbase.hxx>
24 #include <com/sun/star/awt/tab/XTabPage.hpp>
25 #include <cppuhelper/implbase2.hxx>
26 
27 class UnoControlTabPageModel final : public ControlModelContainerBase
28 {
29     css::uno::Any          ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
30     ::cppu::IPropertyArrayHelper&       SAL_CALL getInfoHelper() override;
31 public:
32     UnoControlTabPageModel( css::uno::Reference< css::uno::XComponentContext > const & i_factory);
33 
34     // css::io::XPersistObject
35     OUString SAL_CALL getServiceName() override;
36 
37     // css::beans::XMultiPropertySet
38     css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) override;
39     // XInitialization
40     virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments) override;
41 
42     // XServiceInfo
43     OUString SAL_CALL getImplementationName() override;
44 
45     css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
46 };
47 
48 
49 //  class UnoTabPageControl
50 
51 typedef ::cppu::AggImplInheritanceHelper2   <   ControlContainerBase
52                                             ,   css::awt::tab::XTabPage
53                                             ,   css::awt::XWindowListener
54                                             >   UnoControlTabPage_Base;
55 class UnoControlTabPage final : public UnoControlTabPage_Base
56 {
57 private:
58     bool            m_bWindowListener;
59 public:
60 
61     UnoControlTabPage( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
62     virtual ~UnoControlTabPage() override;
63     OUString             GetComponentServiceName() override;
64 
65     void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
66     void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
67     void SAL_CALL dispose() override;
68 
69      // css::awt::XWindowListener
70     virtual void SAL_CALL windowResized( const css::awt::WindowEvent& e ) override;
71     virtual void SAL_CALL windowMoved( const css::awt::WindowEvent& e ) override;
72     virtual void SAL_CALL windowShown( const css::lang::EventObject& e ) override;
73     virtual void SAL_CALL windowHidden( const css::lang::EventObject& e ) override;
74     // css::lang::XServiceInfo
75     virtual OUString SAL_CALL getImplementationName() override;
76 
77     virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
78 
79     virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
80 };
81 
82 #endif // INCLUDED_TOOLKIT_CONTROLS_TABPAGEMODEL_HXX
83 
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
85