xref: /trunk/main/sd/source/ui/inc/FrameView.hxx (revision 67e470da)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SD_FRAME_VIEW_HXX
25 #define SD_FRAME_VIEW_HXX
26 
27 #include "ViewShell.hxx"
28 #include <svx/svdview.hxx>
29 #include "pres.hxx"
30 
31 class SdDrawDocument;
32 class SdOptions;
33 
34 namespace sd {
35 
36 /*************************************************************************
37 |*
38 |* View fuer den MDIFrame
39 |*
40 \************************************************************************/
41 class FrameView
42     : public SdrView
43 {
44 public:
45 	SD_DLLPUBLIC FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView = NULL );
46 	FrameView(const FrameView& rFrameView);
47 	virtual ~FrameView();
48 
49 	void Connect();
50 	void Disconnect();
51 
52 	void Update(SdOptions* pOptions);
53 
SetStandardHelpLines(const SdrHelpLineList & rHelpLines)54 	void  SetStandardHelpLines(const SdrHelpLineList& rHelpLines)
55 							 { maStandardHelpLines = rHelpLines; }
GetStandardHelpLines()56 	const SdrHelpLineList& GetStandardHelpLines() { return maStandardHelpLines; }
SetNotesHelpLines(const SdrHelpLineList & rHelpLines)57 	void  SetNotesHelpLines(const SdrHelpLineList& rHelpLines)
58 							 { maNotesHelpLines = rHelpLines; }
GetNotesHelpLines()59 	const SdrHelpLineList& GetNotesHelpLines() { return maNotesHelpLines; }
SetHandoutHelpLines(const SdrHelpLineList & rHelpLines)60 	void  SetHandoutHelpLines(const SdrHelpLineList& rHelpLines)
61 							 { maHandoutHelpLines = rHelpLines; }
GetHandoutHelpLines()62 	const SdrHelpLineList& GetHandoutHelpLines() { return maHandoutHelpLines; }
63 
SetVisibleLayers(const SetOfByte & rVisibleLayers)64 	void SetVisibleLayers(const SetOfByte& rVisibleLayers)
65 						 { maVisibleLayers = rVisibleLayers; }
GetVisibleLayers()66 	const SetOfByte& GetVisibleLayers() { return maVisibleLayers; }
67 
SetLockedLayers(const SetOfByte & rLockedLayers)68 	void SetLockedLayers(const SetOfByte& rLockedLayers)
69 						{ maLockedLayers = rLockedLayers; }
GetLockedLayers()70 	const SetOfByte& GetLockedLayers() { return maLockedLayers; }
71 
SetPrintableLayers(const SetOfByte & rPrintableLayers)72 	void SetPrintableLayers(const SetOfByte& rPrintableLayers)
73 						 { maPrintableLayers = rPrintableLayers; }
GetPrintableLayers()74 	const SetOfByte& GetPrintableLayers() { return maPrintableLayers; }
75 
SetRuler(const sal_Bool bRulerOn)76 	void SetRuler(const sal_Bool bRulerOn)
77 				 { mbRuler = bRulerOn; }
HasRuler() const78 	sal_Bool HasRuler() const { return mbRuler; }
79 
SetNoColors(const sal_Bool bNoCol)80 	void SetNoColors(const sal_Bool bNoCol)
81 				 { mbNoColors = bNoCol; }
IsNoColors() const82 	sal_Bool IsNoColors() const { return mbNoColors; }
83 
SetNoAttribs(const sal_Bool bNoAttr)84 	void SetNoAttribs(const sal_Bool bNoAttr)
85 				 { mbNoAttribs = bNoAttr; }
IsNoAttribs() const86 	sal_Bool IsNoAttribs() const { return mbNoAttribs; }
87 
SetVisArea(const Rectangle & rVisArea)88 	void SetVisArea(const Rectangle& rVisArea)
89 				 { maVisArea = rVisArea; }
GetVisArea()90 	const Rectangle GetVisArea() { return maVisArea; }
91 
SetPageKind(PageKind eKind)92 	void SetPageKind(PageKind eKind) { mePageKind = eKind; }
GetPageKind() const93 	PageKind GetPageKind() const { return mePageKind; }
94 
95 	/** is used in FrameView::ReadUserDataSequence() only to store the
96 		page kind that was selected while last saving this document */
SetPageKindOnLoad(PageKind eKind)97 	void SetPageKindOnLoad(PageKind eKind) { mePageKindOnLoad = eKind; }
98 
99 	/** can be used to get the page kind that was selected on last save of this document */
GetPageKindOnLoad() const100 	PageKind GetPageKindOnLoad() const { return mePageKindOnLoad; }
101 
102 	SD_DLLPUBLIC void SetSelectedPage (sal_uInt16 nPage);
103 	sal_uInt16 GetSelectedPage () const;
104 
105 	/** is used in FrameView::ReadUserDataSequence() only to store the
106 		page that was selected while last saving this document */
SetSelectedPageOnLoad(sal_uInt16 nPage)107 	void SetSelectedPageOnLoad (sal_uInt16 nPage) { mnSelectedPageOnLoad = nPage; }
108 
109 	/** can be used to get the page that was selected on last save of this document */
GetSelectedPageOnLoad() const110 	sal_uInt16 GetSelectedPageOnLoad () const { return mnSelectedPageOnLoad; }
111 
112 	SD_DLLPUBLIC void SetViewShEditMode(EditMode eMode, PageKind eKind);
113 	EditMode GetViewShEditMode (PageKind eKind);
114 
115     /** Remember the edit mode of the main view shell at the time when the
116         document is loaded.
117     */
118 	void SetViewShEditModeOnLoad (const EditMode eMode);
119 
120     /** Return the value of the edit mode as it was when the document was
121         loaded.
122     */
123 	EditMode GetViewShEditModeOnLoad (void) const;
124 
SetLayerMode(sal_Bool bMode)125 	void SetLayerMode(sal_Bool bMode)
126 				 { mbLayerMode = bMode; }
IsLayerMode() const127 	sal_Bool IsLayerMode() const { return mbLayerMode; }
128 
SetQuickEdit(sal_Bool bQEdit)129 	void SetQuickEdit(sal_Bool bQEdit)
130 				 { mbQuickEdit = bQEdit; }
IsQuickEdit() const131 	sal_Bool IsQuickEdit() const { return mbQuickEdit; }
132 
SetBigHandles(sal_Bool bOn=sal_True)133 	void		SetBigHandles( sal_Bool bOn = sal_True ) { mbBigHandles = bOn; }
IsBigHandles() const134 	sal_Bool	IsBigHandles() const { return mbBigHandles; }
135 
SetDoubleClickTextEdit(sal_Bool bOn=sal_True)136 	void		SetDoubleClickTextEdit( sal_Bool bOn = sal_True ) { mbDoubleClickTextEdit = bOn; }
IsDoubleClickTextEdit() const137 	sal_Bool	IsDoubleClickTextEdit() const { return mbDoubleClickTextEdit; }
138 
SetClickChangeRotation(sal_Bool bOn=sal_True)139 	void		SetClickChangeRotation( sal_Bool bOn = sal_True ) { mbClickChangeRotation = bOn; }
IsClickChangeRotation() const140 	sal_Bool	IsClickChangeRotation() const { return mbClickChangeRotation; }
141 
142     /** Remember the type of the view shell that was (or soon will be)
143         previously associated with this frame view.
144         @param eType
145             The type of the previous view shell or ViewShell::ST_NONE to
146             indicate that there is no previous view shell.
147     */
148     void SetPreviousViewShellType (ViewShell::ShellType eType);
149 
150     /** Return the type of the view shell previously associated with this
151         frame view.
152     */
153     ViewShell::ShellType GetPreviousViewShellType (void) const;
154 
155     /** Remember the type of the view shell at the time when the document is
156         loaded or, rather, when the ViewShellBase is constructed.
157     */
158     void SetViewShellTypeOnLoad (ViewShell::ShellType eType);
159 
160     ViewShell::ShellType GetViewShellTypeOnLoad (void) const;
161 
SetPresentationViewShellId(sal_uInt16 nId)162 	void SetPresentationViewShellId(sal_uInt16 nId)
163 				 { mnPresViewShellId = nId; }
GetPresentationViewShellId() const164 	sal_uInt16 GetPresentationViewShellId() const { return mnPresViewShellId; }
165 
SetSlotId(sal_uInt16 nId)166 	void SetSlotId(sal_uInt16 nId) { mnSlotId = nId; }
GetSlotId() const167 	sal_uInt16 GetSlotId() const { return mnSlotId; }
168 
SetSlidesPerRow(sal_uInt16 nSlides)169 	void SetSlidesPerRow(sal_uInt16 nSlides) { mnSlidesPerRow = nSlides; }
GetSlidesPerRow() const170 	sal_uInt16 GetSlidesPerRow() const { return mnSlidesPerRow; }
171 
SetDrawMode(sal_uLong nNewDrawMode)172 	void SetDrawMode(sal_uLong nNewDrawMode) { mnDrawMode = nNewDrawMode; };
GetDrawMode() const173 	sal_uLong GetDrawMode() const { return mnDrawMode; };
174 
SetTabCtrlPercent(double nPercent)175 	void SetTabCtrlPercent( double nPercent ) { mnTabCtrlPercent = nPercent; }
GetTabCtrlPercent() const176 	double GetTabCtrlPercent() const { return mnTabCtrlPercent; }
177 
178     void SetIsNavigatorShowingAllShapes (const bool bIsNavigatorShowingAllShapes);
179     bool IsNavigatorShowingAllShapes (void) const;
180 
181     virtual void    WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
182     virtual void    ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
183 
184 private:
185 	sal_uInt16			mnRefCount;
186 	VirtualDevice*	mpVDev;
187 	sal_Bool			mbRuler;
188 	SetOfByte		maVisibleLayers;
189 	SetOfByte		maLockedLayers;
190 	SetOfByte		maPrintableLayers;
191 	SdrHelpLineList maStandardHelpLines;
192 	SdrHelpLineList maNotesHelpLines;
193 	SdrHelpLineList maHandoutHelpLines;
194 	sal_Bool			mbNoColors;		   // Gliederungsmodus
195 	sal_Bool			mbNoAttribs; 	   // Gliederungsmodus
196 	Rectangle		maVisArea;		   // Sichtbarer Bereich
197 	PageKind		mePageKind;		   // Seitentyp (Standard, Notizen, Handzettel)
198 	sal_uInt16			mnSelectedPage;	   // Selektierte Seite
199 	PageKind		mePageKindOnLoad;
200 	sal_uInt16			mnSelectedPageOnLoad;
201 	EditMode        meStandardEditMode; // Editmode im Zeichenmodus (Page/MasterPage)
202 	EditMode        meNotesEditMode;    // Editmode im Notizen-Modus (Page/MasterPage)
203 	EditMode        meHandoutEditMode;  // Editmode im Handzettel-Modus (Page/MasterPage)
204 	EditMode        meEditModeOnLoad;
205 	sal_Bool			mbLayerMode; 	   // Layer an/aus
206 	sal_Bool			mbQuickEdit; 	   // QuickEdit an/aus
207 	sal_Bool			mbBigHandles;	   // Grosse Handles
208 	sal_Bool			mbDoubleClickTextEdit; // Textmodus nach Doppelklick
209 	sal_Bool			mbClickChangeRotation; // Einfachklick wechselt Selektions-/Rotationsmodus
210 	sal_uInt16			mnPresViewShellId;  // ViewShell aus der die Pres. gestartet wurde
211 	sal_uInt16			mnSlotId;		   // SlotId, welche initial ausgefuehrt wird
212 	sal_uInt16          mnSlidesPerRow;     // Dias pro Reihe auf dem Diatisch
213 	sal_uLong			mnDrawMode;		   // Drawmode fuer das normale Fenster
214 	double          mnTabCtrlPercent;
215     /** Remember whether the navigator shows all shapes (<TRUE/>) or only
216         the names ones (<FALSE/>).  Not persistent.
217     */
218     bool            mbIsNavigatorShowingAllShapes;
219 
220     /** The type of the previous view shell.  The (default) value
221         ViewShell::ST_NONE indicates that there was no previous view shell.
222         Note that this value is used only temporarily and is not saved or
223         restored.
224     */
225     ViewShell::ShellType mePreviousViewShellType;
226 
227     ViewShell::ShellType meViewShellTypeOnLoad;
228 };
229 
230 } // end of namespace sd
231 
232 #endif
233 
234