Update ooo320-m1
[ooovba.git] / toolkit / source / awt / vclxsplitter.hxx
blobc97ba212652894546a9a2bd21d87e1084e11bf37
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: vclxsplitter.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_VCLXSPLITTER_HXX
33 #define LAYOUT_AWT_VCLXSPLITTER_HXX
35 #include <com/sun/star/awt/MaxChildrenException.hpp>
36 #include <com/sun/star/beans/XPropertySet.hpp>
37 #include <comphelper/uno3.hxx>
38 #include <layout/core/box-base.hxx>
39 #include <toolkit/awt/vclxwindow.hxx>
41 class Splitter;
43 namespace layoutimpl
46 class VCLXSplitter :public VCLXWindow
47 ,public Box_Base
49 private:
50 VCLXSplitter( const VCLXSplitter& ); // never implemented
51 VCLXSplitter& operator=( const VCLXSplitter& ); // never implemented
53 public:
54 VCLXSplitter( bool bHorizontal );
56 protected:
57 ~VCLXSplitter();
59 // XInterface
60 DECLARE_XINTERFACE()
62 // XTypeProvider
63 DECLARE_XTYPEPROVIDER()
65 // XComponent
66 void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
68 // ::com::sun::star::awt::XLayoutContainer
69 virtual void SAL_CALL addChild(
70 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XLayoutConstrains >& Child )
71 throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::awt::MaxChildrenException);
73 virtual void SAL_CALL allocateArea( const ::com::sun::star::awt::Rectangle &rArea )
74 throw (::com::sun::star::uno::RuntimeException);
76 virtual ::com::sun::star::awt::Size SAL_CALL getMinimumSize()
77 throw(::com::sun::star::uno::RuntimeException);
79 // unimplemented:
80 virtual sal_Bool SAL_CALL hasHeightForWidth()
81 throw(css::uno::RuntimeException)
82 { return false; }
83 virtual sal_Int32 SAL_CALL getHeightForWidth( sal_Int32 /*nWidth*/ )
84 throw(css::uno::RuntimeException)
85 { return maRequisition.Height; }
87 // VclWindowPeer
88 virtual void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
89 virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
91 // VCLXWindow
92 void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent );
94 public:
95 // Maps page ids to child references
96 struct ChildData : public Box_Base::ChildData
98 sal_Bool mbShrink;
99 ChildData( css::uno::Reference< css::awt::XLayoutConstrains > const& xChild );
102 struct ChildProps : public Box_Base::ChildProps
104 ChildProps( VCLXSplitter::ChildData *pData );
107 protected:
109 ChildData *createChild( css::uno::Reference< css::awt::XLayoutConstrains > const& xChild );
110 ChildProps *createChildProps( Box_Base::ChildData* pData );
112 ChildData* getChild( int i );
114 float mnHandleRatio;
115 bool mbHandlePressed;
117 DECL_LINK( HandleMovedHdl, Splitter* );
118 bool mbHorizontal;
119 Splitter *mpSplitter;
120 void ensureSplitter();
123 } // namespace layoutimpl
125 #endif /* LAYOUT_AWT_VCLXSPLITTER_HXX */