Line data Source code
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 OutputDevice;
25 : class SwViewImp;
26 : class SwFrm;
27 : class SwFlyFrm;
28 : class SwAnchoredObject;
29 : class SdrUndoManager;
30 :
31 0 : class SwDrawView : public FmFormView
32 : {
33 : Point aAnchorPoint; // anchor position
34 : SwViewImp &rImp; // a view is always part of a shell
35 :
36 : const SwFrm *CalcAnchor();
37 :
38 : /** determine maximal order number for a 'child' object of given 'parent' object
39 :
40 : The maximal order number will be determined on the current object
41 : order hierarchy. It's the order number of the 'child' object with the
42 : highest order number. The calculation can be influenced by parameter
43 : <_pExclChildObj> - this 'child' object won't be considered.
44 :
45 : @param <_rParentObj>
46 : input parameter - 'parent' object, for which the maximal order number
47 : for its 'children' will be determined.
48 :
49 : @param <_pExclChildObj>
50 : optional input parameter - 'child' object, which will not be considered
51 : on the calculation of the maximal order number
52 : */
53 : sal_uInt32 _GetMaxChildOrdNum( const SwFlyFrm& _rParentObj,
54 : const SdrObject* _pExclChildObj = 0L ) const;
55 :
56 : /** method to move 'repeated' objects of the given moved object to the
57 : according level
58 :
59 : @param <_rMovedAnchoredObj>
60 : input parameter - moved object, for which the 'repeated' ones have also
61 : to be moved.
62 :
63 : @param <_rMovedChildrenObjs>
64 : input parameter - data collection of moved 'child' objects - the 'repeated'
65 : ones of these 'children' will also been moved.
66 : */
67 : void _MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
68 : const std::vector<SdrObject*>& _rMovedChildObjs ) const;
69 :
70 : protected:
71 : // add custom handles (used by other apps, e.g. AnchorPos)
72 : virtual void AddCustomHdl() SAL_OVERRIDE;
73 :
74 : // overloaded to allow extra handling when picking SwVirtFlyDrawObj's
75 : using FmFormView::CheckSingleSdrObjectHit;
76 : virtual SdrObject* CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nTol, SdrObject* pObj, SdrPageView* pPV, sal_uLong nOptions, const SetOfByte* pMVisLay) const SAL_OVERRIDE;
77 :
78 : // support enhanced text edit for draw objects
79 : virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const SAL_OVERRIDE;
80 :
81 : public:
82 : SwDrawView( SwViewImp &rI, SdrModel *pMd, OutputDevice* pOutDev=NULL );
83 :
84 : // from base class
85 : virtual SdrObject* GetMaxToTopObj(SdrObject* pObj) const SAL_OVERRIDE;
86 : virtual SdrObject* GetMaxToBtmObj(SdrObject* pObj) const SAL_OVERRIDE;
87 : virtual void MarkListHasChanged() SAL_OVERRIDE;
88 :
89 : // #i7672#
90 : // Overload to resue edit background color in active text edit view (OutlinerView)
91 : virtual void ModelHasChanged() SAL_OVERRIDE;
92 :
93 : virtual void ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
94 : sal_uLong nNewPos ) SAL_OVERRIDE;
95 : virtual bool TakeDragLimit(SdrDragMode eMode, Rectangle& rRect) const SAL_OVERRIDE;
96 : virtual void MakeVisible( const Rectangle&, Window &rWin ) SAL_OVERRIDE;
97 : virtual void CheckPossibilities() SAL_OVERRIDE;
98 :
99 0 : const SwViewImp &Imp() const { return rImp; }
100 0 : SwViewImp &Imp() { return rImp; }
101 :
102 : // anchor and Xor for dragging
103 : void ShowDragAnchor();
104 :
105 : virtual void DeleteMarked() SAL_OVERRIDE;
106 :
107 0 : inline void ValidateMarkList() { FlushComeBackTimer(); }
108 :
109 : // #i99665#
110 : sal_Bool IsAntiAliasing() const;
111 :
112 : // method to replace marked/selected <SwDrawVirtObj>
113 : // by its reference object for delete of selection and group selection
114 : static void ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView );
115 : };
116 :
117 : #endif
118 :
119 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|