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