/src/libreoffice/sd/source/ui/inc/ViewShell.hxx
Line | Count | Source |
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 <comphelper/OAccessible.hxx> |
23 | | #include <rtl/ref.hxx> |
24 | | #include <sfx2/viewsh.hxx> |
25 | | #include <svl/typedwhich.hxx> |
26 | | #include <svtools/scrolladaptor.hxx> |
27 | | #include <vcl/prntypes.hxx> |
28 | | #include <vcl/rendercontext/DrawModeFlags.hxx> |
29 | | #include <o3tl/deleter.hxx> |
30 | | #include <pres.hxx> |
31 | | #include "View.hxx" |
32 | | #include "fupoor.hxx" |
33 | | #include <sddllapi.h> |
34 | | |
35 | | #include <memory> |
36 | | |
37 | | class SdPage; |
38 | | class SvxRuler; |
39 | | class SdrOle2Obj; // for the ones, who have undefined parts of SVDRAW |
40 | | class SdDrawDocument; |
41 | | class SvxNumBulletItem; |
42 | | |
43 | | namespace weld |
44 | | { |
45 | | class Window; |
46 | | } |
47 | | |
48 | | namespace com::sun::star::drawing { class XDrawSubController; } |
49 | | |
50 | | namespace sd { |
51 | | |
52 | | class DrawDocShell; |
53 | | class FrameView; |
54 | | class LayerTabBar; |
55 | | class ViewShellBase; |
56 | | class Window; |
57 | | class WindowUpdater; |
58 | | class ZoomList; |
59 | | |
60 | | #undef OUTPUT_DRAWMODE_COLOR |
61 | | #undef OUTPUT_DRAWMODE_CONTRAST |
62 | | |
63 | | const DrawModeFlags OUTPUT_DRAWMODE_COLOR = DrawModeFlags::Default; |
64 | | const DrawModeFlags OUTPUT_DRAWMODE_GRAYSCALE |
65 | | = DrawModeFlags::GrayLine | DrawModeFlags::GrayFill |
66 | | | DrawModeFlags::BlackText | DrawModeFlags::GrayBitmap |
67 | | | DrawModeFlags::GrayGradient; |
68 | | const DrawModeFlags OUTPUT_DRAWMODE_BLACKWHITE |
69 | | = DrawModeFlags::BlackLine | DrawModeFlags::BlackText |
70 | | | DrawModeFlags::WhiteFill | DrawModeFlags::GrayBitmap |
71 | | | DrawModeFlags::WhiteGradient; |
72 | | const DrawModeFlags OUTPUT_DRAWMODE_CONTRAST |
73 | | = DrawModeFlags::SettingsLine | DrawModeFlags::SettingsFill |
74 | | | DrawModeFlags::SettingsText | DrawModeFlags::SettingsGradient; |
75 | | |
76 | | /** Base class of the stacked shell hierarchy. |
77 | | |
78 | | <p>Despite its name this class is not a descendant of SfxViewShell |
79 | | but of SfxShell. Its name expresses the fact that it acts like a |
80 | | view shell. Being a stacked shell rather than being an actual view shell |
81 | | there can be several instances of this class that |
82 | | <ul> |
83 | | <li>all are based on the same view shell and thus show the same |
84 | | document and share common view functionality and</li> |
85 | | <li>are all visible at the same time and live in the same |
86 | | frame.</li> |
87 | | <ul></p> |
88 | | |
89 | | <p>This class replaces the former ViewShell class.</p> |
90 | | */ |
91 | | class SAL_DLLPUBLIC_RTTI ViewShell |
92 | | : public SfxShell |
93 | | { |
94 | | public: |
95 | | enum ShellType { |
96 | | ST_NONE, |
97 | | ST_DRAW, // The Draw application. |
98 | | ST_IMPRESS, // Main view of the Impress application. |
99 | | ST_NOTES, |
100 | | ST_HANDOUT, |
101 | | ST_OUTLINE, |
102 | | ST_SLIDE_SORTER, |
103 | | ST_PRESENTATION, |
104 | | ST_SIDEBAR, |
105 | | ST_NOTESPANEL |
106 | | }; |
107 | | static const int MAX_HSPLIT_CNT = 1; |
108 | | static const int MAX_VSPLIT_CNT = 1; |
109 | | static const int MIN_SCROLLBAR_SIZE = 50; |
110 | | |
111 | | |
112 | | ViewShell ( |
113 | | vcl::Window* pParentWindow, |
114 | | ViewShellBase& rViewShellBase); |
115 | | virtual ~ViewShell() override; |
116 | | |
117 | | /** The Init method has to be called from the outside directly |
118 | | after a new object of this class has been created. It can be |
119 | | used for that part of the initialisation that can be run only |
120 | | after the creation of the new object is finished. This |
121 | | includes registration as listener at event broadcasters. |
122 | | |
123 | | Derived classes should call this method at the head of their |
124 | | Init() methods. |
125 | | @param bIsMainViewShell |
126 | | This flag tells the Init() method whether the new ViewShell will |
127 | | be the main view shell. |
128 | | */ |
129 | | virtual void Init (bool bIsMainViewShell); |
130 | | |
131 | | /** The Exit() method has to be called before the destructor so that the |
132 | | view shell is still a valid object and can safely call methods that |
133 | | rely on that. |
134 | | */ |
135 | | void Exit(); |
136 | | |
137 | | void Cancel(); |
138 | | |
139 | | /** Return the window that is the parent of all controls of this view |
140 | | shell. This may or may not be the window of the frame. |
141 | | */ |
142 | 0 | vcl::Window* GetParentWindow() const { return mpParentWindow; } |
143 | | |
144 | | sd::Window* GetContentWindow() const; |
145 | | |
146 | 0 | ::sd::View* GetView() const { return mpView; } |
147 | | inline SdrView* GetDrawView() const; |
148 | | SD_DLLPUBLIC DrawDocShell* GetDocSh() const; |
149 | | |
150 | | SdDrawDocument* GetDoc() const; |
151 | | |
152 | | SAL_RET_MAYBENULL SD_DLLPUBLIC SfxViewFrame* GetViewFrame() const; |
153 | | |
154 | | /** The active window is usually the mpContentWindow. When there is a |
155 | | show running then the active window is a ShowWindow. |
156 | | */ |
157 | 0 | ::sd::Window* GetActiveWindow() const { return mpActiveWindow;} |
158 | | SD_DLLPUBLIC weld::Window* GetFrameWeld() const; |
159 | | |
160 | | /** Set the active window. When the shell is displayed in the center |
161 | | pane then the window of the ViewShellBase is also set to the given |
162 | | window. |
163 | | */ |
164 | | void SetActiveWindow (::sd::Window* pWindow); |
165 | | |
166 | | /** Return the rectangle that encloses all windows of the view. That |
167 | | excludes the controls in the frame like rulers, scroll bars, tab |
168 | | bar, and buttons. |
169 | | @return |
170 | | The rectangle is returned in screen coordinates, i.e. pixel |
171 | | values relative to the upper left corner of the screen?. |
172 | | */ |
173 | | const ::tools::Rectangle& GetAllWindowRect(); |
174 | | |
175 | | // Mouse- & Key-Events |
176 | | virtual void PrePaint(); |
177 | | virtual void Paint (const ::tools::Rectangle& rRect, ::sd::Window* pWin); |
178 | | virtual bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin); |
179 | | virtual void MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin); |
180 | | virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin); |
181 | | virtual void MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin); |
182 | | virtual void Command(const CommandEvent& rCEvt, ::sd::Window* pWin); |
183 | | bool RequestHelp( const HelpEvent& rEvt ); |
184 | | bool Notify( NotifyEvent const & rNEvt, ::sd::Window* pWin ); |
185 | | |
186 | | bool HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWin); |
187 | | |
188 | | void SetUIUnit(FieldUnit eUnit); |
189 | | void SetDefTabHRuler( sal_uInt16 nDefTab ); |
190 | | |
191 | | const SvxNumBulletItem* GetNumBulletItem(SfxItemSet& aNewAttr, TypedWhichId<SvxNumBulletItem>& nNumItemId); |
192 | | |
193 | 0 | bool HasRuler() const { return mbHasRulers;} |
194 | | void SetRuler(bool bRuler); |
195 | | // Hides horizontal, vertical scrollbar as well as scrollbox |
196 | | void SetScrollBarsVisible(bool bVisible); |
197 | | |
198 | | /** Set internal values of all scroll bars that determine thumb size and |
199 | | position. The external values like size and position of the scroll |
200 | | bar controls are not modified. |
201 | | */ |
202 | | virtual void UpdateScrollBars(); |
203 | | void Scroll(::tools::Long nX, ::tools::Long nY); |
204 | | void ScrollLines(::tools::Long nX, ::tools::Long nY); |
205 | | virtual void SetZoom(::tools::Long nZoom); |
206 | | ::tools::Long GetZoom() const; |
207 | | virtual void SetZoomRect(const ::tools::Rectangle& rZoomRect); |
208 | | void InitWindows(const Point& rViewOrigin, const Size& rViewSize, |
209 | | const Point& rWinPos, bool bUpdate = false); |
210 | | void InvalidateWindows(); |
211 | | /** This method is still used by the OutlineViewShell to update the |
212 | | model according to the content of the outline view. This in turn |
213 | | updates the previews in the slide sorter. |
214 | | */ |
215 | | virtual void UpdatePreview (SdPage* pPage); |
216 | | |
217 | | void DrawMarkRect(const ::tools::Rectangle& rRect) const; |
218 | | |
219 | | void ExecReq( SfxRequest &rReq ); |
220 | | |
221 | 0 | ZoomList* GetZoomList() { return mpZoomList.get();} |
222 | | |
223 | 0 | FrameView* GetFrameView() { return mpFrameView; } |
224 | | /** Setting a frame view triggers ReadFrameViewData() for the new |
225 | | frame. |
226 | | @param pFrameView |
227 | | The new frame view that replaces the old one. |
228 | | */ |
229 | | void SetFrameView (FrameView* pFrameView); |
230 | | virtual void ReadFrameViewData(FrameView* pView); |
231 | | virtual void WriteFrameViewData(); |
232 | | void WriteUserData(); |
233 | | void ReadUserData(); |
234 | | |
235 | | virtual bool ActivateObject(SdrOle2Obj* pObj, sal_Int32 nVerb); |
236 | | |
237 | | /** @returns |
238 | | current or selected page or 0. This method |
239 | | will fail in master page mode. |
240 | | |
241 | | @deprecated, please use getCurrentPage(); |
242 | | */ |
243 | | virtual SdPage* GetActualPage() = 0; |
244 | | |
245 | | /** @returns |
246 | | current or selected page or 0. |
247 | | */ |
248 | | virtual SdPage* getCurrentPage() const = 0; |
249 | | |
250 | 0 | const rtl::Reference<FuPoor>& GetOldFunction() const { return mxOldFunction; } |
251 | 0 | bool HasOldFunction() const { return mxOldFunction.is(); } |
252 | 0 | const rtl::Reference<FuPoor>& GetCurrentFunction() const { return mxCurrentFunction; } |
253 | 0 | bool HasCurrentFunction( sal_uInt16 nSID ) { return mxCurrentFunction.is() && (mxCurrentFunction->GetSlotID() == nSID ); } |
254 | 0 | bool HasCurrentFunction() const { return mxCurrentFunction.is(); } |
255 | | |
256 | | void SetCurrentFunction(const rtl::Reference<FuPoor>& xFunction); |
257 | | void SetOldFunction(const rtl::Reference<FuPoor>& xFunction); |
258 | | void DeactivateCurrentFunction( bool bPermanent = false ); |
259 | | |
260 | | void SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize, |
261 | | ::tools::Long nLeft, ::tools::Long nRight, ::tools::Long nUpper, ::tools::Long nLower, |
262 | | bool bScaleAll, Orientation eOrient, sal_uInt16 nPaperBin, |
263 | | bool bBackgroundFullSize ); |
264 | | |
265 | 0 | void SetStartShowWithDialog( bool bIn ) { mbStartShowWithDialog = bIn; } |
266 | 0 | bool IsStartShowWithDialog() const { return mbStartShowWithDialog; } |
267 | | |
268 | 0 | sal_uInt16 GetPrintedHandoutPageNum() const { return mnPrintedHandoutPageNum; } |
269 | 0 | void SetPrintedHandoutPageNum (sal_uInt16 nPageNumber) {mnPrintedHandoutPageNum=nPageNumber; } |
270 | | |
271 | 0 | sal_uInt16 GetPrintedHandoutPageCount() const { return mnPrintedHandoutPageCount; } |
272 | 0 | void SetPrintedHandoutPageCount (sal_uInt16 nPageCount) {mnPrintedHandoutPageCount=nPageCount; } |
273 | | |
274 | | virtual bool PrepareClose( bool bUI = true ); |
275 | | |
276 | | void GetMenuState(SfxItemSet& rSet); |
277 | | |
278 | | virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTargetHelper, |
279 | | ::sd::Window* pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer ); |
280 | | virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt, DropTargetHelper& rTargetHelper, |
281 | | ::sd::Window* pTargetWindow, sal_uInt16 nPage, SdrLayerID nLayer ); |
282 | | |
283 | | virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& ); |
284 | | virtual void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& ); |
285 | | |
286 | | /** this method is called when the visible area of the view from this viewshell is changed */ |
287 | | virtual void VisAreaChanged(const ::tools::Rectangle& rRect); |
288 | | |
289 | | /** Create an accessible object representing the specified window. |
290 | | Override this method to provide view mode specific objects. The |
291 | | default implementation returns an empty reference. |
292 | | @param pWindow |
293 | | Make the document displayed in this window accessible. |
294 | | @return |
295 | | This default implementation returns an empty reference. |
296 | | */ |
297 | | virtual rtl::Reference<comphelper::OAccessible> |
298 | | CreateAccessibleDocumentView(::sd::Window* pWindow); |
299 | | |
300 | | virtual void SwitchViewFireFocus( const css::uno::Reference< css::accessibility::XAccessible >& xAcc ); |
301 | | void SwitchActiveViewFireFocus( ); |
302 | | // Move these two methods from DrawViewShell to enable slide show view |
303 | | void NotifyAccUpdate(); |
304 | | void fireSwitchCurrentPage(sal_Int32 pageIndex); |
305 | | void SetWinViewPos(const Point& rWinPos); |
306 | | Point const & GetWinViewPos() const; |
307 | | Point const & GetViewOrigin() const; |
308 | | |
309 | | /** Return the window updater of this view shell. |
310 | | @return |
311 | | In rare circumstances the returned pointer may be <null/>, |
312 | | i.e. when no memory is available anymore. |
313 | | */ |
314 | | ::sd::WindowUpdater* GetWindowUpdater() const; |
315 | | |
316 | | /** Return the border that is drawn around the actual document view. |
317 | | The border contains typically rulers and scroll bars. |
318 | | */ |
319 | | SvBorder GetBorder(); |
320 | | |
321 | | /** Notify the view shell that its parent window has been resized. |
322 | | The ViewShell places and resizes its UI elements accordingly. |
323 | | The new size can be obtained from the parent window. |
324 | | */ |
325 | | virtual void Resize(); |
326 | | |
327 | | /** Set position and size of the GUI elements that are controlled by |
328 | | the view shell like rulers and scroll bars as well as the actual |
329 | | document view according to the position and size that were given |
330 | | with the last Resize() call. |
331 | | */ |
332 | | virtual void ArrangeGUIElements(); |
333 | | |
334 | | // virtual void OuterResizePixel(const Point &rPos, const Size &rSize); |
335 | | // virtual void InnerResizePixel(const Point &rPos, const Size &rSize); |
336 | | |
337 | | // Exported for unit test |
338 | | SD_DLLPUBLIC ViewShellBase& GetViewShellBase() const; |
339 | | |
340 | | /** Return <TRUE/> when the called view shell is the main sub shell of |
341 | | its ViewShellBase object, i.e. is display in the center pane. This |
342 | | convenience function is equivalent to comparing the this pointer to |
343 | | the result of ViewShellBase::GetViewShell(PT_CENTER). |
344 | | */ |
345 | | bool IsMainViewShell() const; |
346 | | |
347 | | /** Set or reset the flag that indicates whether the called shell is the |
348 | | one displayed in the center pane. By default this flag is set to |
349 | | <FALSE/>. For the main view shell it thus has to be set to <TRUE/>. |
350 | | */ |
351 | | void SetIsMainViewShell (bool bIsMainViewShell); |
352 | | |
353 | | /** Return a sub controller that implements the view shell specific |
354 | | part of the DrawController. |
355 | | */ |
356 | | virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController() = 0; |
357 | | |
358 | | /** Return the type of the shell. |
359 | | */ |
360 | | SD_DLLPUBLIC ShellType GetShellType() const; //Export for unit test |
361 | | |
362 | | /** This method is more or less an alias to Deactivate(). It is called |
363 | | before an object of this class is taken from the stack of view |
364 | | shells. |
365 | | |
366 | | <p>When this method is not called before a view shell is taken from |
367 | | a stack then the Deactivate() call from the SFX as a response to |
368 | | RemoveSubShell() comes too late when the view shell is not on the |
369 | | stack anymore.</p> |
370 | | */ |
371 | | virtual void Shutdown(); |
372 | | |
373 | | /** This function is called from the underlying ViewShellBase |
374 | | object to handle a verb execution request. |
375 | | */ |
376 | | virtual ErrCode DoVerb(sal_Int32 nVerb); |
377 | | |
378 | | virtual void UIActivating( SfxInPlaceClient* ); |
379 | | virtual void UIDeactivated( SfxInPlaceClient* ); |
380 | | |
381 | | /** Show controls of the UI or hide them, depending on the given flag. |
382 | | As a result the border is adapted. |
383 | | */ |
384 | | virtual void ShowUIControls (bool bVisible); |
385 | | bool IsPageFlipMode() const; |
386 | | bool CanPanAcrossPages() const; |
387 | | |
388 | | /** Set the given window as new parent window. This is not possible for |
389 | | all views, so the return value tells the caller if the relocation |
390 | | was successful. |
391 | | */ |
392 | | virtual bool RelocateToParentWindow (vcl::Window* pParentWindow); |
393 | | |
394 | | /** Depending on the given request create a new page or duplicate an |
395 | | existing one. A new page is created behind the given slide. |
396 | | @param rRequest |
397 | | The request as passed to an Execute() method. Its arguments are |
398 | | evaluated. Its slot id determines whether to create or |
399 | | duplicate a slide. |
400 | | @param pPage |
401 | | This page is either duplicated or becomes the predecessor of the |
402 | | new slide. If NULL a duplication request is ignored. A new |
403 | | slide is inserted as first slide. |
404 | | @param nInsertPosition |
405 | | When -1 (the default) then insert after pPage. Otherwise insert |
406 | | before the given index (of a standard page). |
407 | | @return |
408 | | The new slide is returned. If for some reason a new page can |
409 | | not be created then NULL is returned. |
410 | | */ |
411 | | virtual SdPage* CreateOrDuplicatePage ( |
412 | | SfxRequest& rRequest, |
413 | | PageKind ePageKind, |
414 | | SdPage* pPage, |
415 | | const sal_Int32 nInsertPosition = -1); |
416 | | |
417 | | /** Called by sd::Window::LoseFocus to enable sd::ViewShell to take action |
418 | | when focus is lost. |
419 | | |
420 | | e.g. overridden by NotesPanelViewShell |
421 | | */ |
422 | 0 | virtual void onLoseFocus(){}; |
423 | | |
424 | | /** Called by sd::Window::GrabFocus to enable sd::ViewShell to take action |
425 | | when focus is grabbed. |
426 | | |
427 | | e.g. overridden by NotesPanelViewShell |
428 | | */ |
429 | 0 | virtual void onGrabFocus(){}; |
430 | | |
431 | 0 | virtual void RememberCanvasPageVisArea(const ::tools::Rectangle & /*aRect*/) {}; |
432 | | |
433 | | /// Allows adjusting the point or mark of the selection to a document coordinate. |
434 | | void SetCursorMm100Position(const Point& rPosition, bool bPoint, bool bClearMark); |
435 | | /// Gets the current selection |
436 | | css::uno::Reference<css::datatransfer::XTransferable> GetSelectionTransferable() const; |
437 | | /// Allows starting or ending a graphic move or resize action. |
438 | | void SetGraphicMm100Position(bool bStart, const Point& rPosition); |
439 | | |
440 | | sal_uInt16 GetPageZoom() const; |
441 | | void RememberPageZoom(const sal_uInt16 nZoom); |
442 | | |
443 | | class Implementation; |
444 | | |
445 | | protected: |
446 | | /** must be called in the beginning of each subclass d'tor. |
447 | | disposes and clears both current and old function. */ |
448 | | void DisposeFunctions(); |
449 | | |
450 | | friend class ViewShellBase; |
451 | | |
452 | | /** Window inside the rulers and scroll bars that shows a view of the |
453 | | document. |
454 | | */ |
455 | | |
456 | | VclPtr<sd::Window> mpContentWindow; |
457 | | |
458 | | /// Horizontal scroll bar for the current slide is displayed when needed. |
459 | | VclPtr<ScrollAdaptor> mpHorizontalScrollBar; |
460 | | /// Vertical scroll bar for whole document is always visible. |
461 | | VclPtr<ScrollAdaptor> mpVerticalScrollBar; |
462 | | /// Horizontal ruler is not shown by default. |
463 | | VclPtr<SvxRuler> mpHorizontalRuler; |
464 | | /// Vertical ruler is not shown by default. |
465 | | VclPtr<SvxRuler> mpVerticalRuler; |
466 | | /// Layer tab bar. |
467 | | VclPtr<LayerTabBar> mpLayerTabBar; |
468 | | |
469 | | /// This flag controls whether the rulers are visible. |
470 | | bool mbHasRulers; |
471 | | |
472 | | /// The active window. |
473 | | VclPtr< ::sd::Window> mpActiveWindow; |
474 | | ::sd::View* mpView; |
475 | | FrameView* mpFrameView; |
476 | | |
477 | | rtl::Reference<FuPoor> mxCurrentFunction; |
478 | | rtl::Reference<FuPoor> mxOldFunction; |
479 | | std::unique_ptr<ZoomList> mpZoomList; |
480 | | double mfLastZoomScale; |
481 | | double mfAccumulatedZoom = 0; |
482 | | |
483 | | Point maViewPos; |
484 | | Size maViewSize; |
485 | | Size maScrBarWH; |
486 | | |
487 | | bool mbStartShowWithDialog; // presentation is started by dialog |
488 | | sal_uInt16 mnPrintedHandoutPageNum; // Page number of the handout page that is to be printed. |
489 | | sal_uInt16 mnPrintedHandoutPageCount; // Page count of the handout pages that are to be printed. |
490 | | |
491 | | sal_uInt16 mnCanvasPageZoom = 20; |
492 | | sal_uInt16 mnNonCanvasPageZoom = 100; |
493 | | |
494 | | //af bool bPrintDirectSelected; // Print only selected objects in direct print |
495 | | //afString sPageRange; // pagerange if selected objects in direct print |
496 | | |
497 | | /** Area covered by all windows, i.e. the area of the parent window |
498 | | without the controls at the borders like rulers, scroll bars, tab |
499 | | bar, buttons. |
500 | | This rectangle may be set in window coordinates (i.e. pixel values |
501 | | relative to the parent window). It is transformed by every call to |
502 | | GetAllWindowRectangle() into screen coordinates (relative to the |
503 | | upper left corner of the screen. |
504 | | */ |
505 | | ::tools::Rectangle maAllWindowRectangle; |
506 | | |
507 | | /// The type of the shell. Returned by GetShellType(). |
508 | | ShellType meShellType; |
509 | | |
510 | | std::unique_ptr<Implementation, o3tl::default_delete<Implementation>> mpImpl; |
511 | | |
512 | | // Support methods for centralized UNDO/REDO |
513 | | virtual SfxUndoManager* ImpGetUndoManager() const; |
514 | | void ImpGetUndoStrings(SfxItemSet &rSet) const; |
515 | | void ImpGetRedoStrings(SfxItemSet &rSet) const; |
516 | | void ImpSidUndo(SfxRequest& rReq); |
517 | | void ImpSidRedo(SfxRequest& rReq); |
518 | | |
519 | | DECL_DLLPRIVATE_LINK( HScrollHdl, weld::Scrollbar&, void ); |
520 | | DECL_DLLPRIVATE_LINK( VScrollHdl, weld::Scrollbar&, void ); |
521 | | |
522 | | // virtual scroll handler, here, derivative classes can add themselves here |
523 | | virtual void VirtHScrollHdl(ScrollAdaptor* pHScroll); |
524 | | virtual void VirtVScrollHdl(ScrollAdaptor* pVScroll); |
525 | | |
526 | | // virtual functions ruler handling |
527 | | virtual VclPtr<SvxRuler> CreateHRuler(::sd::Window* pWin); |
528 | | virtual VclPtr<SvxRuler> CreateVRuler(::sd::Window* pWin); |
529 | | virtual void UpdateHRuler(); |
530 | | virtual void UpdateVRuler(); |
531 | | |
532 | | virtual void Activate(bool IsMDIActivate) override; |
533 | | virtual void Deactivate(bool IsMDIActivate) override; |
534 | | virtual void BroadcastContextForActivation (const bool bIsActivated) override; |
535 | | |
536 | | virtual void SetZoomFactor( double fZoomX, double fZoomY ); |
537 | | |
538 | | /** |
539 | | This must be called after the ctor, but before anything else. |
540 | | It's the part of construction that is dependent |
541 | | on showing the top-level window. |
542 | | |
543 | | Showing a window with a11y enabled causes various callbacks |
544 | | to be triggered. |
545 | | |
546 | | Due to the "virtual methods are not virtual during constructors" |
547 | | problem, this is a disaster to call from the ctor |
548 | | |
549 | | i.e. construct calls Show, and if a11y is enabled this |
550 | | reenters the not-fully constructed object and calls |
551 | | CreateAccessibleDocumentView, so if construct is called |
552 | | from the ctor then if a derived class is constructed the base-case |
553 | | CreateAccessibleDocumentView is used, not the derived |
554 | | CreateAccessibleDocumentView. i.e. run smoketest under a11y with |
555 | | debugging assertions enabled |
556 | | */ |
557 | | void doShow(); |
558 | | |
559 | | private: |
560 | | VclPtr<vcl::Window> mpParentWindow; |
561 | | /** This window updater is used to keep all relevant windows up to date |
562 | | with reference to the digit language used to display digits in text |
563 | | shapes. |
564 | | */ |
565 | | ::std::unique_ptr< ::sd::WindowUpdater> mpWindowUpdater; |
566 | | |
567 | | /** Create the rulers. |
568 | | */ |
569 | | void SetupRulers(); |
570 | | |
571 | | // IASS: Check if commands should be used for SlideShow |
572 | | bool useInputForSlideShow() const; |
573 | | }; |
574 | | |
575 | | SdrView* ViewShell::GetDrawView() const |
576 | 0 | { |
577 | 0 | return static_cast<SdrView*>(mpView); |
578 | 0 | } |
579 | | |
580 | | } // end of namespace sd |
581 | | |
582 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |