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