LibreOffice Module sd (master) 1
ViewShellBase.hxx
Go to the documentation of this file.
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
20#pragma once
21
22#include <glob.hxx>
23#include <sfx2/viewsh.hxx>
24#include <memory>
25
26class SdDrawDocument;
27class SfxRequest;
28
29namespace sd::tools {
30class EventMultiplexer;
31}
32
33namespace sd {
34
35class DrawController;
36class DrawDocShell;
37class FormShellManager;
38class ToolBarManager;
39class ViewShell;
40class ViewShellManager;
41class ViewTabBar;
42
55 : public SfxViewShell
56{
57public:
59
60private:
62 static void InitInterface_Impl();
63
64public:
71 SfxViewShell* pOldShell);
72
73 virtual ~ViewShellBase() override;
74
78 void LateInit (const OUString& rsDefaultView);
79
80 std::shared_ptr<ViewShellManager> const & GetViewShellManager() const;
81
86 std::shared_ptr<ViewShell> GetMainViewShell() const;
87
94 static ViewShellBase* GetViewShellBase (SfxViewFrame const * pFrame);
95
98
102 virtual void Execute (SfxRequest& rRequest);
103
108 void GetState (SfxItemSet& rSet);
109
110 /* override these from SfxViewShell */
111 virtual OUString GetSelectionText(bool = false, bool bOnlyASample = false) override;
112 virtual bool HasSelection(bool = true ) const override;
113
114 SvBorder GetBorder (bool bOuterResize);
115 virtual void InnerResizePixel (const Point& rOrigin, const Size& rSize, bool inplaceEditModeChange) override;
116 virtual void OuterResizePixel (const Point& rOrigin, const Size& rSize) override;
117
120 virtual ErrCode DoVerb(sal_Int32 nVerb) override;
121
125 virtual css::uno::Reference<css::view::XRenderable> GetRenderable() override;
126
128 virtual SfxPrinter* GetPrinter (bool bCreate = false) override;
129
131 virtual sal_uInt16 SetPrinter (
132 SfxPrinter* pNewPrinter,
133 SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL) override;
134
136 virtual void WriteUserDataSequence (
137 css::uno::Sequence< css::beans::PropertyValue >&) override;
138
143 virtual void ReadUserDataSequence (
144 const css::uno::Sequence< css::beans::PropertyValue >&) override;
145
146 virtual void UIActivating( SfxInPlaceClient* ) override;
147 virtual void UIDeactivated( SfxInPlaceClient* ) override;
148 virtual void Activate (bool IsMDIActivate) override;
150 virtual void SetZoomFactor (
151 const Fraction &rZoomX,
152 const Fraction &rZoomY) override;
153 virtual bool PrepareClose (bool bUI = true) override;
154 virtual void WriteUserData (OUString&, bool bBrowse = false) override;
155 virtual void ReadUserData (const OUString&, bool bBrowse = false) override;
156 virtual SdrView* GetDrawView() const override;
157
161 void SetBusyState (bool bBusy);
162
170 void Rearrange();
171
179 void UpdateBorder ( bool bForce = false );
180
185 void ShowUIControls (bool bVisible);
186
191 std::shared_ptr<tools::EventMultiplexer> const & GetEventMultiplexer() const;
192
196 const ::tools::Rectangle& getClientRectangle() const;
197
198 std::shared_ptr<ToolBarManager> const & GetToolBarManager() const;
199 std::shared_ptr<FormShellManager> const & GetFormShellManager() const;
200
202
203 void SetViewTabBar (const ::rtl::Reference<ViewTabBar>& rViewTabBar);
204
210
213 OUString RetrieveLabelFromCommand( const OUString& aCmdURL ) const;
215 int getPart() const override;
217 int getEditMode() const override;
219 void setEditMode(int nMode);
221 void afterCallbackRegistered() override;
223 void NotifyCursor(SfxViewShell* pViewShell) const override;
225 ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const override;
227 OUString GetColorConfigName() const override;
228
229 void setLOKVisibleArea(const ::tools::Rectangle& rArea) { maLOKVisibleArea = rArea; }
230 virtual ::tools::Rectangle getLOKVisibleArea() const override { return maLOKVisibleArea; }
231
232protected:
233
234 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
235
236 virtual void InitializeFramework();
237
238private:
239 class Implementation;
240 std::unique_ptr<Implementation> mpImpl;
244
251 OUString GetInitialViewShellType() const;
252};
253
254} // end of namespace sd
255
256/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Deactivate(bool IsMDIActivate) override
SfxViewFrame & rFrame
The DrawController is the UNO controller for Impress and Draw.
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
DrawController * GetDrawController() const
void LateInit(const OUString &rsDefaultView)
This method is part of the object construction.
virtual ::tools::Rectangle getLOKVisibleArea() const override
virtual void Execute(SfxRequest &rRequest)
Callback function for general slot calls.
::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const override
See SfxViewShell::GetColorConfigColor().
static ViewShellBase * GetViewShellBase(SfxViewFrame const *pFrame)
When given a view frame this static method returns the corresponding sd::ViewShellBase object.
OUString RetrieveLabelFromCommand(const OUString &aCmdURL) const
returns the ui descriptive name for the given uno slot.
OUString GetInitialViewShellType() const
Determine from the properties of the document shell the initial type of the view shell in the center ...
virtual void SetZoomFactor(const Fraction &rZoomX, const Fraction &rZoomY) override
void ShowUIControls(bool bVisible)
With this method the UI controls can be turned on or off.
virtual sal_uInt16 SetPrinter(SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags=SFX_PRINTER_ALL) override
Forwarded to the print manager.
virtual void InnerResizePixel(const Point &rOrigin, const Size &rSize, bool inplaceEditModeChange) override
void setLOKVisibleArea(const ::tools::Rectangle &rArea)
virtual bool HasSelection(bool=true) const override
virtual ~ViewShellBase() override
In this destructor the order in which some of the members are destroyed (and/or being prepared to bei...
void setEditMode(int nMode)
See SfxViewShell::setEditMode().
void GetState(SfxItemSet &rSet)
Callback function for retrieving item values related to certain slots.
void SetBusyState(bool bBusy)
When <TRUE> is given, then the mouse shape is set to hour glass (or whatever the busy shape looks lik...
std::shared_ptr< ToolBarManager > const & GetToolBarManager() const
OUString GetColorConfigName() const override
See SfxViewShell::GetColorConfigName().
DrawDocShell * mpDocShell
virtual void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &) override
Forward methods to main sub shell.
const ::tools::Rectangle & getClientRectangle() const
returns the complete area of the current view relative to the frame window
virtual void UIDeactivated(SfxInPlaceClient *) override
virtual void Activate(bool IsMDIActivate) override
virtual void OuterResizePixel(const Point &rOrigin, const Size &rSize) override
std::unique_ptr< Implementation > mpImpl
virtual void ReadUserDataSequence(const css::uno::Sequence< css::beans::PropertyValue > &) override
Pass the given properties to the main view shell.
virtual OUString GetSelectionText(bool=false, bool bOnlyASample=false) override
SdDrawDocument * mpDocument
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
virtual void UIActivating(SfxInPlaceClient *) override
void NotifyCursor(SfxViewShell *pViewShell) const override
See SfxViewShell::NotifyCursor().
int getPart() const override
See SfxViewShell::getPart().
int getEditMode() const override
See SfxViewShell::getEditMode().
::tools::Rectangle maLOKVisibleArea
virtual void InitializeFramework()
std::shared_ptr< tools::EventMultiplexer > const & GetEventMultiplexer() const
Return an event multiplexer.
SvBorder GetBorder(bool bOuterResize)
virtual SfxPrinter * GetPrinter(bool bCreate=false) override
Forwarded to the print manager.
std::shared_ptr< FormShellManager > const & GetFormShellManager() const
virtual ErrCode DoVerb(sal_Int32 nVerb) override
This call is forwarded to the main sub-shell.
virtual css::uno::Reference< css::view::XRenderable > GetRenderable() override
Return a new renderer that can be used for example for printing the document.
vcl::Window * GetViewWindow()
Return the window that is used by the main view shell to display its view and other UI elements,...
ViewShellBase(SfxViewFrame &rFrame, SfxViewShell *pOldShell)
This constructor is used by the view factory of the SFX macros.
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
std::shared_ptr< ViewShellManager > const & GetViewShellManager() const
void UpdateBorder(bool bForce=false)
Update the border that is set with SfxViewShell::SetBorderPixel().
virtual bool PrepareClose(bool bUI=true) override
void Rearrange()
Call this method when the controls of this view shell or the embedded sub shell need to be rearranged...
virtual void ReadUserData(const OUString &, bool bBrowse=false) override
void afterCallbackRegistered() override
See SfxViewShell::afterCallbackRegistered().
virtual void WriteUserData(OUString &, bool bBrowse=false) override
static void InitInterface_Impl()
SfxInterface initializer.
DrawDocShell * GetDocShell() const
virtual SdrView * GetDrawView() const override
SdDrawDocument * GetDocument() const
void SetViewTabBar(const ::rtl::Reference< ViewTabBar > &rViewTabBar)
#define SD_IF_SDVIEWSHELLBASE
Definition: glob.hxx:34
#define SFX_DECL_INTERFACE(nId)
SfxPrinterChangeFlags