update dev300-m58
[ooovba.git] / svx / source / inc / fmPropBrw.hxx
blob84825a5d2d7868b28e7f8aad430f84ba4ce00231
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: fmPropBrw.hxx,v $
10 * $Revision: 1.14 $
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 ************************************************************************/
30 #ifndef SVX_FMPROPBRW_HXX
31 #define SVX_FMPROPBRW_HXX
33 /** === begin UNO includes === **/
34 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35 #include <com/sun/star/awt/XControlContainer.hpp>
36 #include <com/sun/star/frame/XFrame.hpp>
37 #include <com/sun/star/inspection/XObjectInspectorModel.hpp>
38 #include <com/sun/star/uno/XComponentContext.hpp>
39 /** === end UNO includes === **/
40 #include <sfx2/basedlgs.hxx>
41 #include <sfx2/ctrlitem.hxx>
42 #include <sfx2/childwin.hxx>
43 #include "fmtools.hxx"
45 //========================================================================
46 class FmPropBrwMgr : public SfxChildWindow
48 public:
49 FmPropBrwMgr(Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo);
50 SFX_DECL_CHILDWINDOW(FmPropBrwMgr);
53 class FmPropControl;
54 class SfxBindings;
55 class FmFormShell;
56 //========================================================================
57 class FmPropBrw : public SfxFloatingWindow, public SfxControllerItem
59 sal_Bool m_bInitialStateChange;
60 ::rtl::OUString m_sLastActivePage;
61 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
62 m_xInspectorContext;
63 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
64 m_xORB;
65 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
66 m_xMeAsFrame;
67 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
68 m_xLastKnownDocument;
69 ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel >
70 m_xInspectorModel;
71 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
72 m_xBrowserController;
73 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
74 m_xBrowserComponentWindow;
75 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
76 m_xFrameContainerWindow;
78 protected:
79 virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState);
80 virtual void FillInfo( SfxChildWinInfo& rInfo ) const;
81 virtual sal_Bool Close();
83 DECL_LINK( OnAsyncGetFocus, void* );
85 void implSetNewSelection( const InterfaceBag& _rSelection );
86 void implDetachController();
87 bool implIsReadOnlyModel() const;
88 ::rtl::OUString getCurrentPage() const;
90 public:
91 FmPropBrw(
92 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB,
93 SfxBindings* pBindings,
94 SfxChildWindow* pMgr,
95 Window* pParent,
96 const SfxChildWinInfo* _pInfo
98 virtual ~FmPropBrw();
100 using SfxFloatingWindow::StateChanged;
102 protected:
103 virtual void Resize();
105 private:
106 /** creates the PropertyBrowser (aka ObjectInspector) and plugs it into our frame
108 This method ensures that a new component is created every time the XModel which
109 we're working for changed. This is necessary since this model is part of the
110 ComponentContext we use to create the ObjectInspector.
112 void impl_ensurePropertyBrowser_nothrow( FmFormShell* _pFormShell );
114 /** creates a property browser
116 After this method returns, m_xBrowserController and m_xBrowserComponentWindow are
117 not <NULL/>.
119 @precond
120 we don't have an ObjectInspector, yet, i.e. m_xBrowserController and m_xBrowserComponentWindow
121 are <NULL/>.
123 void impl_createPropertyBrowser_throw( FmFormShell* _pFormShell );
125 #endif //SVX_FMPROPBRW_HXX