Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SVDPNTV_HXX
30 : : #define _SVDPNTV_HXX
31 : :
32 : : #include <svl/brdcst.hxx>
33 : : #include <svl/lstner.hxx>
34 : : #include <svl/smplhint.hxx>
35 : : #include <svl/undo.hxx>
36 : : #include <svx/svddrag.hxx>
37 : : #include <svx/svdlayer.hxx> // fuer SetOfByte
38 : : #include <vcl/window.hxx>
39 : : #include <svtools/colorcfg.hxx>
40 : : #include <com/sun/star/awt/XControlContainer.hpp>
41 : : #include <svl/itemset.hxx>
42 : : #include <vcl/timer.hxx>
43 : : #include "svx/svxdllapi.h"
44 : : #include <svtools/optionsdrawinglayer.hxx>
45 : : #include <unotools/options.hxx>
46 : :
47 : : //************************************************************
48 : : // Pre-Defines
49 : : //************************************************************
50 : :
51 : : class SdrPageWindow;
52 : :
53 : : namespace com { namespace sun { namespace star { namespace awt {
54 : : class XControlContainer;
55 : : }}}}
56 : :
57 : : class SdrPage;
58 : : class SdrView;
59 : : class SfxItemSet;
60 : : class SfxStyleSheet;
61 : : class SdrOle2Obj;
62 : : class SdrModel;
63 : : class SdrObject;
64 : :
65 : : #ifdef DBG_UTIL
66 : : class SdrItemBrowser;
67 : : #endif
68 : :
69 : : namespace sdr { namespace contact {
70 : : class ViewObjectContactRedirector;
71 : : }}
72 : :
73 : : //************************************************************
74 : : // Defines for AnimationMode
75 : : //************************************************************
76 : :
77 : : enum SdrAnimationMode
78 : : {
79 : : SDR_ANIMATION_ANIMATE,
80 : : SDR_ANIMATION_DONT_ANIMATE,
81 : : SDR_ANIMATION_DISABLE
82 : : };
83 : :
84 : : //************************************************************
85 : : // Typedef's und defines
86 : : //************************************************************
87 : :
88 : : typedef unsigned char TRISTATE;
89 : : #define FUZZY (2)
90 : : #define SDR_ANYFORMAT (0xFFFFFFFF)
91 : : #define SDR_ANYITEM (0xFFFF)
92 : : #define SDRVIEWWIN_NOTFOUND (0xFFFF)
93 : :
94 : :
95 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
96 : : class SdrPaintView;
97 : :
98 : : namespace sdr
99 : : {
100 : : namespace contact
101 : : {
102 : : class ViewObjectContactRedirector;
103 : : } // end of namespace contact
104 : : } // end of namespace sdr
105 : :
106 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
107 : :
108 : :
109 : : class SVX_DLLPUBLIC SvxViewHint : public SfxHint
110 : : {
111 : : public:
112 : : enum HintType { SVX_HINT_VIEWCHANGED };
113 : : TYPEINFO();
114 : : explicit SvxViewHint (HintType eType);
115 : : HintType GetHintType (void) const;
116 : :
117 : : private:
118 : : HintType meHintType;
119 : : };
120 : :
121 : : // typedefs for a list of SdrPaintWindows
122 : : class SdrPaintWindow;
123 : : typedef ::std::vector< SdrPaintWindow* > SdrPaintWindowVector;
124 : :
125 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
126 : :
127 : : class SVX_DLLPUBLIC SdrPaintView : public SfxListener, public SfxRepeatTarget, public SfxBroadcaster, public ::utl::ConfigurationListener
128 : : {
129 : : friend class SdrPageView;
130 : : friend class SdrGrafObj;
131 : :
132 : : SdrPageView* mpPageView;
133 : : protected:
134 : : SdrModel* pMod;
135 : : #ifdef DBG_UTIL
136 : : SdrItemBrowser* pItemBrowser;
137 : : #endif
138 : : const OutputDevice* pActualOutDev; // Nur zum vergleichen
139 : : OutputDevice* pDragWin;
140 : : SfxStyleSheet* pDefaultStyleSheet;
141 : :
142 : : String aAktLayer; // Aktueller Zeichenlayer
143 : : String aMeasureLayer; // Aktueller Layer fuer Bemassung
144 : :
145 : : // Container aPagV; // Liste von SdrPageViews
146 : :
147 : : // All windows this view is displayed on
148 : : SdrPaintWindowVector maPaintWindows;
149 : :
150 : : MapMode aActualMapMode;
151 : : Size aGridBig; // muss dann mal raus
152 : : Size aGridFin; // muss dann mal raus
153 : : SdrDragStat aDragStat;
154 : : Rectangle aMaxWorkArea;
155 : : SfxItemSet aDefaultAttr;
156 : : Timer aComeBackTimer;
157 : :
158 : : SdrAnimationMode eAnimationMode;
159 : :
160 : : sal_uInt16 nHitTolPix;
161 : : sal_uInt16 nMinMovPix;
162 : : sal_uInt16 nHitTolLog;
163 : : sal_uInt16 nMinMovLog;
164 : : sal_uIntPtr nMasterCacheMode;
165 : : sal_uIntPtr nGraphicManagerDrawMode;
166 : :
167 : : // hold an incarnation of Drawinglayer configuration options
168 : : SvtOptionsDrawinglayer maDrawinglayerOpt;
169 : :
170 : : unsigned bPageVisible : 1;
171 : : unsigned bPageBorderVisible : 1;
172 : : unsigned bBordVisible : 1;
173 : : unsigned bGridVisible : 1;
174 : : unsigned bGridFront : 1;
175 : : unsigned bHlplVisible : 1;
176 : : unsigned bHlplFront : 1;
177 : : unsigned bGlueVisible : 1; // Persistent. Klebepunkte anzeigen
178 : : unsigned bGlueVisible2 : 1; // Klebepunkte auch bei GluePointEdit anzeigen
179 : : unsigned bGlueVisible3 : 1; // Klebepunkte auch bei EdgeTool anzeigen
180 : : unsigned bGlueVisible4 : 1; // Klebepunkte anzeigen, wenn 1 Edge markiert
181 : : unsigned bRestoreColors : 1; // Pens und Brushes werden zurueckgesetzt.
182 : : unsigned bSomeObjChgdFlag : 1;
183 : : unsigned bSwapAsynchron : 1;
184 : : unsigned bPrintPreview : 1;
185 : :
186 : : // sal_Bool fuer die Verwaltung des anzuzeigenden Status
187 : : // Gruppe Betreten/Verlassen. Default ist sal_True, wird aber
188 : : // beispielsweise beim Chart auf sal_False gesetzt, da dort
189 : : // die Ghosted-Effekte zur Darstellug unerwuenscht sind.
190 : : unsigned bVisualizeEnteredGroup : 1;
191 : : unsigned bAnimationPause : 1;
192 : :
193 : : // #114898#
194 : : // Flag which decides if buffered output for this view is allowed. When
195 : : // set, PreRendering for PageView rendering will be used. Default is sal_False
196 : : unsigned mbBufferedOutputAllowed : 1;
197 : :
198 : : // #114898#
199 : : // Flag which decides if buffered overlay for this view is allowed. When
200 : : // set, the output will be buffered in an overlay vdev. When not, overlay is
201 : : // directly painted to OutDev. Default is sal_False.
202 : : unsigned mbBufferedOverlayAllowed : 1;
203 : :
204 : : // allow page painting at all?
205 : : unsigned mbPagePaintingAllowed : 1;
206 : :
207 : : // is this a preview renderer?
208 : : unsigned mbPreviewRenderer : 1;
209 : :
210 : : // flags for calc and sw for suppressing OLE, CHART or DRAW objects
211 : : unsigned mbHideOle : 1;
212 : : unsigned mbHideChart : 1;
213 : : unsigned mbHideDraw : 1; // hide draw objects other than form controls
214 : : unsigned mbHideFormControl : 1; // hide form controls only
215 : :
216 : : public:
217 : : // #114898#
218 : : // interface for PagePaintingAllowed flag
219 : : bool IsBufferedOutputAllowed() const;
220 : : void SetBufferedOutputAllowed(bool bNew);
221 : :
222 : : // interface for BufferedOverlayAllowed flag
223 : : bool IsBufferedOverlayAllowed() const;
224 : : void SetBufferedOverlayAllowed(bool bNew);
225 : :
226 : : // allow page painting at all?
227 : : sal_Bool IsPagePaintingAllowed() const;
228 : : void SetPagePaintingAllowed(bool bNew);
229 : :
230 : : protected:
231 : : svtools::ColorConfig maColorConfig;
232 : : Color maGridColor;
233 : :
234 : : // interface to SdrPaintWindow
235 : : protected:
236 : : void AppendPaintWindow(SdrPaintWindow& rNew);
237 : : SdrPaintWindow* RemovePaintWindow(SdrPaintWindow& rOld);
238 : : void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, sal_uInt32 );
239 : :
240 : : public:
241 : 85734 : sal_uInt32 PaintWindowCount() const { return maPaintWindows.size(); }
242 : : SdrPaintWindow* FindPaintWindow(const OutputDevice& rOut) const;
243 : : SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const;
244 : : // replacement for GetWin(0), may return 0L (!)
245 : : OutputDevice* GetFirstOutputDevice() const;
246 : :
247 : : private:
248 : : SVX_DLLPRIVATE void ImpClearVars();
249 : : DECL_LINK(ImpComeBackHdl,void*);
250 : :
251 : : protected:
252 : : sal_uInt16 ImpGetMinMovLogic(short nMinMov, const OutputDevice* pOut) const;
253 : : sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice* pOut) const;
254 : :
255 : : // Wenn man den IdleStatus des Systems nicht abwarten will (auf const geschummelt):
256 : : void FlushComeBackTimer() const;
257 : : void TheresNewMapMode();
258 : : void ImpSetGlueVisible2(bool bOn) { if (bGlueVisible2!=(unsigned)bOn) { bGlueVisible2=bOn; if (!bGlueVisible && !bGlueVisible3 && !bGlueVisible4) GlueInvalidate(); } }
259 : : void ImpSetGlueVisible3(bool bOn) { if (bGlueVisible3!=(unsigned)bOn) { bGlueVisible3=bOn; if (!bGlueVisible && !bGlueVisible2 && !bGlueVisible4) GlueInvalidate(); } }
260 : : void ImpSetGlueVisible4(bool bOn) { if (bGlueVisible4!=(unsigned)bOn) { bGlueVisible4=bOn; if (!bGlueVisible && !bGlueVisible2 && !bGlueVisible3) GlueInvalidate(); } }
261 : : sal_Bool ImpIsGlueVisible2() const { return bGlueVisible2; }
262 : : sal_Bool ImpIsGlueVisible3() const { return bGlueVisible3; }
263 : : sal_Bool ImpIsGlueVisible4() const { return bGlueVisible4; }
264 : :
265 : : public:
266 : : sal_Bool ImpIsGlueVisible() { return bGlueVisible || bGlueVisible2 || bGlueVisible3 || bGlueVisible4; }
267 : : protected:
268 : :
269 : : virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
270 : : void GlueInvalidate() const;
271 : :
272 : : void ShowEncirclement(OutputDevice* pOut);
273 : : void HideEncirclement(OutputDevice* pOut);
274 : : void DrawEncirclement(OutputDevice* pOut) const;
275 : :
276 : : // ModelHasChanged wird gerufen, sobald nach beliebig vielen HINT_OBJCHG
277 : : // das System wieder idle ist (StarView-Timer). Wer diese Methode ueberlaed,
278 : : // muss unbedingt ModelHasChanged() der Basisklasse rufen.
279 : : virtual void ModelHasChanged();
280 : :
281 : : protected:
282 : : // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
283 : : SdrPaintView(SdrModel* pModel1, OutputDevice* pOut = 0L);
284 : : virtual ~SdrPaintView();
285 : :
286 : : public:
287 : : TYPEINFO();
288 : :
289 : : virtual void ClearPageView();
290 : 228036 : SdrModel* GetModel() const { return pMod; }
291 : :
292 : : virtual sal_Bool IsAction() const;
293 : : virtual void MovAction(const Point& rPnt);
294 : : virtual void EndAction();
295 : : virtual void BckAction();
296 : : virtual void BrkAction(); // Alle Actions z.B. Draggen abbrechen.
297 : : virtual void TakeActionRect(Rectangle& rRect) const;
298 : :
299 : : // info about TextEdit. Default is sal_False.
300 : : virtual bool IsTextEdit() const;
301 : :
302 : : // info about TextEditPageView. Default is 0L.
303 : : virtual SdrPageView* GetTextEditPageView() const;
304 : :
305 : : // Muss dann bei jedem Fensterwechsel (wenn die SdrView in mehreren
306 : : // Fenstern gleichzeitig dargestellt wird (->z.B. Splitter)) und bei
307 : : // jedem MapMode(Scaling)-wechsel gerufen werden, damit ich aus meinen
308 : : // Pixelwerten logische Werte berechnen kann.
309 : : void SetActualWin(const OutputDevice* pWin);
310 : 619 : void SetMinMoveDistancePixel(sal_uInt16 nVal) { nMinMovPix=nVal; TheresNewMapMode(); }
311 : 0 : sal_uInt16 GetMinMoveDistancePixel() const { return (sal_uInt16)nMinMovPix; }
312 : 3067 : void SetHitTolerancePixel(sal_uInt16 nVal) { nHitTolPix=nVal; TheresNewMapMode(); }
313 : 371 : sal_uInt16 GetHitTolerancePixel() const { return (sal_uInt16)nHitTolPix; }
314 : :
315 : : // data read access on logic HitTolerance and MinMoveTolerance
316 : 778 : sal_uInt16 getHitTolLog() const { return nHitTolLog; }
317 : : sal_uInt16 getMinMovLog() const { return nMinMovLog; }
318 : :
319 : : // Flag zur Visualisierung von Gruppen abfragen/testen
320 : : sal_Bool DoVisualizeEnteredGroup() const { return bVisualizeEnteredGroup; }
321 : : void SetVisualizeEnteredGroup(sal_Bool bNew) { bVisualizeEnteredGroup = bNew; }
322 : :
323 : : // Am DragStatus laesst sich beispielsweise erfragen, welche
324 : : // entfernung bereits gedraggd wurde, etc.
325 : 0 : const SdrDragStat& GetDragStat() const { return aDragStat; }
326 : :
327 : : // Anmelden/Abmelden einer PageView an der View.
328 : : // Dieselbe // Seite kann nicht mehrfach angemeldet werden.
329 : : // Methoden mit dem Suffix PgNum erwarten als numerischen Parameter
330 : : // eine Seitennummer (0...). Methoden mit dem Suffix PvNum erwarten
331 : : // degagen als numerischen Parameter die Nummer der PageView an der
332 : : // SdrView (Iterieren ueber alle angemeldeten Pages).
333 : : virtual SdrPageView* ShowSdrPage(SdrPage* pPage);
334 : : virtual void HideSdrPage();
335 : :
336 : : // Iterieren ueber alle angemeldeten PageViews
337 : : // sal_uInt16 GetPageViewCount() const { return sal_uInt16(aPagV.Count()); }
338 : : // SdrPageView* GetPageViewByIndex(sal_uInt16 nPvNum) const { return ((SdrPageView*)aPagV.GetObject(nPvNum)); }
339 : 26924 : SdrPageView* GetSdrPageView() const { return mpPageView; }
340 : :
341 : : // Pageview einer bestimmten Seite ermitteln
342 : : // SdrPageView* GetPageViewByPage(const SdrPage* pPage) const;
343 : : // sal_uInt16 GetIndexByPageView(const SdrPageView* pPV) const;
344 : :
345 : : // Test, ob eine Seite getroffen
346 : : // SdrPageView* HitPage(const Point& rPnt) const;
347 : :
348 : : // Die Seite, die dem Punkt am naechsten ist. Liefert nur NULL,
349 : : // wenn absolut keine Seite angemeldet ist.
350 : : // SdrPageView* GetPageViewByPosition(const Point& rPnt) const;
351 : :
352 : : // Eine SdrView kann auf mehreren Fenstern gleichzeitig abgebiltet sein:
353 : : virtual void AddWindowToPaintView(OutputDevice* pNewWin);
354 : : virtual void DeleteWindowFromPaintView(OutputDevice* pOldWin);
355 : :
356 : : void SetLayerVisible(const String& rName, sal_Bool bShow=sal_True);
357 : : bool IsLayerVisible(const String& rName) const;
358 : :
359 : : void SetLayerLocked(const String& rName, sal_Bool bLock=sal_True);
360 : : bool IsLayerLocked(const String& rName) const;
361 : :
362 : : void SetLayerPrintable(const String& rName, sal_Bool bPrn=sal_True);
363 : : bool IsLayerPrintable(const String& rName) const;
364 : :
365 : : // PrePaint call forwarded from app windows
366 : : void PrePaint();
367 : :
368 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
369 : : // used internally for Draw/Impress/sch/chart2
370 : : virtual void CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0);
371 : :
372 : : // #i72889# used from CompleteRedraw() implementation internally, added to be able to do a complete redraw in single steps
373 : : //
374 : : // BeginCompleteRedraw returns (or even creates) a SdrPaintWindow whcih shall then be used as
375 : : // target for paints. Since paints may be buffered, use it's GetTargetOutputDevice() method which will
376 : : // return the buffer in case of bufered.
377 : : // DoCompleteRedraw draws the DrawingLayer hierarchy then.
378 : : // EndCompleteRedraw does the necessary refreshes, evtl. paints text edit and overlay and evtl destroys the
379 : : // SdrPaintWindow again. This means: the SdrPaintWindow is no longer safe after this closing call.
380 : : virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut);
381 : : virtual void DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0);
382 : : virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer);
383 : :
384 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
385 : : // used for the other applications basctl/sc/sw which call DrawLayer at PageViews
386 : : // #i74769# Interface change to use common BeginCompleteRedraw/EndCompleteRedraw
387 : : // #i76114# bDisableIntersect disables intersecting rReg with the Window's paint region
388 : : SdrPaintWindow* BeginDrawLayers(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect = false);
389 : : // used when the region passed to BeginDrawLayers needs to be changed
390 : : void UpdateDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect = false);
391 : : void EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer);
392 : :
393 : : protected:
394 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
395 : : // used to call the old PaintOutlinerView at the single PageViews. Will be replaced when the
396 : : // outliner will be displayed on the overlay in edit mode.
397 : : void ImpTextEditDrawing(SdrPaintWindow& rPaintWindow) const;
398 : :
399 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
400 : : // used to paint the form layer after the PreRender device is flushed (painted) to the window.
401 : : void ImpFormLayerDrawing(SdrPaintWindow& rPaintWindow) const;
402 : :
403 : : Region OptimizeDrawLayersRegion(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect);
404 : :
405 : : public:
406 : : sal_Bool IsPageVisible() const { return bPageVisible; } // Seite (weisse Flaeche) malen oder nicht
407 : : sal_Bool IsPageBorderVisible() const { return bPageBorderVisible; } // Seite (weisse Flaeche) malen oder nicht
408 : : sal_Bool IsBordVisible() const { return bBordVisible; } // Seitenrandlinie malen oder nicht
409 : 17472 : sal_Bool IsGridVisible() const { return bGridVisible; } // Rastergitter malen oder nicht
410 : 2143 : sal_Bool IsGridFront() const { return bGridFront ; } // Rastergitter ueber die Objekte druebermalen oder dahinter
411 : 2175 : sal_Bool IsHlplVisible() const { return bHlplVisible; } // Hilfslinien der Seiten malen oder nicht
412 : 0 : sal_Bool IsHlplFront() const { return bHlplFront ; } // Hilfslinie ueber die Objekte druebermalen oder dahinter
413 : : sal_Bool IsGlueVisible() const { return bGlueVisible; } // Konnektoren der objekte sichtbar oder nicht
414 : : Color GetGridColor() const;
415 : 1745 : void SetPageVisible(bool bOn = true) { bPageVisible=bOn; InvalidateAllWin(); }
416 : 270 : void SetPageBorderVisible(bool bOn = true) { bPageBorderVisible=bOn; InvalidateAllWin(); }
417 : 1615 : void SetBordVisible(bool bOn = true) { bBordVisible=bOn; InvalidateAllWin(); }
418 : 4439 : void SetGridVisible(bool bOn = true) { bGridVisible=bOn; InvalidateAllWin(); }
419 : 1373 : void SetGridFront(bool bOn = true) { bGridFront =bOn; InvalidateAllWin(); }
420 : 2715 : void SetHlplVisible(bool bOn = true) { bHlplVisible=bOn; InvalidateAllWin(); }
421 : 301 : void SetHlplFront(bool bOn = true) { bHlplFront =bOn; InvalidateAllWin(); }
422 [ - + ][ # # ]: 1345 : void SetGlueVisible(bool bOn = true) { if (bGlueVisible!=(unsigned)bOn) { bGlueVisible=bOn; if (!bGlueVisible2 && !bGlueVisible3 && !bGlueVisible4) GlueInvalidate(); } }
[ # # ][ # # ]
423 : : void SetGridColor( Color aColor );
424 : :
425 : : sal_Bool IsPreviewRenderer() const { return (sal_Bool )mbPreviewRenderer; }
426 [ + + ]: 270 : void SetPreviewRenderer(bool bOn) { if((unsigned)bOn != mbPreviewRenderer) { mbPreviewRenderer=bOn; }}
427 : :
428 : : // access methods for calc and sw hide object modes
429 : 264 : bool getHideOle() const { return mbHideOle; }
430 : 0 : bool getHideChart() const { return mbHideChart; }
431 : 0 : bool getHideDraw() const { return mbHideDraw; }
432 : 0 : bool getHideFormControl() const { return mbHideFormControl; }
433 [ - + ]: 2660 : void setHideOle(bool bNew) { if(bNew != (bool)mbHideOle) mbHideOle = bNew; }
434 [ - + ]: 2660 : void setHideChart(bool bNew) { if(bNew != (bool)mbHideChart) mbHideChart = bNew; }
435 [ - + ]: 2660 : void setHideDraw(bool bNew) { if(bNew != (bool)mbHideDraw) mbHideDraw = bNew; }
436 [ - + ]: 2660 : void setHideFormControl(bool bNew) { if(bNew != (bool)mbHideFormControl) mbHideFormControl = bNew; }
437 : :
438 : 3746 : void SetGridCoarse(const Size& rSiz) { aGridBig=rSiz; }
439 [ - + ][ + + ]: 3445 : void SetGridFine(const Size& rSiz) { aGridFin=rSiz; if (aGridFin.Height()==0) aGridFin.Height()=aGridFin.Width(); if (bGridVisible) InvalidateAllWin(); } // #40479#
440 : 2673 : const Size& GetGridCoarse() const { return aGridBig; }
441 : 2673 : const Size& GetGridFine() const { return aGridFin; }
442 : :
443 : : void InvalidateAllWin();
444 : : void InvalidateAllWin(const Rectangle& rRect, sal_Bool bPlus1Pix=sal_False);
445 : :
446 : : // Wenn die View kein Invalidate() an den Fenstern durchfuehren soll, muss
447 : : // man diese beiden folgenden Methoden ueberladen und entsprechend anders
448 : : // reagieren.
449 : : virtual void InvalidateOneWin(Window& rWin);
450 : : virtual void InvalidateOneWin(Window& rWin, const Rectangle& rRect);
451 : :
452 : : void SetActiveLayer(const String& rName) { aAktLayer=rName; }
453 : : const String& GetActiveLayer() const { return aAktLayer; }
454 : :
455 : : // Verlassen einer betretenen Objektgruppe aller sichtbaren Seiten.
456 : : // (wie MsDos chdir ..)
457 : : void LeaveOneGroup();
458 : :
459 : : // Verlassen aller betretenen Objektgruppen aller sichtbaren Seiten.
460 : : // (wie MsDos chdir \)
461 : : void LeaveAllGroup();
462 : :
463 : : // Feststellen, ob Leave sinnvoll ist.
464 : : bool IsGroupEntered() const;
465 : :
466 : : // DefaultAttribute an der View: Neu erzeugte Objekte bekommen diese
467 : : // Attribute direkt nach dem Erzeugen erstmal zugewiesen.
468 : : void SetDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll);
469 : 0 : const SfxItemSet& GetDefaultAttr() const { return aDefaultAttr; }
470 : : void SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
471 : : SfxStyleSheet* GetDefaultStyleSheet() const { return pDefaultStyleSheet; }
472 : :
473 : : void SetNotPersistDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll);
474 : : void MergeNotPersistDefaultAttr(SfxItemSet& rAttr, sal_Bool bOnlyHardAttr) const;
475 : :
476 : : // use this mode as mode to draw all internal GraphicManager objects with
477 : : sal_uIntPtr GetGraphicManagerDrawMode() const { return nGraphicManagerDrawMode; }
478 : : void SetGraphicManagerDrawMode( sal_uIntPtr nMode ) { nGraphicManagerDrawMode = nMode; }
479 : :
480 : : // SwapIn (z.B. von Grafiken) asynchron durchfuehren. Also nicht
481 : : // beim Paint sofort nachladen, sondern dort das Nachladen anstossen.
482 : : // Nach Abschluss des Nachladens wird das Objekt dann angezeigt.
483 : : // Hat nur z.Zt. Wirkung, wenn SwapGraphics am Model eingeschaltet ist.
484 : : // Default=FALSE. Flag ist nicht persistent.
485 : : sal_Bool IsSwapAsynchron() const { return bSwapAsynchron; }
486 : 1696 : void SetSwapAsynchron(sal_Bool bJa=sal_True) { bSwapAsynchron=bJa; }
487 : : virtual sal_Bool KeyInput(const KeyEvent& rKEvt, Window* pWin);
488 : :
489 : : virtual sal_Bool MouseButtonDown(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; }
490 : : virtual sal_Bool MouseButtonUp(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; }
491 : : virtual sal_Bool MouseMove(const MouseEvent& /*rMEvt*/, Window* /*pWin*/) { return sal_False; }
492 : : virtual sal_Bool Command(const CommandEvent& /*rCEvt*/, Window* /*pWin*/) { return sal_False; }
493 : : sal_Bool Cut(sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; }
494 : : sal_Bool Yank(sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; }
495 : : sal_Bool Paste(Window* /*pWin*/=NULL, sal_uIntPtr /*nFormat*/=SDR_ANYFORMAT) { return sal_False; }
496 : :
497 : : /* new interface src537 */
498 : : sal_Bool GetAttributes(SfxItemSet& rTargetSet, sal_Bool bOnlyHardAttr=sal_False) const;
499 : :
500 : : sal_Bool SetAttributes(const SfxItemSet& rSet, sal_Bool bReplaceAll);
501 : : SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(sal_Bool& rOk) const;
502 : : sal_Bool SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDontRemoveHardAttr);
503 : :
504 : : virtual void MakeVisible(const Rectangle& rRect, Window& rWin);
505 : :
506 : : // Fuer PlugIn. Wird vom Paint des OLE-Obj gerufen.
507 : : virtual void DoConnect(SdrOle2Obj* pOleObj);
508 : :
509 : : // Animation aktivieren/deaktivieren fuer ::Paint
510 : : // wird z.Zt. ausgewertet von SdrGrafObj, wenn in dem eine Animation steckt
511 : : // Das Unterbinden der automatischen Animation wird z.B. fuer die Dia-Show benoetigt
512 : 1315 : sal_Bool IsAnimationEnabled() const { return ( SDR_ANIMATION_ANIMATE == eAnimationMode ); }
513 : : void SetAnimationEnabled( sal_Bool bEnable=sal_True );
514 : :
515 : : // set/unset pause state for animations
516 : : bool IsAnimationPause() const { return bAnimationPause; }
517 : : void SetAnimationPause( bool bSet );
518 : :
519 : : // Verhalten beim Starten von Animation im Paint-Handler:
520 : : // 1. Animation normal starten( SDR_ANIMATION_ANIMATE ) => DEFAULT
521 : : // 2. Nur die Ersatzdarstellung der Animation zeichnen ( SDR_ANIMATION_DONT_ANIMATE )
522 : : // 3. Nicht starten und nichts ersatzweise ausgeben ( SDR_ANIMATION_DISABLE )
523 : : void SetAnimationMode( const SdrAnimationMode eMode );
524 : : SdrAnimationMode GetAnimationMode() const { return eAnimationMode; }
525 : :
526 : : // bei bShow=sal_False wird der Browser destruiert
527 : : #ifdef DBG_UTIL
528 : : void ShowItemBrowser(sal_Bool bShow=sal_True);
529 : : sal_Bool IsItemBrowserVisible() const { return pItemBrowser!=NULL && ((Window*)pItemBrowser)->IsVisible(); }
530 : : Window* GetItemBrowser() const { return (Window*)pItemBrowser; }
531 : : #endif
532 : :
533 : : // Muss von App beim Scrollen usw. gerufen werden, damit ein u.U.
534 : : // aktives FormularControl mitverschoben werden kann
535 : : void VisAreaChanged(const OutputDevice* pOut=NULL);
536 : : void VisAreaChanged(const SdrPageWindow& rWindow);
537 : :
538 : : sal_Bool IsPrintPreview() const { return bPrintPreview; }
539 : 1357 : void SetPrintPreview(bool bOn = true) { bPrintPreview=bOn; }
540 : :
541 : : virtual void onChangeColorConfig();
542 : :
543 : : // #103834# Set background color for svx at SdrPageViews
544 : : void SetApplicationBackgroundColor(Color aBackgroundColor);
545 : :
546 : : // #103911# Set document color for svx at SdrPageViews
547 : : void SetApplicationDocumentColor(Color aDocumentColor);
548 : :
549 : : // #i38135#
550 : : // Sets the timer for Object animations and restarts.
551 : : void SetAnimationTimer(sal_uInt32 nTime);
552 : :
553 : : // access to Drawinglayer configuration options
554 : 4438 : const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
555 : : };
556 : :
557 : : #endif //_SVDPNTV_HXX
558 : :
559 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|