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 //	class VCLXDialog
24 
25 #ifndef _TOOLKIT_AWT_VCLXTABPAGECONTAINER_HXX_
26 #define _TOOLKIT_AWT_VCLXTABPAGECONTAINER_HXX_
27 
28 #include <toolkit/dllapi.h>
29 #include <com/sun/star/beans/PropertyValues.hpp>
30 #include <com/sun/star/beans/XPropertySet.hpp>
31 #include <com/sun/star/beans/PropertyValue.hpp>
32 #include <com/sun/star/beans/PropertyState.hpp>
33 #include <com/sun/star/beans/XPropertySetInfo.hpp>
34 #include <com/sun/star/container/XContainerListener.hpp>
35 #include "toolkit/awt/vclxwindow.hxx"
36 //#include <com/sun/star/awt/tab/XTabPageModel.hpp>
37 #include <com/sun/star/awt/tab/XTabPageContainer.hpp>
38 #include <toolkit/helper/listenermultiplexer.hxx>
39 #include <cppuhelper/implbase2.hxx>
40 #include <toolkit/awt/vclxcontainer.hxx>
41 
42 //	----------------------------------------------------
43 typedef ::cppu::ImplInheritanceHelper2 <    VCLXContainer
44                                             ,   ::com::sun::star::awt::tab::XTabPageContainer
45                                             ,	::com::sun::star::container::XContainerListener
46                                              > VCLXTabPageContainer_Base;
47 class VCLXTabPageContainer : public VCLXTabPageContainer_Base
48 {
49 public:
50 	VCLXTabPageContainer();
51 	~VCLXTabPageContainer();
52 
53 	// ::com::sun::star::awt::XView
54     void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException);
55 
56 	// ::com::sun::star::awt::XDevice,
57 	::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
58 
59 	// ::com::sun::star::awt::grid::XTabPageContainer
60     virtual ::sal_Int16 SAL_CALL getActiveTabPageID() throw (::com::sun::star::uno::RuntimeException);
61     virtual void SAL_CALL setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (::com::sun::star::uno::RuntimeException);
62     virtual ::sal_Int16 SAL_CALL getTabPageCount(  ) throw (::com::sun::star::uno::RuntimeException);
63     virtual ::sal_Bool SAL_CALL isTabPageActive( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
64     virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPage( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException);
65     virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPageByID( ::sal_Int16 tabPageID ) throw (::com::sun::star::uno::RuntimeException);
66     virtual void SAL_CALL addTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
67     virtual void SAL_CALL removeTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException);
68 
69     static void     ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
GetPropertyIds(std::list<sal_uInt16> & aIds)70     virtual void    GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
71 
72     virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
73     virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
74     virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
75     virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
76 
77 	// ::com::sun::star::awt::XVclWindowPeer
78     void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
79 protected:
80     virtual void    ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
81 private:
82 	sal_Int16 m_nActiveTabPageId;
83 	TabPageListenerMultiplexer m_aTabPageListeners;
84     ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > > m_aTabPages;
85 };
86 #endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_
87