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 INCLUDED_SVX_SOURCE_INC_FMPROPBRW_HXX
20 : #define INCLUDED_SVX_SOURCE_INC_FMPROPBRW_HXX
21 :
22 : #include <com/sun/star/awt/XControlContainer.hpp>
23 : #include <com/sun/star/frame/XFrame2.hpp>
24 : #include <com/sun/star/inspection/XObjectInspectorModel.hpp>
25 : #include <com/sun/star/uno/XComponentContext.hpp>
26 :
27 : #include <sfx2/basedlgs.hxx>
28 : #include <sfx2/ctrlitem.hxx>
29 : #include <sfx2/childwin.hxx>
30 : #include "svx/fmtools.hxx"
31 :
32 :
33 0 : class FmPropBrwMgr : public SfxChildWindow
34 : {
35 : public:
36 : FmPropBrwMgr(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo);
37 : SFX_DECL_CHILDWINDOW(FmPropBrwMgr);
38 : };
39 :
40 : class SfxBindings;
41 : class FmFormShell;
42 :
43 : class FmPropBrw : public SfxFloatingWindow, public SfxControllerItem
44 : {
45 : bool m_bInitialStateChange;
46 : bool m_bInStateChange;
47 : OUString m_sLastActivePage;
48 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
49 : m_xInspectorContext;
50 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
51 : m_xORB;
52 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 >
53 : m_xMeAsFrame;
54 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
55 : m_xLastKnownDocument;
56 : ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel >
57 : m_xInspectorModel;
58 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
59 : m_xBrowserController;
60 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
61 : m_xBrowserComponentWindow;
62 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
63 : m_xFrameContainerWindow;
64 :
65 : protected:
66 : virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) SAL_OVERRIDE;
67 : virtual void FillInfo( SfxChildWinInfo& rInfo ) const SAL_OVERRIDE;
68 : virtual bool Close() SAL_OVERRIDE;
69 :
70 : DECL_LINK( OnAsyncGetFocus, void* );
71 :
72 : void implSetNewSelection( const InterfaceBag& _rSelection );
73 : void implDetachController();
74 : bool implIsReadOnlyModel() const;
75 : OUString getCurrentPage() const;
76 :
77 : public:
78 : FmPropBrw(
79 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xORB,
80 : SfxBindings* pBindings,
81 : SfxChildWindow* pMgr,
82 : vcl::Window* pParent,
83 : const SfxChildWinInfo* _pInfo
84 : );
85 : virtual ~FmPropBrw();
86 : virtual void dispose() SAL_OVERRIDE;
87 :
88 : using SfxFloatingWindow::StateChanged;
89 :
90 : protected:
91 : virtual void Resize() SAL_OVERRIDE;
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 // INCLUDED_SVX_SOURCE_INC_FMPROPBRW_HXX
114 :
115 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|