Update ooo320-m1
[ooovba.git] / extensions / source / bibliography / formcontrolcontainer.hxx
blob1533daca99302637e00729119692b612d78a569a
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: formcontrolcontainer.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef EXTENSIONS_BIB_FORMCONTROLCONTAINER_HXX
32 #define EXTENSIONS_BIB_FORMCONTROLCONTAINER_HXX
34 #include <comphelper/broadcasthelper.hxx>
35 #include "loadlisteneradapter.hxx"
36 #include <com/sun/star/awt/XControlContainer.hpp>
38 class BibDataManager;
40 //.........................................................................
41 namespace bib
43 //.........................................................................
45 //=====================================================================
46 //= FormControlContainer
47 //=====================================================================
48 class FormControlContainer
49 :public ::comphelper::OBaseMutex
50 ,public ::bib::OLoadListener
52 private:
53 OLoadListenerAdapter* m_pFormAdapter;
54 ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable >
55 m_xForm;
56 private:
57 void implSetDesignMode( sal_Bool _bDesign );
59 protected:
60 FormControlContainer( );
61 ~FormControlContainer( );
63 sal_Bool isFormConnected() const { return NULL != m_pFormAdapter; }
64 void connectForm( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable >& _rxForm );
65 void disconnectForm();
67 void ensureDesignMode();
69 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
70 getControlContainer() = 0;
72 protected:
73 // XLoadListener equivalents
74 virtual void _loaded( const ::com::sun::star::lang::EventObject& _rEvent );
75 virtual void _unloading( const ::com::sun::star::lang::EventObject& _rEvent );
76 virtual void _unloaded( const ::com::sun::star::lang::EventObject& _rEvent );
77 virtual void _reloading( const ::com::sun::star::lang::EventObject& _rEvent );
78 virtual void _reloaded( const ::com::sun::star::lang::EventObject& _rEvent );
82 //.........................................................................
83 } // namespace bib
84 //.........................................................................
86 #endif // EXTENSIONS_BIB_FORMCONTROLCONTAINER_HXX