Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : : #ifndef SVX_FMPROPBRW_HXX
20 : : #define SVX_FMPROPBRW_HXX
21 : :
22 : : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
23 : : #include <com/sun/star/awt/XControlContainer.hpp>
24 : : #include <com/sun/star/frame/XFrame.hpp>
25 : : #include <com/sun/star/inspection/XObjectInspectorModel.hpp>
26 : : #include <com/sun/star/uno/XComponentContext.hpp>
27 : :
28 : : #include <sfx2/basedlgs.hxx>
29 : : #include <sfx2/ctrlitem.hxx>
30 : : #include <sfx2/childwin.hxx>
31 : : #include "svx/fmtools.hxx"
32 : :
33 : : //========================================================================
34 [ # # ]: 0 : class FmPropBrwMgr : public SfxChildWindow
35 : : {
36 : : public:
37 : : FmPropBrwMgr(Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo);
38 : : SFX_DECL_CHILDWINDOW(FmPropBrwMgr);
39 : : };
40 : :
41 : : class SfxBindings;
42 : : class FmFormShell;
43 : : //========================================================================
44 : : class FmPropBrw : public SfxFloatingWindow, public SfxControllerItem
45 : : {
46 : : sal_Bool m_bInitialStateChange;
47 : : bool m_bInStateChange;
48 : : ::rtl::OUString m_sLastActivePage;
49 : : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
50 : : m_xInspectorContext;
51 : : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
52 : : m_xORB;
53 : : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
54 : : m_xMeAsFrame;
55 : : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
56 : : m_xLastKnownDocument;
57 : : ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel >
58 : : m_xInspectorModel;
59 : : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
60 : : m_xBrowserController;
61 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
62 : : m_xBrowserComponentWindow;
63 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
64 : : m_xFrameContainerWindow;
65 : :
66 : : protected:
67 : : virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState);
68 : : virtual void FillInfo( SfxChildWinInfo& rInfo ) const;
69 : : virtual sal_Bool Close();
70 : :
71 : : DECL_LINK( OnAsyncGetFocus, void* );
72 : :
73 : : void implSetNewSelection( const InterfaceBag& _rSelection );
74 : : void implDetachController();
75 : : bool implIsReadOnlyModel() const;
76 : : ::rtl::OUString getCurrentPage() const;
77 : :
78 : : public:
79 : : FmPropBrw(
80 : : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB,
81 : : SfxBindings* pBindings,
82 : : SfxChildWindow* pMgr,
83 : : Window* pParent,
84 : : const SfxChildWinInfo* _pInfo
85 : : );
86 : : virtual ~FmPropBrw();
87 : :
88 : : using SfxFloatingWindow::StateChanged;
89 : :
90 : : protected:
91 : : virtual void Resize();
92 : :
93 : : private:
94 : : /** creates the PropertyBrowser (aka ObjectInspector) and plugs it into our frame
95 : :
96 : : This method ensures that a new component is created every time the XModel which
97 : : we're working for changed. This is necessary since this model is part of the
98 : : ComponentContext we use to create the ObjectInspector.
99 : : */
100 : : void impl_ensurePropertyBrowser_nothrow( FmFormShell* _pFormShell );
101 : :
102 : : /** creates a property browser
103 : :
104 : : After this method returns, m_xBrowserController and m_xBrowserComponentWindow are
105 : : not <NULL/>.
106 : :
107 : : @precond
108 : : we don't have an ObjectInspector, yet, i.e. m_xBrowserController and m_xBrowserComponentWindow
109 : : are <NULL/>.
110 : : */
111 : : void impl_createPropertyBrowser_throw( FmFormShell* _pFormShell );
112 : : };
113 : : #endif //SVX_FMPROPBRW_HXX
114 : :
115 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|