merge the formfield patch from ooo-build
[ooovba.git] / toolkit / source / awt / vclxtabcontrol.hxx
blob85c964b34e4a05f4020a9f185feddc7249ce8af1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: vclxtabcontrol.hxx,v $
11 * $Revision: 1.4 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef LAYOUT_AWT_VCLXTABCONTROLLER_HXX
33 #define LAYOUT_AWT_VCLXTABCONTROLLER_HXX
35 #include <com/sun/star/awt/XSimpleTabController.hpp>
36 #include <comphelper/uno3.hxx>
37 #include <layout/core/box-base.hxx>
38 #include <map>
39 #include <toolkit/awt/vclxwindow.hxx>
41 class TabControl;
43 namespace layoutimpl
46 typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XSimpleTabController
47 > VCLXTabControl_Base;
49 class VCLXTabControl :public VCLXWindow
50 ,public VCLXTabControl_Base
51 ,public Box_Base
53 int mTabId;
54 bool bRealized;
56 public:
57 VCLXTabControl();
59 void AddChild (css::uno::Reference <css::awt::XLayoutConstrains> const &);
61 protected:
62 ~VCLXTabControl();
64 // XInterface
65 DECLARE_XINTERFACE()
67 // XTypeProvider
68 DECLARE_XTYPEPROVIDER()
70 // XComponent
71 void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
73 virtual void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw (::com::sun::star::uno::RuntimeException);
75 // XSimpleTabController
76 virtual ::sal_Int32 SAL_CALL insertTab() throw (::com::sun::star::uno::RuntimeException);
77 virtual void SAL_CALL removeTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
79 virtual void SAL_CALL setTabProps( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
80 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > SAL_CALL getTabProps( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
82 virtual void SAL_CALL activateTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
83 virtual ::sal_Int32 SAL_CALL getActiveTabID() throw (::com::sun::star::uno::RuntimeException);
85 virtual void SAL_CALL addTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
86 virtual void SAL_CALL removeTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
88 // ::com::sun::star::awt::XLayoutContainer
89 virtual void SAL_CALL addChild(
90 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XLayoutConstrains >& Child )
91 throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::awt::MaxChildrenException);
92 virtual void SAL_CALL removeChild( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XLayoutConstrains >& Child )
93 throw (::com::sun::star::uno::RuntimeException);
95 virtual void SAL_CALL allocateArea( const ::com::sun::star::awt::Rectangle &rArea )
96 throw (::com::sun::star::uno::RuntimeException);
98 virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize()
99 throw(::com::sun::star::uno::RuntimeException);
101 // unimplemented:
102 virtual sal_Bool SAL_CALL hasHeightForWidth()
103 throw(css::uno::RuntimeException)
104 { return false; }
105 virtual sal_Int32 SAL_CALL getHeightForWidth( sal_Int32 /*nWidth*/ )
106 throw(css::uno::RuntimeException)
107 { return maRequisition.Height; }
109 // VclWindowPeer
110 virtual void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
111 virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
113 // VCLXWindow
114 void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent );
116 public:
117 // Maps page ids to child references
118 struct ChildData : public Box_Base::ChildData
120 rtl::OUString maTitle;
121 ChildData( css::uno::Reference< css::awt::XLayoutConstrains > const& xChild );
124 struct ChildProps : public Box_Base::ChildProps
126 ChildProps( VCLXTabControl::ChildData *pData );
129 protected:
130 ChildData *createChild( css::uno::Reference< css::awt::XLayoutConstrains > const& xChild );
131 ChildProps *createChildProps( Box_Base::ChildData* pData );
134 std::map< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XLayoutConstrains >, sal_Int32 > mIdMap;
135 // FIXME: we might want to use a Multiplexer
136 std::list< ::com::sun::star::uno::Reference
137 < ::com::sun::star::awt::XTabListener > > mxTabListeners;
139 inline TabControl *getTabControl() const throw (::com::sun::star::uno::RuntimeException);
141 private:
142 VCLXTabControl( const VCLXTabControl& ); // never implemented
143 VCLXTabControl& operator=( const VCLXTabControl& ); // never implemented
146 } // namespace layoutimpl
148 #endif /* LAYOUT_AWT_VCLXTABCONTROLLER_HXX */