cid#1636693 COPY_INSTEAD_OF_MOVE
[LibreOffice.git] / svx / source / inc / fmPropBrw.hxx
blobe5b735c0eee37791811a9ba2f8172a11729e8204
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SVX_SOURCE_INC_FMPROPBRW_HXX
20 #define INCLUDED_SVX_SOURCE_INC_FMPROPBRW_HXX
22 #include <com/sun/star/frame/XFrame2.hpp>
23 #include <com/sun/star/inspection/XObjectInspectorModel.hpp>
24 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include <sfx2/basedlgs.hxx>
27 #include <sfx2/ctrlitem.hxx>
28 #include <sfx2/childwin.hxx>
29 #include <svx/fmtools.hxx>
32 class FmPropBrwMgr final : public SfxChildWindow
34 public:
35 FmPropBrwMgr(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, const SfxChildWinInfo *pInfo);
36 SFX_DECL_CHILDWINDOW(FmPropBrwMgr);
39 class SfxBindings;
40 class FmFormShell;
42 class FmPropBrw final : public SfxModelessDialogController, public SfxControllerItem
44 bool m_bInitialStateChange;
45 weld::Window* m_pParent;
46 ImplSVEvent* m_nAsyncGetFocusId;
47 OUString m_sLastActivePage;
48 std::unique_ptr<weld::Box> m_xDialogBox;
49 std::unique_ptr<weld::Container> m_xContainer;
50 css::uno::Reference< css::uno::XComponentContext >
51 m_xInspectorContext;
52 css::uno::Reference< css::uno::XComponentContext >
53 m_xORB;
54 css::uno::Reference< css::frame::XFrame2 >
55 m_xMeAsFrame;
56 css::uno::Reference< css::uno::XInterface >
57 m_xLastKnownDocument;
58 css::uno::Reference< css::inspection::XObjectInspectorModel >
59 m_xInspectorModel;
60 css::uno::Reference< css::frame::XController >
61 m_xBrowserController;
63 virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) override;
64 virtual void FillInfo( SfxChildWinInfo& rInfo ) const override;
65 virtual void Close() override;
67 DECL_LINK( OnAsyncGetFocus, void*, void );
69 void implSetNewSelection( const InterfaceBag& _rSelection );
70 void implDetachController();
71 bool implIsReadOnlyModel() const;
72 OUString getCurrentPage() const;
74 public:
75 FmPropBrw(
76 const css::uno::Reference< css::uno::XComponentContext >& _xORB,
77 SfxBindings* pBindings,
78 SfxChildWindow* pMgr,
79 weld::Window* pParent,
80 const SfxChildWinInfo* _pInfo
82 virtual ~FmPropBrw() override;
84 private:
86 /** creates the PropertyBrowser (aka ObjectInspector) and plugs it into our frame
88 This method ensures that a new component is created every time the XModel which
89 we're working for changed. This is necessary since this model is part of the
90 ComponentContext we use to create the ObjectInspector.
92 void impl_ensurePropertyBrowser_nothrow( FmFormShell* _pFormShell );
94 /** creates a property browser
96 After this method returns, m_xBrowserController is not <NULL/>.
98 @precond
99 we don't have an ObjectInspector, yet, i.e. m_xBrowserController is <NULL/>.
101 void impl_createPropertyBrowser_throw( FmFormShell* _pFormShell );
103 #endif // INCLUDED_SVX_SOURCE_INC_FMPROPBRW_HXX
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */