1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef TOOLKIT_TABPAGE_MODEL_HXX
25 #define TOOLKIT_TABPAGE_MODEL_HXX
26 
27 #include <toolkit/controls/controlmodelcontainerbase.hxx>
28 #include <com/sun/star/awt/tab/XTabPageModel.hpp>
29 #include <com/sun/star/awt/tab/XTabPage.hpp>
30 #include <com/sun/star/resource/XStringResourceResolver.hpp>
31 #include <com/sun/star/lang/XInitialization.hpp>
32 #include "toolkit/helper/servicenames.hxx"
33 #include "toolkit/helper/macros.hxx"
34 #include <toolkit/controls/unocontrolcontainer.hxx>
35 #include <cppuhelper/basemutex.hxx>
36 #include <list>
37 #include <cppuhelper/implbase2.hxx>
38 
39 class UnoControlTabPageModel :	public ControlModelContainerBase
40 								//public TabPageModel
41 {
42 protected:
43 	::com::sun::star::uno::Any			ImplGetDefaultValue( sal_uInt16 nPropId ) const;
44 	::cppu::IPropertyArrayHelper&		SAL_CALL getInfoHelper();
45 public:
46 	UnoControlTabPageModel( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > const & i_factory);
47 
48 	// ::com::sun::star::io::XPersistObject
49     ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
50 
51 	// ::com::sun::star::beans::XMultiPropertySet
52 	::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
53     // XInitialization
54 	virtual void SAL_CALL initialize (const com::sun::star::uno::Sequence<com::sun::star::uno::Any>& rArguments)
55 			throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
56 
57 	// XServiceInfo
58 	DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageModel, ControlModelContainerBase, szServiceName_UnoControlTabPageModel )
59 
60 };
61 
62 //	----------------------------------------------------
63 //	class UnoTabPageControl
64 //	----------------------------------------------------
65 typedef ::cppu::AggImplInheritanceHelper2   <   ControlContainerBase
66                                             ,   ::com::sun::star::awt::tab::XTabPage
67                                             ,   ::com::sun::star::awt::XWindowListener
68                                             >   UnoControlTabPage_Base;
69 class UnoControlTabPage : public UnoControlTabPage_Base
70 {
71 private:
72     bool            m_bWindowListener;
73 public:
74 
75 	UnoControlTabPage( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
76 	~UnoControlTabPage();
77 	::rtl::OUString				GetComponentServiceName();
78 
79     void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
80     void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
81     void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
82 
83      // ::com::sun::star::awt::XWindowListener
84     virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
85     virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
86     virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
87     virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
88 	// ::com::sun::star::lang::XServiceInfo
89 	DECLIMPL_SERVICEINFO( UnoControlTabPage, szServiceName_UnoControlTabPage)
90 };
91 
92 #endif // TOOLKIT_TABPAGE_MODEL_HXX
93