/src/libreoffice/sd/source/ui/inc/FrameView.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 "ViewShell.hxx" |
23 | | #include <svx/svdview.hxx> |
24 | | #include <pres.hxx> |
25 | | |
26 | | class SdDrawDocument; |
27 | | class SdOptions; |
28 | | |
29 | | namespace sd { |
30 | | |
31 | | /** |
32 | | * View for MDIFrame |
33 | | */ |
34 | | class FrameView final |
35 | | : public SdrView |
36 | | { |
37 | | public: |
38 | | FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView = nullptr ); |
39 | | FrameView(const FrameView& rFrameView); |
40 | | virtual ~FrameView() override; |
41 | | |
42 | | void Connect(); |
43 | | void Disconnect(); |
44 | | |
45 | | void Update(SdOptions const * pOptions); |
46 | | |
47 | | void SetStandardHelpLines(const SdrHelpLineList& rHelpLines) |
48 | 0 | { maStandardHelpLines = rHelpLines; } |
49 | 6 | const SdrHelpLineList& GetStandardHelpLines() const { return maStandardHelpLines; } |
50 | | void SetNotesHelpLines(const SdrHelpLineList& rHelpLines) |
51 | 0 | { maNotesHelpLines = rHelpLines; } |
52 | 6 | const SdrHelpLineList& GetNotesHelpLines() const { return maNotesHelpLines; } |
53 | | void SetHandoutHelpLines(const SdrHelpLineList& rHelpLines) |
54 | 0 | { maHandoutHelpLines = rHelpLines; } |
55 | 6 | const SdrHelpLineList& GetHandoutHelpLines() const { return maHandoutHelpLines; } |
56 | | |
57 | | void SetVisibleLayers(const SdrLayerIDSet& rVisibleLayers) |
58 | 0 | { maVisibleLayers = rVisibleLayers; } |
59 | 6 | const SdrLayerIDSet& GetVisibleLayers() const { return maVisibleLayers; } |
60 | | |
61 | | void SetLockedLayers(const SdrLayerIDSet& rLockedLayers) |
62 | 0 | { maLockedLayers = rLockedLayers; } |
63 | 6 | const SdrLayerIDSet& GetLockedLayers() const { return maLockedLayers; } |
64 | | |
65 | | void SetPrintableLayers(const SdrLayerIDSet& rPrintableLayers) |
66 | 0 | { maPrintableLayers = rPrintableLayers; } |
67 | 6 | const SdrLayerIDSet& GetPrintableLayers() const { return maPrintableLayers; } |
68 | | |
69 | | void SetRuler(const bool bRulerOn) |
70 | 496 | { mbRuler = bRulerOn; } |
71 | 6 | bool HasRuler() const { return mbRuler; } |
72 | | |
73 | | void SetNoColors(const bool bNoCol) |
74 | 375 | { mbNoColors = bNoCol; } |
75 | 6 | bool IsNoColors() const { return mbNoColors; } |
76 | | |
77 | | void SetNoAttribs(const bool bNoAttr) |
78 | 374 | { mbNoAttribs = bNoAttr; } |
79 | 6 | bool IsNoAttribs() const { return mbNoAttribs; } |
80 | | |
81 | | void SetVisArea(const ::tools::Rectangle& rVisArea) |
82 | 1.46k | { maVisArea = rVisArea; } |
83 | 1.47k | const ::tools::Rectangle& GetVisArea() const { return maVisArea; } |
84 | | |
85 | 8.58k | void SetPageKind(PageKind eKind) { mePageKind = eKind; } |
86 | 6 | PageKind GetPageKind() const { return mePageKind; } |
87 | | |
88 | | /** is used in FrameView::ReadUserDataSequence() only to store the |
89 | | page kind that was selected while last saving this document */ |
90 | 482 | void SetPageKindOnLoad(PageKind eKind) { mePageKindOnLoad = eKind; } |
91 | | |
92 | | /** can be used to get the page kind that was selected on last save of this document */ |
93 | 6 | PageKind GetPageKindOnLoad() const { return mePageKindOnLoad; } |
94 | | |
95 | | void SetSelectedPage (sal_uInt16 nPage); |
96 | 6 | sal_uInt16 GetSelectedPage () const { return mnSelectedPage;} |
97 | | |
98 | | /** is used in FrameView::ReadUserDataSequence() only to store the |
99 | | page that was selected while last saving this document */ |
100 | 486 | void SetSelectedPageOnLoad (sal_uInt16 nPage) { mnSelectedPageOnLoad = nPage; } |
101 | | |
102 | | /** can be used to get the page that was selected on last save of this document */ |
103 | 6 | sal_uInt16 GetSelectedPageOnLoad () const { return mnSelectedPageOnLoad; } |
104 | | |
105 | | void SetViewShEditMode(EditMode eMode); |
106 | | EditMode GetViewShEditMode () const; |
107 | | |
108 | | /** Remember the edit mode of the main view shell at the time when the |
109 | | document is loaded. |
110 | | */ |
111 | | void SetViewShEditModeOnLoad (const EditMode eMode); |
112 | | |
113 | | /** Return the value of the edit mode as it was when the document was |
114 | | loaded. |
115 | | */ |
116 | 6 | EditMode GetViewShEditModeOnLoad() const { return meEditModeOnLoad;} |
117 | | |
118 | | void SetLayerMode(bool bMode) |
119 | 483 | { mbLayerMode = bMode; } |
120 | 6 | bool IsLayerMode() const { return mbLayerMode; } |
121 | | |
122 | | void SetQuickEdit(bool bQEdit) |
123 | 8.77k | { mbQuickEdit = bQEdit; } |
124 | 6 | bool IsQuickEdit() const { return mbQuickEdit; } |
125 | | |
126 | 9.14k | void SetDoubleClickTextEdit( bool bOn ) { mbDoubleClickTextEdit = bOn; } |
127 | 6 | bool IsDoubleClickTextEdit() const { return mbDoubleClickTextEdit; } |
128 | | |
129 | 9.24k | void SetClickChangeRotation( bool bOn ) { mbClickChangeRotation = bOn; } |
130 | 6 | bool IsClickChangeRotation() const { return mbClickChangeRotation; } |
131 | | |
132 | | /** Remember the type of the view shell that was (or soon will be) |
133 | | previously associated with this frame view. |
134 | | @param eType |
135 | | The type of the previous view shell or ViewShell::ST_NONE to |
136 | | indicate that there is no previous view shell. |
137 | | */ |
138 | | void SetPreviousViewShellType (ViewShell::ShellType eType); |
139 | | |
140 | | /** Return the type of the view shell previously associated with this |
141 | | frame view. |
142 | | */ |
143 | 6 | ViewShell::ShellType GetPreviousViewShellType() const { return mePreviousViewShellType;} |
144 | | |
145 | | /** Remember the type of the view shell at the time when the document is |
146 | | loaded or, rather, when the ViewShellBase is constructed. |
147 | | */ |
148 | | void SetViewShellTypeOnLoad (ViewShell::ShellType eType); |
149 | | |
150 | 6 | ViewShell::ShellType GetViewShellTypeOnLoad() const { return meViewShellTypeOnLoad;} |
151 | | |
152 | | void SetPresentationViewShellId(sal_uInt16 nId) |
153 | 0 | { mnPresViewShellId = nId; } |
154 | 0 | sal_uInt16 GetPresentationViewShellId() const { return mnPresViewShellId; } |
155 | | |
156 | 9.14k | void SetSlidesPerRow(sal_uInt16 nSlides) { mnSlidesPerRow = nSlides; } |
157 | 6 | sal_uInt16 GetSlidesPerRow() const { return mnSlidesPerRow; } |
158 | | |
159 | 0 | void SetDrawMode(DrawModeFlags nNewDrawMode) { mnDrawMode = nNewDrawMode; }; |
160 | 6 | DrawModeFlags GetDrawMode() const { return mnDrawMode; }; |
161 | | |
162 | | void SetIsNavigatorShowingAllShapes (const bool bIsNavigatorShowingAllShapes); |
163 | 6 | bool IsNavigatorShowingAllShapes() const { return mbIsNavigatorShowingAllShapes;} |
164 | | |
165 | | void WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& ); |
166 | | void ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& ); |
167 | | |
168 | | private: |
169 | | sal_uInt16 mnRefCount; |
170 | | bool mbRuler; |
171 | | SdrLayerIDSet maVisibleLayers; |
172 | | SdrLayerIDSet maLockedLayers; |
173 | | SdrLayerIDSet maPrintableLayers; |
174 | | SdrHelpLineList maStandardHelpLines; |
175 | | SdrHelpLineList maNotesHelpLines; |
176 | | SdrHelpLineList maHandoutHelpLines; |
177 | | bool mbNoColors; ///< structuring mode |
178 | | bool mbNoAttribs; ///< structuring mode |
179 | | ::tools::Rectangle maVisArea; ///< visible area |
180 | | PageKind mePageKind; ///< kind of page (standard, notes, handout) |
181 | | sal_uInt16 mnSelectedPage; |
182 | | PageKind mePageKindOnLoad; |
183 | | sal_uInt16 mnSelectedPageOnLoad; |
184 | | EditMode mePageEditMode; ///< edit mode in drawing mode (Page/MasterPage) |
185 | | // EditMode meStandardEditMode; ///< edit mode in drawing mode (Page/MasterPage) |
186 | | // EditMode meNotesEditMode; ///< edit mode in notes mode (Page/MasterPage) |
187 | | // EditMode meHandoutEditMode; ///< edit mode in handout mode (Page/MasterPage) |
188 | | EditMode meEditModeOnLoad; |
189 | | bool mbLayerMode; ///< layer on/off |
190 | | bool mbQuickEdit; ///< QuickEdit on/off |
191 | | bool mbDoubleClickTextEdit; ///< text mode after double click |
192 | | bool mbClickChangeRotation; ///< single click switches between selection/rotation mode |
193 | | sal_uInt16 mnPresViewShellId; ///< ViewShell from which the presentation was started |
194 | | sal_uInt16 mnSlidesPerRow; ///< slides per row on the slide-desk |
195 | | DrawModeFlags mnDrawMode; ///< draw mode for the normal window |
196 | | /** Remember whether the navigator shows all shapes (<TRUE/>) or only |
197 | | the names ones (<FALSE/>). Not persistent. |
198 | | */ |
199 | | bool mbIsNavigatorShowingAllShapes; |
200 | | |
201 | | /** The type of the previous view shell. The (default) value |
202 | | ViewShell::ST_NONE indicates that there was no previous view shell. |
203 | | Note that this value is used only temporarily and is not saved or |
204 | | restored. |
205 | | */ |
206 | | ViewShell::ShellType mePreviousViewShellType; |
207 | | |
208 | | ViewShell::ShellType meViewShellTypeOnLoad; |
209 | | }; |
210 | | |
211 | | } // end of namespace sd |
212 | | |
213 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |