xref: /AOO41X/main/sd/source/ui/inc/FrameView.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef SD_FRAME_VIEW_HXX
29*cdf0e10cSrcweir #define SD_FRAME_VIEW_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "ViewShell.hxx"
32*cdf0e10cSrcweir #include <svx/svdview.hxx>
33*cdf0e10cSrcweir #include "pres.hxx"
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir class SdDrawDocument;
36*cdf0e10cSrcweir class SdOptions;
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir namespace sd {
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir /*************************************************************************
41*cdf0e10cSrcweir |*
42*cdf0e10cSrcweir |* View fuer den MDIFrame
43*cdf0e10cSrcweir |*
44*cdf0e10cSrcweir \************************************************************************/
45*cdf0e10cSrcweir class FrameView
46*cdf0e10cSrcweir     : public SdrView
47*cdf0e10cSrcweir {
48*cdf0e10cSrcweir public:
49*cdf0e10cSrcweir 	SD_DLLPUBLIC FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView = NULL );
50*cdf0e10cSrcweir 	FrameView(const FrameView& rFrameView);
51*cdf0e10cSrcweir 	virtual ~FrameView();
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir 	void Connect();
54*cdf0e10cSrcweir 	void Disconnect();
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir 	void Update(SdOptions* pOptions);
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir 	void  SetStandardHelpLines(const SdrHelpLineList& rHelpLines)
59*cdf0e10cSrcweir 							 { maStandardHelpLines = rHelpLines; }
60*cdf0e10cSrcweir 	const SdrHelpLineList& GetStandardHelpLines() { return maStandardHelpLines; }
61*cdf0e10cSrcweir 	void  SetNotesHelpLines(const SdrHelpLineList& rHelpLines)
62*cdf0e10cSrcweir 							 { maNotesHelpLines = rHelpLines; }
63*cdf0e10cSrcweir 	const SdrHelpLineList& GetNotesHelpLines() { return maNotesHelpLines; }
64*cdf0e10cSrcweir 	void  SetHandoutHelpLines(const SdrHelpLineList& rHelpLines)
65*cdf0e10cSrcweir 							 { maHandoutHelpLines = rHelpLines; }
66*cdf0e10cSrcweir 	const SdrHelpLineList& GetHandoutHelpLines() { return maHandoutHelpLines; }
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir 	void SetVisibleLayers(const SetOfByte& rVisibleLayers)
69*cdf0e10cSrcweir 						 { maVisibleLayers = rVisibleLayers; }
70*cdf0e10cSrcweir 	const SetOfByte& GetVisibleLayers() { return maVisibleLayers; }
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir 	void SetLockedLayers(const SetOfByte& rLockedLayers)
73*cdf0e10cSrcweir 						{ maLockedLayers = rLockedLayers; }
74*cdf0e10cSrcweir 	const SetOfByte& GetLockedLayers() { return maLockedLayers; }
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 	void SetPrintableLayers(const SetOfByte& rPrintableLayers)
77*cdf0e10cSrcweir 						 { maPrintableLayers = rPrintableLayers; }
78*cdf0e10cSrcweir 	const SetOfByte& GetPrintableLayers() { return maPrintableLayers; }
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir 	void SetRuler(const sal_Bool bRulerOn)
81*cdf0e10cSrcweir 				 { mbRuler = bRulerOn; }
82*cdf0e10cSrcweir 	sal_Bool HasRuler() const { return mbRuler; }
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir 	void SetNoColors(const sal_Bool bNoCol)
85*cdf0e10cSrcweir 				 { mbNoColors = bNoCol; }
86*cdf0e10cSrcweir 	sal_Bool IsNoColors() const { return mbNoColors; }
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 	void SetNoAttribs(const sal_Bool bNoAttr)
89*cdf0e10cSrcweir 				 { mbNoAttribs = bNoAttr; }
90*cdf0e10cSrcweir 	sal_Bool IsNoAttribs() const { return mbNoAttribs; }
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir 	void SetVisArea(const Rectangle& rVisArea)
93*cdf0e10cSrcweir 				 { maVisArea = rVisArea; }
94*cdf0e10cSrcweir 	const Rectangle GetVisArea() { return maVisArea; }
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir 	void SetPageKind(PageKind eKind) { mePageKind = eKind; }
97*cdf0e10cSrcweir 	PageKind GetPageKind() const { return mePageKind; }
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir 	/** is used in FrameView::ReadUserDataSequence() only to store the
100*cdf0e10cSrcweir 		page kind that was selected while last saving this document */
101*cdf0e10cSrcweir 	void SetPageKindOnLoad(PageKind eKind) { mePageKindOnLoad = eKind; }
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir 	/** can be used to get the page kind that was selected on last save of this document */
104*cdf0e10cSrcweir 	PageKind GetPageKindOnLoad() const { return mePageKindOnLoad; }
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir 	SD_DLLPUBLIC void SetSelectedPage (sal_uInt16 nPage);
107*cdf0e10cSrcweir 	sal_uInt16 GetSelectedPage () const;
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir 	/** is used in FrameView::ReadUserDataSequence() only to store the
110*cdf0e10cSrcweir 		page that was selected while last saving this document */
111*cdf0e10cSrcweir 	void SetSelectedPageOnLoad (sal_uInt16 nPage) { mnSelectedPageOnLoad = nPage; }
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir 	/** can be used to get the page that was selected on last save of this document */
114*cdf0e10cSrcweir 	sal_uInt16 GetSelectedPageOnLoad () const { return mnSelectedPageOnLoad; }
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir 	SD_DLLPUBLIC void SetViewShEditMode(EditMode eMode, PageKind eKind);
117*cdf0e10cSrcweir 	EditMode GetViewShEditMode (PageKind eKind);
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir     /** Remember the edit mode of the main view shell at the time when the
120*cdf0e10cSrcweir         document is loaded.
121*cdf0e10cSrcweir     */
122*cdf0e10cSrcweir 	void SetViewShEditModeOnLoad (const EditMode eMode);
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir     /** Return the value of the edit mode as it was when the document was
125*cdf0e10cSrcweir         loaded.
126*cdf0e10cSrcweir     */
127*cdf0e10cSrcweir 	EditMode GetViewShEditModeOnLoad (void) const;
128*cdf0e10cSrcweir 
129*cdf0e10cSrcweir 	void SetLayerMode(sal_Bool bMode)
130*cdf0e10cSrcweir 				 { mbLayerMode = bMode; }
131*cdf0e10cSrcweir 	sal_Bool IsLayerMode() const { return mbLayerMode; }
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir 	void SetQuickEdit(sal_Bool bQEdit)
134*cdf0e10cSrcweir 				 { mbQuickEdit = bQEdit; }
135*cdf0e10cSrcweir 	sal_Bool IsQuickEdit() const { return mbQuickEdit; }
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir 	void		SetBigHandles( sal_Bool bOn = sal_True ) { mbBigHandles = bOn; }
138*cdf0e10cSrcweir 	sal_Bool	IsBigHandles() const { return mbBigHandles; }
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir 	void		SetDoubleClickTextEdit( sal_Bool bOn = sal_True ) { mbDoubleClickTextEdit = bOn; }
141*cdf0e10cSrcweir 	sal_Bool	IsDoubleClickTextEdit() const { return mbDoubleClickTextEdit; }
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir 	void		SetClickChangeRotation( sal_Bool bOn = sal_True ) { mbClickChangeRotation = bOn; }
144*cdf0e10cSrcweir 	sal_Bool	IsClickChangeRotation() const { return mbClickChangeRotation; }
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir     /** Remember the type of the view shell that was (or soon will be)
147*cdf0e10cSrcweir         previously associated with this frame view.
148*cdf0e10cSrcweir         @param eType
149*cdf0e10cSrcweir             The type of the previous view shell or ViewShell::ST_NONE to
150*cdf0e10cSrcweir             indicate that there is no previous view shell.
151*cdf0e10cSrcweir     */
152*cdf0e10cSrcweir     void SetPreviousViewShellType (ViewShell::ShellType eType);
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir     /** Return the type of the view shell previously associated with this
155*cdf0e10cSrcweir         frame view.
156*cdf0e10cSrcweir     */
157*cdf0e10cSrcweir     ViewShell::ShellType GetPreviousViewShellType (void) const;
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir     /** Remember the type of the view shell at the time when the document is
160*cdf0e10cSrcweir         loaded or, rather, when the ViewShellBase is constructed.
161*cdf0e10cSrcweir     */
162*cdf0e10cSrcweir     void SetViewShellTypeOnLoad (ViewShell::ShellType eType);
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir     ViewShell::ShellType GetViewShellTypeOnLoad (void) const;
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir 	void SetPresentationViewShellId(sal_uInt16 nId)
167*cdf0e10cSrcweir 				 { mnPresViewShellId = nId; }
168*cdf0e10cSrcweir 	sal_uInt16 GetPresentationViewShellId() const { return mnPresViewShellId; }
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir 	void SetSlotId(sal_uInt16 nId) { mnSlotId = nId; }
171*cdf0e10cSrcweir 	sal_uInt16 GetSlotId() const { return mnSlotId; }
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir 	void SetSlidesPerRow(sal_uInt16 nSlides) { mnSlidesPerRow = nSlides; }
174*cdf0e10cSrcweir 	sal_uInt16 GetSlidesPerRow() const { return mnSlidesPerRow; }
175*cdf0e10cSrcweir 
176*cdf0e10cSrcweir 	void SetDrawMode(sal_uLong nNewDrawMode) { mnDrawMode = nNewDrawMode; };
177*cdf0e10cSrcweir 	sal_uLong GetDrawMode() const { return mnDrawMode; };
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir 	void SetTabCtrlPercent( double nPercent ) { mnTabCtrlPercent = nPercent; }
180*cdf0e10cSrcweir 	double GetTabCtrlPercent() const { return mnTabCtrlPercent; }
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir     void SetIsNavigatorShowingAllShapes (const bool bIsNavigatorShowingAllShapes);
183*cdf0e10cSrcweir     bool IsNavigatorShowingAllShapes (void) const;
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir     virtual void    WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
186*cdf0e10cSrcweir     virtual void    ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = sal_False );
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir private:
189*cdf0e10cSrcweir 	sal_uInt16			mnRefCount;
190*cdf0e10cSrcweir 	VirtualDevice*	mpVDev;
191*cdf0e10cSrcweir 	sal_Bool			mbRuler;
192*cdf0e10cSrcweir 	SetOfByte		maVisibleLayers;
193*cdf0e10cSrcweir 	SetOfByte		maLockedLayers;
194*cdf0e10cSrcweir 	SetOfByte		maPrintableLayers;
195*cdf0e10cSrcweir 	SdrHelpLineList maStandardHelpLines;
196*cdf0e10cSrcweir 	SdrHelpLineList maNotesHelpLines;
197*cdf0e10cSrcweir 	SdrHelpLineList maHandoutHelpLines;
198*cdf0e10cSrcweir 	sal_Bool			mbNoColors;		   // Gliederungsmodus
199*cdf0e10cSrcweir 	sal_Bool			mbNoAttribs; 	   // Gliederungsmodus
200*cdf0e10cSrcweir 	Rectangle		maVisArea;		   // Sichtbarer Bereich
201*cdf0e10cSrcweir 	PageKind		mePageKind;		   // Seitentyp (Standard, Notizen, Handzettel)
202*cdf0e10cSrcweir 	sal_uInt16			mnSelectedPage;	   // Selektierte Seite
203*cdf0e10cSrcweir 	PageKind		mePageKindOnLoad;
204*cdf0e10cSrcweir 	sal_uInt16			mnSelectedPageOnLoad;
205*cdf0e10cSrcweir 	EditMode        meStandardEditMode; // Editmode im Zeichenmodus (Page/MasterPage)
206*cdf0e10cSrcweir 	EditMode        meNotesEditMode;    // Editmode im Notizen-Modus (Page/MasterPage)
207*cdf0e10cSrcweir 	EditMode        meHandoutEditMode;  // Editmode im Handzettel-Modus (Page/MasterPage)
208*cdf0e10cSrcweir 	EditMode        meEditModeOnLoad;
209*cdf0e10cSrcweir 	sal_Bool			mbLayerMode; 	   // Layer an/aus
210*cdf0e10cSrcweir 	sal_Bool			mbQuickEdit; 	   // QuickEdit an/aus
211*cdf0e10cSrcweir 	sal_Bool			mbBigHandles;	   // Grosse Handles
212*cdf0e10cSrcweir 	sal_Bool			mbDoubleClickTextEdit; // Textmodus nach Doppelklick
213*cdf0e10cSrcweir 	sal_Bool			mbClickChangeRotation; // Einfachklick wechselt Selektions-/Rotationsmodus
214*cdf0e10cSrcweir 	sal_uInt16			mnPresViewShellId;  // ViewShell aus der die Pres. gestartet wurde
215*cdf0e10cSrcweir 	sal_uInt16			mnSlotId;		   // SlotId, welche initial ausgefuehrt wird
216*cdf0e10cSrcweir 	sal_uInt16          mnSlidesPerRow;     // Dias pro Reihe auf dem Diatisch
217*cdf0e10cSrcweir 	sal_uLong			mnDrawMode;		   // Drawmode fuer das normale Fenster
218*cdf0e10cSrcweir 	double          mnTabCtrlPercent;
219*cdf0e10cSrcweir     /** Remember whether the navigator shows all shapes (<TRUE/>) or only
220*cdf0e10cSrcweir         the names ones (<FALSE/>).  Not persistent.
221*cdf0e10cSrcweir     */
222*cdf0e10cSrcweir     bool            mbIsNavigatorShowingAllShapes;
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir     /** The type of the previous view shell.  The (default) value
225*cdf0e10cSrcweir         ViewShell::ST_NONE indicates that there was no previous view shell.
226*cdf0e10cSrcweir         Note that this value is used only temporarily and is not saved or
227*cdf0e10cSrcweir         restored.
228*cdf0e10cSrcweir     */
229*cdf0e10cSrcweir     ViewShell::ShellType mePreviousViewShellType;
230*cdf0e10cSrcweir 
231*cdf0e10cSrcweir     ViewShell::ShellType meViewShellTypeOnLoad;
232*cdf0e10cSrcweir };
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir } // end of namespace sd
235*cdf0e10cSrcweir 
236*cdf0e10cSrcweir #endif
237*cdf0e10cSrcweir 
238