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 :
20 : #ifndef _DFLYOBJ_HXX
21 : #define _DFLYOBJ_HXX
22 :
23 : #include <svx/svdovirt.hxx>
24 :
25 : class SwFlyFrm;
26 : class SwFrmFmt;
27 : class SdrObjMacroHitRec;
28 :
29 : const sal_uInt32 SWGInventor = sal_uInt32('S')*0x00000001 +
30 : sal_uInt32('W')*0x00000100 +
31 : sal_uInt32('G')*0x00010000;
32 :
33 : const sal_uInt16 SwFlyDrawObjIdentifier = 0x0001;
34 : const sal_uInt16 SwDrawFirst = 0x0001;
35 :
36 : // DrawObjects for Flys
37 : class SwFlyDrawObj : public SdrObject
38 : {
39 : private:
40 : virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
41 :
42 : protected:
43 : // #i95264# SwFlyDrawObj needs an own VC since createViewIndependentPrimitive2DSequence()
44 : // is called when RecalcBoundRect() is used
45 : virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
46 :
47 : public:
48 : TYPEINFO();
49 :
50 : SwFlyDrawObj();
51 : ~SwFlyDrawObj();
52 :
53 : // for instantiation of this class while loading (via factory)
54 : virtual sal_uInt32 GetObjInventor() const;
55 : virtual sal_uInt16 GetObjIdentifier() const;
56 : virtual sal_uInt16 GetObjVersion() const;
57 : };
58 :
59 : // virtual objects for Flys
60 : // Flys will always be shown with virtual objects. By doing that, they can be
61 : // shown multiple times if needed (header/footer).
62 : class SwVirtFlyDrawObj : public SdrVirtObj
63 : {
64 : private:
65 : SwFlyFrm *pFlyFrm;
66 :
67 : protected:
68 : // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
69 : // not used but something own (top left of new SnapRect minus top left
70 : // of original SnapRect)
71 : virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
72 :
73 : public:
74 : // for paints triggered form ExecutePrimitive
75 : void wrap_DoPaintObject() const;
76 :
77 : // for simple access to inner and outer bounds
78 : basegfx::B2DRange getOuterBound() const;
79 : basegfx::B2DRange getInnerBound() const;
80 :
81 : TYPEINFO();
82 :
83 : SwVirtFlyDrawObj(SdrObject& rNew, SwFlyFrm* pFly);
84 : ~SwVirtFlyDrawObj();
85 :
86 : // overloaded method of base class SdrVirtObj
87 : virtual void TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const;
88 :
89 : // we treat the size calculation completely on ourself here
90 : virtual const Rectangle& GetCurrentBoundRect() const;
91 : virtual const Rectangle& GetLastBoundRect() const;
92 : virtual void RecalcBoundRect();
93 : virtual void RecalcSnapRect();
94 : virtual const Rectangle& GetSnapRect() const;
95 : virtual void SetSnapRect(const Rectangle& rRect);
96 : virtual void NbcSetSnapRect(const Rectangle& rRect);
97 : virtual const Rectangle& GetLogicRect() const;
98 : virtual void SetLogicRect(const Rectangle& rRect);
99 : virtual void NbcSetLogicRect(const Rectangle& rRect);
100 : virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const;
101 : virtual void NbcMove (const Size& rSiz);
102 : virtual void NbcResize(const Point& rRef, const Fraction& xFact,
103 : const Fraction& yFact);
104 : virtual void Move (const Size& rSiz);
105 : virtual void Resize(const Point& rRef, const Fraction& xFact,
106 : const Fraction& yFact, bool bUnsetRelative = true);
107 :
108 : const SwFrmFmt *GetFmt() const;
109 : SwFrmFmt *GetFmt();
110 :
111 : // methods to get pointers for the Fly
112 1806 : SwFlyFrm* GetFlyFrm() { return pFlyFrm; }
113 4684 : const SwFlyFrm* GetFlyFrm() const { return pFlyFrm; }
114 :
115 : void SetRect() const;
116 :
117 : // if an URL is attached to a graphic than this is a macro object
118 : virtual bool HasMacro() const;
119 : virtual SdrObject* CheckMacroHit (const SdrObjMacroHitRec& rRec) const;
120 : virtual Pointer GetMacroPointer (const SdrObjMacroHitRec& rRec) const;
121 :
122 : // FullDrag support
123 : virtual bool supportsFullDrag() const;
124 : virtual SdrObject* getFullDragClone() const;
125 : };
126 :
127 : #endif
128 :
129 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|