LibreOffice Module sw (master)  1
dview.hxx
Go to the documentation of this file.
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 #ifndef INCLUDED_SW_SOURCE_CORE_INC_DVIEW_HXX
20 #define INCLUDED_SW_SOURCE_CORE_INC_DVIEW_HXX
21 
22 #include <svx/fmview.hxx>
23 
24 class FmFormModel;
25 class OutputDevice;
26 class SwViewShellImp;
27 class SwFrame;
28 class SwFlyFrame;
29 class SwAnchoredObject;
30 class SdrUndoManager;
31 
32 class SwDrawView : public FmFormView
33 {
34  Point m_aAnchorPoint; // anchor position
35  SwViewShellImp &m_rImp; // a view is always part of a shell
36 
37  const SwFrame *CalcAnchor();
38 
54  static sal_uInt32 GetMaxChildOrdNum( const SwFlyFrame& _rParentObj,
55  const SdrObject* _pExclChildObj = nullptr );
56 
68  void MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
69  const std::vector<SdrObject*>& _rMovedChildObjs ) const;
70 
71 protected:
72  // add custom handles (used by other apps, e.g. AnchorPos)
73  virtual void AddCustomHdl() override;
74 
75  // override to allow extra handling when picking SwVirtFlyDrawObj's
77  virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, SdrSearchOptions nOptions, const SdrLayerIDSet* pMVisLay) const override;
78 
79  // support enhanced text edit for draw objects
80  virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const override;
81 
82 public:
83  SwDrawView(
84  SwViewShellImp &rI,
85  FmFormModel& rFmFormModel,
86  OutputDevice* pOutDev);
87 
88  // from base class
89  virtual SdrObject* GetMaxToTopObj(SdrObject* pObj) const override;
90  virtual SdrObject* GetMaxToBtmObj(SdrObject* pObj) const override;
91  virtual void MarkListHasChanged() override;
92 
93  // #i7672#
94  // Override to reuse edit background color in active text edit view (OutlinerView)
95  virtual void ModelHasChanged() override;
96 
97  virtual void ObjOrderChanged( SdrObject* pObj, size_t nOldPos,
98  size_t nNewPos ) override;
99  virtual bool TakeDragLimit(SdrDragMode eMode, tools::Rectangle& rRect) const override;
100  virtual void MakeVisible( const tools::Rectangle&, vcl::Window &rWin ) override;
101  virtual void CheckPossibilities() override;
102 
103  const SwViewShellImp &Imp() const { return m_rImp; }
104  SwViewShellImp &Imp() { return m_rImp; }
105 
106  // anchor and Xor for dragging
107  void ShowDragAnchor();
108 
109  virtual void DeleteMarked() override;
110 
112 
113  // #i99665#
114  bool IsAntiAliasing() const;
115 
116  // method to replace marked/selected <SwDrawVirtObj>
117  // by its reference object for delete of selection and group selection
118  static void ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView );
119 
121  SfxViewShell* GetSfxViewShell() const override;
122 };
123 
124 #endif
125 
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:295
bool IsAntiAliasing() const
Definition: dview.cxx:129
static sal_uInt32 GetMaxChildOrdNum(const SwFlyFrame &_rParentObj, const SdrObject *_pExclChildObj=nullptr)
determine maximal order number for a 'child' object of given 'parent' object
Definition: dview.cxx:315
virtual void MakeVisible(const tools::Rectangle &, vcl::Window &rWin) override
Definition: dview.cxx:801
SdrSearchOptions
void FlushComeBackTimer() const
const SwViewShellImp & Imp() const
Definition: dview.hxx:103
virtual SdrObject * GetMaxToTopObj(SdrObject *pObj) const override
Definition: dview.cxx:251
wrapper class for the positioning of Writer fly frames and drawing objects
virtual SdrObject * CheckSingleSdrObjectHit(const Point &rPnt, sal_uInt16 nTol, SdrObject *pObj, SdrPageView *pPV, SdrSearchOptions nOptions, const SdrLayerIDSet *pMVisLay) const override
Definition: dview.cxx:193
SwViewShellImp & Imp()
Definition: dview.hxx:104
virtual SdrObject * CheckSingleSdrObjectHit(const Point &rPnt, sal_uInt16 nTol, SdrObject *pObj, SdrPageView *pPV, SdrSearchOptions nOptions, const SdrLayerIDSet *pMVisLay) const
SfxViewShell * GetSfxViewShell() const override
See SdrMarkView::GetSfxViewShell().
Definition: dview.cxx:942
virtual SdrObject * GetMaxToBtmObj(SdrObject *pObj) const override
Definition: dview.cxx:295
virtual void ObjOrderChanged(SdrObject *pObj, size_t nOldPos, size_t nNewPos) override
Definition: dview.cxx:427
Point m_aAnchorPoint
Definition: dview.hxx:34
virtual void CheckPossibilities() override
Definition: dview.cxx:807
void ShowDragAnchor()
Definition: dview.cxx:749
static void ReplaceMarkedDrawVirtObjs(SdrMarkView &_rMarkView)
replace marked -objects by its reference object for delete marked objects.
Definition: dview.cxx:901
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
SwDrawView(SwViewShellImp &rI, FmFormModel &rFmFormModel, OutputDevice *pOutDev)
Definition: dview.cxx:99
SdrDragMode
SwViewShellImp & m_rImp
Definition: dview.hxx:35
void MoveRepeatedObjs(const SwAnchoredObject &_rMovedAnchoredObj, const std::vector< SdrObject * > &_rMovedChildObjs) const
method to move 'repeated' objects of the given moved object to the according level ...
Definition: dview.cxx:347
void ValidateMarkList()
Definition: dview.hxx:111
virtual void AddCustomHdl() override
Gets called every time the handles need to be build.
Definition: dview.cxx:208
virtual void MarkListHasChanged() override
Definition: dview.cxx:762
const SwFrame * CalcAnchor()
Definition: dview.cxx:670
virtual bool TakeDragLimit(SdrDragMode eMode, tools::Rectangle &rRect) const override
Definition: dview.cxx:652
virtual void DeleteMarked() override
Definition: dview.cxx:947
virtual SdrUndoManager * getSdrUndoManagerForEnhancedTextEdit() const override
Definition: dview.cxx:987
virtual void ModelHasChanged() override
Definition: dview.cxx:769