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