Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/svx/svdpntv.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#pragma once
21
22
#include <svl/SfxBroadcaster.hxx>
23
#include <svl/lstner.hxx>
24
#include <svl/undo.hxx>
25
#include <svx/svddrag.hxx>
26
#include <svx/svdlayer.hxx>
27
#include <svtools/colorcfg.hxx>
28
#include <svl/itemset.hxx>
29
#include <svx/svxdllapi.h>
30
#include <unotools/options.hxx>
31
#include <vcl/event.hxx>
32
#include <vcl/idle.hxx>
33
#include <vcl/timer.hxx>
34
#include <memory>
35
36
37
// Pre defines
38
namespace sdr::overlay { class OverlayManager; }
39
40
class SdrPage;
41
class SfxStyleSheet;
42
class SdrOle2Obj;
43
class SdrModel;
44
45
// Defines for AnimationMode
46
enum class SdrAnimationMode
47
{
48
    Animate,
49
    Disable
50
};
51
52
namespace sdr::contact { class ViewObjectContactRedirector; }
53
54
namespace vcl {
55
    class Window;
56
}
57
58
59
class SvxViewChangedHint final : public SfxHint
60
{
61
public:
62
    explicit SvxViewChangedHint();
63
};
64
65
class SdrPaintWindow;
66
67
/**
68
 * Helper to convert any GDIMetaFile to a good quality Bitmap,
69
 * using default parameters and graphic::XPrimitive2DRenderer
70
 */
71
Bitmap convertMetafileToBitmap(
72
    const GDIMetaFile& rMtf,
73
    const basegfx::B2DRange& rTargetRange,
74
    const sal_uInt32 nMaximumQuadraticPixels);
75
76
////////////////////////////////////////////////////////////////////////////////////////////////////
77
//
78
//  SdrPaintView
79
//      SdrSnapView
80
//          SdrMarkView
81
//              SdrEditView
82
//                  SdrPolyEditView
83
//                      SdrGlueEditView
84
//                          SdrObjEditView
85
//                              SdrExchangeView
86
//                                  SdrDragView
87
//                                      SdrCreateView
88
//                                          SdrView
89
//                                              DlgEdView
90
//                                              GraphCtrlView
91
//                                              E3dView
92
//                                                  DrawViewWrapper
93
//                                                  FmFormView
94
//                                                      ScDrawView
95
//                                                      sd::View (may have more?)
96
//                                                          sd::DrawView
97
//                                                      SwDrawView
98
//                                              OSectionView
99
100
class SVXCORE_DLLPUBLIC SdrPaintView : public SfxListener, public SfxRepeatTarget, public SfxBroadcaster, public ::utl::ConfigurationListener
101
{
102
private:
103
    friend class SdrPageView;
104
    friend class SdrGrafObj;
105
106
    // the SdrModel this view was created with, unchanged during lifetime
107
    SdrModel& mrModel;
108
109
    std::unique_ptr<SdrPageView> mpPageView;
110
protected:
111
    VclPtr<OutputDevice> mpActualOutDev; // Only for comparison
112
    VclPtr<OutputDevice> mpDragWin;
113
    SfxStyleSheet* mpDefaultStyleSheet;
114
115
    OUString maActualLayer;     // Current drawing layer
116
    OUString maMeasureLayer; // Current layer for measurements
117
118
//  Container                   aPagV;         // List of SdrPageViews
119
120
    // All windows this view is displayed on
121
    std::vector<std::unique_ptr<SdrPaintWindow>>  maPaintWindows;
122
123
    Size maGridBig; // FIXME: We need to get rid of this eventually
124
    Size maGridFin; // FIXME: We need to get rid of this eventually
125
    SdrDragStat maDragStat;
126
    tools::Rectangle maMaxWorkArea;
127
    SfxItemSet maDefaultAttr;
128
    Idle maComeBackIdle;
129
130
    SdrAnimationMode meAnimationMode;
131
132
    sal_uInt16 mnHitTolPix;
133
    sal_uInt16 mnMinMovPix;
134
    sal_uInt16 mnHitTolLog;
135
    sal_uInt16 mnMinMovLog;
136
137
    bool mbPageVisible : 1;
138
    bool mbPageShadowVisible : 1;
139
    bool mbPageBorderVisible : 1;
140
    bool mbBordVisible : 1;
141
    bool mbGridVisible : 1;
142
    bool mbGridFront : 1;
143
    bool mbHlplVisible : 1;
144
    bool mbHlplFront : 1;
145
    bool mbGlueVisible : 1;    // Persistent; show gluepoints
146
    bool mbGlueVisible2 : 1;   // Also show gluepoints for GluePointEdit
147
    bool mbGlueVisible3 : 1;   // Also show gluepoints for EdgeTool
148
    bool mbGlueVisible4 : 1;   // Show gluepoints, if one edge is selected
149
    bool mbSomeObjChgdFlag : 1;
150
    bool mbSwapAsynchron : 1;
151
    bool mbPrintPreview : 1;
152
153
    // These bools manage, the status that is displayed
154
    //
155
    bool mbAnimationPause : 1;
156
157
    // Flag which decides if buffered output for this view is allowed. When
158
    // set, PreRendering for PageView rendering will be used. Default is sal_False
159
    bool mbBufferedOutputAllowed : 1;
160
161
    // Flag which decides if buffered overlay for this view is allowed. When
162
    // set, the output will be buffered in an overlay vdev. When not, overlay is
163
    // directly painted to OutDev. Default is sal_False.
164
    bool mbBufferedOverlayAllowed : 1;
165
166
    // Allow page decorations? Quick way to switch on/off all of page's decoration features,
167
    // in addition to the more fine-granular other view settings (see *visible bools above).
168
    // Default is true.
169
    // This controls processing of the hierarchy elements:
170
    // -ViewContactOfPageBackground: formally known as 'Wiese', the area behind the page
171
    // -ViewContactOfPageShadow: page's shadow
172
    // -ViewContactOfPageFill: the page's fill with PageColor/PaperColor
173
    //   (MasterPage content here, not affected by this flag)
174
    // -ViewContactOfOuterPageBorder: the border around the page
175
    // -ViewContactOfInnerPageBorder: The border inside the page, moved inside by PageBorder distances
176
    // -ViewContactOfGrid: the page's grid visualisation (background)
177
    // -ViewContactOfHelplines: the page's Helplines (background)
178
    //   (Page content here, not affected by this flag)
179
    // -ViewContactOfGrid: the page's grid visualisation (foreground)
180
    // -ViewContactOfHelplines: the page's Helplines (foreground)
181
    // Note: background/foreground means that one is active, grid & helplines can be displayed in
182
    //       front of or behind object visualisations/page content
183
    bool mbPageDecorationAllowed : 1;
184
185
    // Allow MasterPage visualization, default is true
186
    bool mbMasterPageVisualizationAllowed : 1;
187
188
    // Is this a preview renderer?
189
    bool mbPreviewRenderer : 1;
190
191
    // Flags for calc and sw for suppressing OLE, CHART or DRAW objects
192
    bool mbHideOle : 1;
193
    bool mbHideChart : 1;
194
    bool mbHideDraw : 1; // hide draw objects other than form controls
195
    bool mbHideFormControl : 1; // hide form controls only
196
    bool mbHideBackground : 1; // don't draw the (page's or master page's) background
197
    bool mbPaintTextEdit : 1; // if should paint currently edited text
198
199
public:
200
    // Interface for BufferedOoutputAllowed flag
201
    bool IsBufferedOutputAllowed() const;
202
    void SetBufferedOutputAllowed(bool bNew);
203
204
    // Interface for BufferedOverlayAllowed flag
205
    bool IsBufferedOverlayAllowed() const;
206
    void SetBufferedOverlayAllowed(bool bNew);
207
208
    // Allow page decorations? See details above at mbPageDecorationAllowed declaration
209
175k
    bool IsPageDecorationAllowed() const { return mbPageDecorationAllowed;}
210
    void SetPageDecorationAllowed(bool bNew);
211
212
    // Allow MasterPage visualization, default is true
213
167k
    bool IsMasterPageVisualizationAllowed() const { return mbMasterPageVisualizationAllowed;}
214
    void SetMasterPageVisualizationAllowed(bool bNew);
215
216
    virtual rtl::Reference<sdr::overlay::OverlayManager> CreateOverlayManager(OutputDevice& rDevice) const;
217
218
protected:
219
    svtools::ColorConfig maColorConfig;
220
    Color maGridColor;
221
222
    // Interface to SdrPaintWindow
223
    void DeletePaintWindow(const SdrPaintWindow& rOld);
224
    void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, ConfigurationHints ) override;
225
    static void InitOverlayManager(const rtl::Reference<sdr::overlay::OverlayManager> & xOverlayManager);
226
227
public:
228
848k
    sal_uInt32 PaintWindowCount() const { return maPaintWindows.size(); }
229
    SdrPaintWindow* FindPaintWindow(const OutputDevice& rOut) const;
230
    SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const;
231
    // Replacement for GetWin(0), may return 0L (!)
232
    OutputDevice* GetFirstOutputDevice() const;
233
0
    const Idle& GetComeBackIdle() const { return maComeBackIdle; };
234
235
private:
236
    DECL_DLLPRIVATE_LINK(ImpComeBackHdl, Timer*, void);
237
238
protected:
239
    sal_uInt16 ImpGetMinMovLogic(short nMinMov, const OutputDevice* pOut) const;
240
    sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice* pOut) const;
241
242
    // If one does not want to wait for the IdleState of the system (cheated as const)
243
    void FlushComeBackTimer() const;
244
    void TheresNewMapMode();
245
0
    void ImpSetGlueVisible2(bool bOn) { if (mbGlueVisible2!=bOn) { mbGlueVisible2=bOn; if (!mbGlueVisible && !mbGlueVisible3 && !mbGlueVisible4) GlueInvalidate(); } }
246
0
    void ImpSetGlueVisible3(bool bOn) { if (mbGlueVisible3!=bOn) { mbGlueVisible3=bOn; if (!mbGlueVisible && !mbGlueVisible2 && !mbGlueVisible4) GlueInvalidate(); } }
247
67.3k
    void ImpSetGlueVisible4(bool bOn) { if (mbGlueVisible4!=bOn) { mbGlueVisible4=bOn; if (!mbGlueVisible && !mbGlueVisible2 && !mbGlueVisible3) GlueInvalidate(); } }
248
249
public:
250
554
    bool ImpIsGlueVisible() const { return mbGlueVisible || mbGlueVisible2 || mbGlueVisible3 || mbGlueVisible4; }
251
252
protected:
253
    virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
254
    void GlueInvalidate() const;
255
256
    // ModelHasChanged is called, as soon as the system is idle again after many SdrHintKind::ObjectChange.
257
    //
258
    // Any sub-class override this method, MUST call the base class' ModelHasChanged() method
259
    virtual void ModelHasChanged();
260
261
    // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
262
    // A SdrView always needs a SdrModel for lifetime (Pool, ...)
263
    SdrPaintView(SdrModel& rSdrModel, OutputDevice* pOut);
264
    virtual ~SdrPaintView() override;
265
266
public:
267
    // SdrModel access on SdrView level
268
0
    SdrModel& getSdrModelFromSdrView() const { return mrModel; }
269
270
1.49M
    SdrModel& GetModel() const { return mrModel; }
271
272
    virtual void ClearPageView();
273
274
    virtual bool IsAction() const;
275
    virtual void MovAction(const Point& rPnt);
276
    virtual void EndAction();
277
    virtual void BckAction();
278
    virtual void BrkAction(); // Cancel all Actions (e.g. cancel dragging)
279
    virtual void TakeActionRect(tools::Rectangle& rRect) const;
280
281
    // Info about TextEdit. Default is sal_False.
282
    virtual bool IsTextEdit() const;
283
284
    // Must be called for every Window change as well as MapMode (Scaling) change:
285
    // If the SdrView is shown in multiple windows at the same time (e.g.
286
    // using the split pane), so that I can convert my pixel values to logical
287
    // values.
288
    void SetActualWin(const OutputDevice* pWin);
289
0
    void SetMinMoveDistancePixel(sal_uInt16 nVal) { mnMinMovPix=nVal; TheresNewMapMode(); }
290
58.7k
    void SetHitTolerancePixel(sal_uInt16 nVal) { mnHitTolPix=nVal; TheresNewMapMode(); }
291
0
    sal_uInt16 GetHitTolerancePixel() const { return mnHitTolPix; }
292
293
    // Data read access on logic HitTolerance and MinMoveTolerance
294
0
    sal_uInt16 getHitTolLog() const { return mnHitTolLog; }
295
296
    // Using the DragState we can tell e.g. which distance was
297
    // already dragged
298
0
    const SdrDragStat& GetDragStat() const { return maDragStat; }
299
300
    // Registering/de-registering a PageView at a View
301
    //
302
    // The same Page cannot be registered multiple times.
303
    //
304
    // Methods ending in PgNum expect being passed a Page number.
305
    // Methods ending in PvNum, instead, expect the number of the
306
    // PageView at the SdrView (iterating over all registered Pages).
307
    virtual SdrPageView* ShowSdrPage(SdrPage* pPage);
308
    virtual void HideSdrPage();
309
310
    // Iterate over all registered PageViews
311
874k
    SdrPageView* GetSdrPageView() const { return mpPageView.get(); }
312
313
    // A SdrView can be output to multiple devices at the same time
314
    virtual void AddDeviceToPaintView(OutputDevice& rNewDev);
315
    virtual void DeleteDeviceFromPaintView(OutputDevice& rOldDev);
316
317
    void SetLayerVisible(const OUString& rName, bool bShow);
318
    bool IsLayerVisible(const OUString& rName) const;
319
320
    void SetLayerLocked(const OUString& rName, bool bLock=true);
321
    bool IsLayerLocked(const OUString& rName) const;
322
323
    void SetLayerPrintable(const OUString& rName, bool bPrn);
324
    bool IsLayerPrintable(const OUString& rName) const;
325
326
    // PrePaint call forwarded from app windows
327
    void PrePaint();
328
329
330
    // Used internally for Draw/Impress/sch/chart2
331
    virtual void CompleteRedraw(OutputDevice* pOut, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr);
332
333
    // #i72889# used from CompleteRedraw() implementation internally, added to be able to do a complete redraw in single steps
334
335
    // BeginCompleteRedraw returns (or even creates) a SdrPaintWindow which will then be used as the
336
    // target for paints. Since paints may be buffered, use its GetTargetOutputDevice() method which will
337
    // return the buffer in case it's buffered.
338
    //
339
    // DoCompleteRedraw then draws the DrawingLayer hierarchy
340
    // EndCompleteRedraw does the necessary refreshes, paints text edit and overlay as well as destroys the
341
    // SdrPaintWindow again, if needed.
342
    // This means: the SdrPaintWindow is no longer safe after this closing call.
343
    virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut);
344
    void DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr);
345
    virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer,
346
        sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr);
347
348
349
    // Used for the other applications basctl/sc/sw which call DrawLayer at PageViews
350
    // #i74769# Interface change to use common BeginCompleteRedraw/EndCompleteRedraw
351
    // #i76114# bDisableIntersect disables intersecting rReg with the Window's paint region
352
    SdrPaintWindow* BeginDrawLayers(OutputDevice* pOut, const vcl::Region& rReg, bool bDisableIntersect = false);
353
354
    // Used when the region passed to BeginDrawLayers needs to be changed
355
    void UpdateDrawLayersRegion(const OutputDevice* pOut, const vcl::Region& rReg);
356
    void EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer,
357
        sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr);
358
359
protected:
360
361
    // Used to paint the form layer after the PreRender device is flushed (painted) to the window.
362
    void ImpFormLayerDrawing( SdrPaintWindow& rPaintWindow,
363
        sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr );
364
365
    static vcl::Region OptimizeDrawLayersRegion(const OutputDevice* pOut, const vcl::Region& rReg, bool bDisableIntersect);
366
367
public:
368
    /// Draw Page as a white area or not
369
0
    bool IsPageVisible() const { return mbPageVisible; }
370
371
    /// Draw Page shadow or not
372
0
    bool IsPageShadowVisible() const { return mbPageShadowVisible; }
373
374
    /// Draw Page as a white area or not
375
0
    bool IsPageBorderVisible() const { return mbPageBorderVisible; }
376
377
    /// Draw Border line or not
378
0
    bool IsBordVisible() const { return mbBordVisible; }
379
380
    /// Draw Grid or not
381
6.83k
    bool IsGridVisible() const { return mbGridVisible; }
382
383
    /// Draw Grid in front of objects or behind them
384
5
    bool IsGridFront() const { return mbGridFront  ; }
385
386
    /// Draw Help line of the Page or not
387
5
    bool IsHlplVisible() const { return mbHlplVisible; }
388
389
    /// Draw Help line in front of the objects or behind them
390
0
    bool IsHlplFront() const { return mbHlplFront  ; }
391
392
0
    const Color& GetGridColor() const { return maGridColor;}
393
    void SetPageVisible(bool bOn = true)
394
58.7k
    {
395
58.7k
        if (mbPageVisible != bOn)
396
58.7k
        {
397
58.7k
            mbPageVisible = bOn;
398
58.7k
            InvalidateAllWin();
399
58.7k
        }
400
58.7k
    }
401
    void SetPageShadowVisible(bool bOn)
402
0
    {
403
0
        if (mbPageShadowVisible != bOn)
404
0
        {
405
0
            mbPageShadowVisible = bOn;
406
0
            InvalidateAllWin();
407
0
        }
408
0
    }
409
    void SetPageBorderVisible(bool bOn = true)
410
0
    {
411
0
        if (mbPageBorderVisible != bOn)
412
0
        {
413
0
            mbPageBorderVisible = bOn;
414
0
            InvalidateAllWin();
415
0
        }
416
0
    }
417
    void SetBordVisible(bool bOn = true)
418
58.7k
    {
419
58.7k
        if (mbBordVisible != bOn)
420
58.7k
        {
421
58.7k
            mbBordVisible = bOn;
422
58.7k
            InvalidateAllWin();
423
58.7k
        }
424
58.7k
    }
425
    void SetGridVisible(bool bOn)
426
126k
    {
427
126k
        if (mbGridVisible != bOn)
428
67.4k
        {
429
67.4k
            mbGridVisible = bOn;
430
67.4k
            InvalidateAllWin();
431
67.4k
        }
432
126k
    }
433
    void SetGridFront(bool bOn)
434
9.12k
    {
435
9.12k
        if (mbGridFront != bOn)
436
138
        {
437
138
            mbGridFront = bOn;
438
138
            InvalidateAllWin();
439
138
        }
440
9.12k
    }
441
    void SetHlplVisible(bool bOn = true)
442
67.3k
    {
443
67.3k
        if (mbHlplVisible != bOn)
444
67.3k
        {
445
67.3k
            mbHlplVisible = bOn;
446
67.3k
            InvalidateAllWin();
447
67.3k
        }
448
67.3k
    }
449
    void SetHlplFront(bool bOn)
450
8.56k
    {
451
8.56k
        if (mbHlplFront != bOn)
452
8.56k
        {
453
8.56k
            mbHlplFront = bOn;
454
8.56k
            InvalidateAllWin();
455
8.56k
        }
456
8.56k
    }
457
58.7k
    void SetGlueVisible(bool bOn = true) { if (mbGlueVisible!=bOn) { mbGlueVisible=bOn; if (!mbGlueVisible2 && !mbGlueVisible3 && !mbGlueVisible4) GlueInvalidate(); } }
458
459
55.4k
    bool IsPreviewRenderer() const { return mbPreviewRenderer; }
460
0
    void SetPreviewRenderer(bool bOn) { mbPreviewRenderer=bOn; }
461
462
    // Access methods for calc and sw hide object modes
463
16.0k
    bool getHideOle() const { return mbHideOle; }
464
16.0k
    bool getHideChart() const { return mbHideChart; }
465
16.0k
    bool getHideDraw() const { return mbHideDraw; }
466
16.0k
    bool getHideFormControl() const { return mbHideFormControl; }
467
0
    bool getHideBackground() const { return mbHideBackground; }
468
469
0
    void setHideOle(bool bNew) { if(bNew != mbHideOle) mbHideOle = bNew; }
470
0
    void setHideChart(bool bNew) { if(bNew != mbHideChart) mbHideChart = bNew; }
471
0
    void setHideDraw(bool bNew) { if(bNew != mbHideDraw) mbHideDraw = bNew; }
472
0
    void setHideFormControl(bool bNew) { if(bNew != mbHideFormControl) mbHideFormControl = bNew; }
473
0
    void setHideBackground(bool bNew) { mbHideBackground = bNew; }
474
475
83.4k
    void SetGridCoarse(const Size& rSiz) { maGridBig=rSiz; }
476
74.7k
    void SetGridFine(const Size& rSiz) {
477
74.7k
        maGridFin=rSiz;
478
74.7k
        if (maGridFin.Height()==0) maGridFin.setHeight(maGridFin.Width());
479
74.7k
        if (mbGridVisible) InvalidateAllWin();
480
74.7k
    }
481
729
    const Size& GetGridCoarse() const { return maGridBig; }
482
616
    const Size& GetGridFine() const { return maGridFin; }
483
484
    void InvalidateAllWin();
485
    void InvalidateAllWin(const tools::Rectangle& rRect);
486
487
    /// If the View should not call Invalidate() on the windows, override
488
    /// the following 2 methods and do something else.
489
    virtual void InvalidateOneWin(OutputDevice& rWin);
490
    virtual void InvalidateOneWin(OutputDevice& rWin, const tools::Rectangle& rRect);
491
492
67.3k
    void SetActiveLayer(const OUString& rName) { maActualLayer=rName; }
493
5
    const OUString&  GetActiveLayer() const { return maActualLayer; }
494
495
    /// Leave an object group of all visible Pages (like `chdir ..` in MS-DOS)
496
    void LeaveOneGroup();
497
498
    /// Leave all entered object groups of all visible Pages (like `chdir \` in MS-DOS)
499
    void LeaveAllGroup();
500
501
    /// Determine, whether Leave is useful or not
502
    bool IsGroupEntered() const;
503
504
    /// Default attributes at the View
505
    /// Newly created objects are assigned these attributes by default when they are created.
506
    void SetDefaultAttr(const SfxItemSet& rAttr, bool bReplaceAll);
507
0
    const SfxItemSet& GetDefaultAttr() const { return maDefaultAttr; }
508
    void SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr);
509
510
    void SetNotPersistDefaultAttr(const SfxItemSet& rAttr);
511
    void MergeNotPersistDefaultAttr(SfxItemSet& rAttr) const;
512
513
    /// Execute a swap-in of e.g. graphics asynchronously.
514
    /// This does not reload all graphics like Paint does, but kicks off
515
    /// the loading there. When such an object is done loading, it is displayed.
516
    /// TODO: Only works at the moment, if SwapGraphics is enabled in the model.
517
    /// The default = false flag is non-persistent
518
0
    bool IsSwapAsynchron() const { return mbSwapAsynchron; }
519
58.7k
    void SetSwapAsynchron(bool bJa=true) { mbSwapAsynchron=bJa; }
520
    virtual bool KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin);
521
522
0
    virtual bool MouseButtonDown(const MouseEvent& /*rMEvt*/, OutputDevice* /*pWin*/) { return false; }
523
0
    virtual bool MouseButtonUp(const MouseEvent& /*rMEvt*/, OutputDevice* /*pWin*/) { return false; }
524
0
    virtual bool MouseMove(const MouseEvent& /*rMEvt*/, OutputDevice* /*pWin*/) { return false; }
525
0
    virtual bool RequestHelp(const HelpEvent& /*rHEvt*/) { return false; }
526
0
    virtual bool Command(const CommandEvent& /*rCEvt*/, vcl::Window* /*pWin*/) { return false; }
527
528
    void GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) const;
529
530
    void SetAttributes(const SfxItemSet& rSet, bool bReplaceAll);
531
    SfxStyleSheet* GetStyleSheet() const; // SfxStyleSheet* GetStyleSheet(bool& rOk) const;
532
    void SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr);
533
534
    virtual void MakeVisible(const tools::Rectangle& rRect, vcl::Window& rWin);
535
536
    /// For Plugins
537
    /// Is called by the Paint of the OLE object
538
    virtual void DoConnect(SdrOle2Obj* pOleObj);
539
540
    /// Enable/disable animations for ::Paint
541
    /// Is used by e.g. SdrGrafObj, if it contains an animation
542
    /// Preventing automatic animation is needed for e.g. the presentation view
543
0
    bool IsAnimationEnabled() const { return ( SdrAnimationMode::Animate == meAnimationMode ); }
544
    void SetAnimationEnabled( bool bEnable=true );
545
546
    /// Set/unset pause state for animations
547
    void SetAnimationPause( bool bSet );
548
549
    /// Mode when starting an animation in the Paint Handler:
550
    /// 1. SdrAnimationMode::Animate (default): start animation normally
551
    /// 2. SDR_ANIMATION_DONT_ANIMATE: only show the replacement picture
552
    /// 3. SdrAnimationMode::Disable: don't start and don't show any replacement
553
    void SetAnimationMode( const SdrAnimationMode eMode );
554
555
    /// Must be called by the App when scrolling etc. in order for
556
    /// an active FormControl to be moved too
557
    void VisAreaChanged(const OutputDevice* pOut);
558
    void VisAreaChanged();
559
560
11
    bool IsPrintPreview() const { return mbPrintPreview; }
561
58.7k
    void SetPrintPreview(bool bOn = true) { mbPrintPreview=bOn; }
562
563
0
    const svtools::ColorConfig& getColorConfig() const { return maColorConfig;}
564
565
    void onChangeColorConfig();
566
567
    // #103834# Set background color for svx at SdrPageViews
568
    void SetApplicationBackgroundColor(Color aBackgroundColor);
569
570
    // #103911# Set document color for svx at SdrPageViews
571
    void SetApplicationDocumentColor(Color aDocumentColor);
572
573
    // #i38135#
574
    // Sets the timer for Object animations and restarts.
575
    void SetAnimationTimer(sal_uInt32 nTime);
576
577
    /// @see vcl::ITiledRenderable::setPaintTextEdit().
578
0
    void SetPaintTextEdit(bool bPaint) { mbPaintTextEdit = bPaint; }
579
};
580
581
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */