cid#1607171 Data race condition
[LibreOffice.git] / sd / source / ui / inc / OutlineViewShell.hxx
blobec12e888a4e639d94ed70f878bde6853f4144645
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 .
20 #pragma once
22 #include "ViewShell.hxx"
23 #include <glob.hxx>
25 class SdPage;
26 class TransferableDataHelper;
27 class TransferableClipboardListener;
29 namespace sd { class OutlineView; }
31 namespace sd {
33 /** Show a textual overview of the text contents of all slides.
35 class OutlineViewShell final
36 : public ViewShell
38 public:
40 SFX_DECL_VIEWFACTORY(OutlineViewShell);
41 SFX_DECL_INTERFACE(SD_IF_SDOUTLINEVIEWSHELL)
43 private:
44 /// SfxInterface initializer.
45 static void InitInterface_Impl();
47 public:
48 /** Create a new view shell for the outline mode.
49 @param rViewShellBase
50 The new object will be stacked on this view shell base.
51 @param pFrameView
52 The frame view that makes it possible to pass information from
53 one view shell to the next.
55 OutlineViewShell (
56 SfxViewFrame* pFrame,
57 ViewShellBase& rViewShellBase,
58 vcl::Window* pParentWindow,
59 FrameView* pFrameView);
61 virtual ~OutlineViewShell() override;
63 virtual void Shutdown() override;
65 virtual void Paint(const ::tools::Rectangle& rRect, ::sd::Window* pWin) override;
67 /** Arrange and resize the GUI elements like rulers, sliders, and
68 buttons as well as the actual document view according to the size of
69 the enclosing window and current sizes of buttons, rulers, and
70 sliders.
72 virtual void ArrangeGUIElements() override;
74 virtual bool PrepareClose( bool bUI = true ) override;
76 virtual void VirtHScrollHdl(ScrollAdaptor* pHScroll) override;
77 virtual void VirtVScrollHdl(ScrollAdaptor* pVHScroll) override;
79 virtual void Activate( bool IsMDIActivate ) override;
80 virtual void Deactivate( bool IsMDIActivate ) override;
82 virtual SdPage* GetActualPage() override;
84 /// inherited from sd::ViewShell
85 virtual SdPage* getCurrentPage() const override;
87 void ExecCtrl(SfxRequest &rReq);
88 void GetCtrlState(SfxItemSet &rSet);
89 // FIXME non-virtual override???
90 void GetMenuState(SfxItemSet &rSet);
91 void GetAttrState(SfxItemSet &rSet);
92 void GetState (SfxItemSet& rSet);
94 static void ExecStatusBar(SfxRequest& rReq);
95 void GetStatusBarState(SfxItemSet& rSet);
97 void FuTemporary(SfxRequest &rReq);
98 void FuTemporaryModify(SfxRequest &rReq);
99 void FuPermanent(SfxRequest &rReq);
100 void FuSupport(SfxRequest &rReq);
102 virtual void SetZoom(::tools::Long nZoom) override;
103 virtual void SetZoomRect(const ::tools::Rectangle& rZoomRect) override;
105 void Execute(SfxRequest& rReq);
107 virtual void ReadFrameViewData(FrameView* pView) override;
108 virtual void WriteFrameViewData() override;
110 virtual void Command( const CommandEvent& rCEvt, ::sd::Window* pWin ) override;
111 virtual bool KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) override;
112 virtual void MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin) override;
114 ErrCode ReadRtf(SvStream& rInput);
116 virtual void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& ) override;
117 virtual void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& ) override;
119 /** this method is called when the visible area of the view from this viewshell is changed */
120 virtual void VisAreaChanged(const ::tools::Rectangle& rRect) override;
122 /** Create an accessible object representing the specified window.
123 @param pWindow
124 The returned object makes the document displayed in this window
125 accessible.
126 @return
127 Returns an <type>AccessibleDrawDocumentView</type> object.
129 virtual css::uno::Reference<css::accessibility::XAccessible>
130 CreateAccessibleDocumentView (::sd::Window* pWindow) override;
132 /** Update the preview to show the specified page.
134 virtual void UpdatePreview (SdPage* pPage) override;
136 virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController() override;
138 /** Make the given page the new current page. This method
139 notifies the controller and adapts the selection of the
140 model.
141 @param pPage
142 The new current page. Pass NULL when there is no current page.
144 void SetCurrentPage (SdPage* pPage);
146 void UpdateTitleObject( SdPage* pPage, Paragraph const * pPara );
147 void UpdateOutlineObject( SdPage* pPage, Paragraph* pPara );
149 private:
150 OUString m_StrOldPageName;
151 std::unique_ptr<OutlineView> pOlView;
152 SdPage* pLastPage; // For efficient processing of the preview
153 rtl::Reference<TransferableClipboardListener> mxClipEvtLstnr;
154 bool bPastePossible;
155 bool mbInitialized;
157 void Construct();
158 DECL_LINK( ClipboardChanged, TransferableDataHelper*, void );
161 } // end of namespace sd
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */