1*b1cdbd2cSJim Jagielski /**************************************************************
2*b1cdbd2cSJim Jagielski  *
3*b1cdbd2cSJim Jagielski  * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski  * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski  * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski  * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski  * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski  * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski  * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski  *
11*b1cdbd2cSJim Jagielski  *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski  *
13*b1cdbd2cSJim Jagielski  * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski  * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski  * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski  * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski  * under the License.
19*b1cdbd2cSJim Jagielski  *
20*b1cdbd2cSJim Jagielski  *************************************************************/
21*b1cdbd2cSJim Jagielski 
22*b1cdbd2cSJim Jagielski 
23*b1cdbd2cSJim Jagielski 
24*b1cdbd2cSJim Jagielski #ifndef _TOOLKIT_CONTROLS_STDTABCONTROLLER_HXX_
25*b1cdbd2cSJim Jagielski #define _TOOLKIT_CONTROLS_STDTABCONTROLLER_HXX_
26*b1cdbd2cSJim Jagielski 
27*b1cdbd2cSJim Jagielski 
28*b1cdbd2cSJim Jagielski #include <com/sun/star/lang/XServiceInfo.hpp>
29*b1cdbd2cSJim Jagielski #include <com/sun/star/awt/XTabController.hpp>
30*b1cdbd2cSJim Jagielski #include <com/sun/star/awt/XControl.hpp>
31*b1cdbd2cSJim Jagielski #include <com/sun/star/awt/XControlContainer.hpp>
32*b1cdbd2cSJim Jagielski #include <com/sun/star/lang/XTypeProvider.hpp>
33*b1cdbd2cSJim Jagielski #include <cppuhelper/weakagg.hxx>
34*b1cdbd2cSJim Jagielski #include <osl/mutex.hxx>
35*b1cdbd2cSJim Jagielski #include <toolkit/helper/macros.hxx>
36*b1cdbd2cSJim Jagielski #include <toolkit/helper/servicenames.hxx>
37*b1cdbd2cSJim Jagielski 
38*b1cdbd2cSJim Jagielski 
39*b1cdbd2cSJim Jagielski class StdTabController : 	public ::com::sun::star::awt::XTabController,
40*b1cdbd2cSJim Jagielski 					        public ::com::sun::star::lang::XServiceInfo,
41*b1cdbd2cSJim Jagielski 							public ::com::sun::star::lang::XTypeProvider,
42*b1cdbd2cSJim Jagielski 							public ::cppu::OWeakAggObject
43*b1cdbd2cSJim Jagielski {
44*b1cdbd2cSJim Jagielski private:
45*b1cdbd2cSJim Jagielski 	::osl::Mutex			maMutex;
46*b1cdbd2cSJim Jagielski 	::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel >	mxModel;
47*b1cdbd2cSJim Jagielski 	::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > 	mxControlContainer;
48*b1cdbd2cSJim Jagielski 
49*b1cdbd2cSJim Jagielski protected:
GetMutex()50*b1cdbd2cSJim Jagielski 	::osl::Mutex&				GetMutex() { return maMutex; }
51*b1cdbd2cSJim Jagielski 	sal_Bool					ImplCreateComponentSequence( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >& rControls, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& rModels, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >& rComponents, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>* pTabStops, sal_Bool bPeerComponent ) const;
52*b1cdbd2cSJim Jagielski 	// wenn rModels kuerzer als rControls ist, werden nur die rModels entsprechenden Elemente geliefert und die korrespondierenden Elemente aus rControls entfernt
53*b1cdbd2cSJim Jagielski 	void						ImplActivateControl( sal_Bool bFirst ) const;
54*b1cdbd2cSJim Jagielski 
55*b1cdbd2cSJim Jagielski public:
56*b1cdbd2cSJim Jagielski 							StdTabController();
57*b1cdbd2cSJim Jagielski 							~StdTabController();
58*b1cdbd2cSJim Jagielski 
59*b1cdbd2cSJim Jagielski 	static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >	FindControl( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >& rCtrls, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & rxCtrlModel );
60*b1cdbd2cSJim Jagielski 
61*b1cdbd2cSJim Jagielski 	// ::com::sun::star::uno::XInterface
queryInterface(const::com::sun::star::uno::Type & rType)62*b1cdbd2cSJim Jagielski 	::com::sun::star::uno::Any	SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return OWeakAggObject::queryInterface(rType); }
acquire()63*b1cdbd2cSJim Jagielski 	void						SAL_CALL acquire() throw()	{ OWeakAggObject::acquire(); }
release()64*b1cdbd2cSJim Jagielski 	void						SAL_CALL release() throw()	{ OWeakAggObject::release(); }
65*b1cdbd2cSJim Jagielski 
66*b1cdbd2cSJim Jagielski     ::com::sun::star::uno::Any	SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
67*b1cdbd2cSJim Jagielski 
68*b1cdbd2cSJim Jagielski 	// ::com::sun::star::lang::XTypeProvider
69*b1cdbd2cSJim Jagielski 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >	SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
70*b1cdbd2cSJim Jagielski 	::com::sun::star::uno::Sequence< sal_Int8 >						SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
71*b1cdbd2cSJim Jagielski 
72*b1cdbd2cSJim Jagielski 	// XTabController
73*b1cdbd2cSJim Jagielski     void SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
74*b1cdbd2cSJim Jagielski     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > SAL_CALL getModel(  ) throw(::com::sun::star::uno::RuntimeException);
75*b1cdbd2cSJim Jagielski     void SAL_CALL setContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& Container ) throw(::com::sun::star::uno::RuntimeException);
76*b1cdbd2cSJim Jagielski     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > SAL_CALL getContainer(  ) throw(::com::sun::star::uno::RuntimeException);
77*b1cdbd2cSJim Jagielski     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > SAL_CALL getControls(  ) throw(::com::sun::star::uno::RuntimeException);
78*b1cdbd2cSJim Jagielski     void SAL_CALL autoTabOrder(  ) throw(::com::sun::star::uno::RuntimeException);
79*b1cdbd2cSJim Jagielski     void SAL_CALL activateTabOrder(  ) throw(::com::sun::star::uno::RuntimeException);
80*b1cdbd2cSJim Jagielski     void SAL_CALL activateFirst(  ) throw(::com::sun::star::uno::RuntimeException);
81*b1cdbd2cSJim Jagielski     void SAL_CALL activateLast(  ) throw(::com::sun::star::uno::RuntimeException);
82*b1cdbd2cSJim Jagielski 
83*b1cdbd2cSJim Jagielski     // XServiceInfo
84*b1cdbd2cSJim Jagielski 	DECLIMPL_SERVICEINFO( StdTabController, szServiceName2_TabController )
85*b1cdbd2cSJim Jagielski };
86*b1cdbd2cSJim Jagielski 
87*b1cdbd2cSJim Jagielski 
88*b1cdbd2cSJim Jagielski 
89*b1cdbd2cSJim Jagielski #endif // _TOOLKIT_AWT_STDTABCONTROLLER_HXX_
90*b1cdbd2cSJim Jagielski 
91