LCOV - code coverage report
Current view: top level - sw/source/core/inc - dflyobj.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 2 2 100.0 %
Date: 2012-08-25 Functions: 2 2 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #ifndef _DFLYOBJ_HXX
      30                 :            : #define _DFLYOBJ_HXX
      31                 :            : 
      32                 :            : #include <svx/svdovirt.hxx>
      33                 :            : 
      34                 :            : class SwFlyFrm;
      35                 :            : class SwFrmFmt;
      36                 :            : class SdrObjMacroHitRec;
      37                 :            : 
      38                 :            : const sal_uInt32 SWGInventor =  sal_uInt32('S')*0x00000001 +
      39                 :            :                                 sal_uInt32('W')*0x00000100 +
      40                 :            :                                 sal_uInt32('G')*0x00010000;
      41                 :            : 
      42                 :            : const sal_uInt16 SwFlyDrawObjIdentifier = 0x0001;
      43                 :            : const sal_uInt16 SwDrawFirst            = 0x0001;
      44                 :            : 
      45                 :            : // DrawObjects for Flys
      46                 :            : class SwFlyDrawObj : public SdrObject
      47                 :            : {
      48                 :            : private:
      49                 :            :     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
      50                 :            : 
      51                 :            : protected:
      52                 :            :     // #i95264# SwFlyDrawObj needs an own VC since createViewIndependentPrimitive2DSequence()
      53                 :            :     // is called when RecalcBoundRect() is used
      54                 :            :     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
      55                 :            : 
      56                 :            : public:
      57                 :            :     TYPEINFO();
      58                 :            : 
      59                 :            :     SwFlyDrawObj();
      60                 :            :     ~SwFlyDrawObj();
      61                 :            : 
      62                 :            :     // for instantiation of this class while loading (via factory)
      63                 :            :     virtual sal_uInt32 GetObjInventor()     const;
      64                 :            :     virtual sal_uInt16 GetObjIdentifier()   const;
      65                 :            :     virtual sal_uInt16 GetObjVersion()      const;
      66                 :            : };
      67                 :            : 
      68                 :            : // virtual objects for Flys
      69                 :            : // Flys will always be shown with virtual objects. By doing that, they can be
      70                 :            : // shown multiple times if needed (header/footer).
      71                 :            : class SwVirtFlyDrawObj : public SdrVirtObj
      72                 :            : {
      73                 :            : private:
      74                 :            :     SwFlyFrm *pFlyFrm;
      75                 :            : 
      76                 :            : protected:
      77                 :            :     // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is
      78                 :            :     // not used but something own (top left of new SnapRect minus top left
      79                 :            :     // of original SnapRect)
      80                 :            :     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
      81                 :            : 
      82                 :            : public:
      83                 :            :     // for paints triggered form ExecutePrimitive
      84                 :            :     void wrap_DoPaintObject() const;
      85                 :            : 
      86                 :            :     // for simple access to inner and outer bounds
      87                 :            :     basegfx::B2DRange getOuterBound() const;
      88                 :            :     basegfx::B2DRange getInnerBound() const;
      89                 :            : 
      90                 :            :     TYPEINFO();
      91                 :            : 
      92                 :            :     SwVirtFlyDrawObj(SdrObject& rNew, SwFlyFrm* pFly);
      93                 :            :     ~SwVirtFlyDrawObj();
      94                 :            : 
      95                 :            :     // overloaded method of base class SdrVirtObj
      96                 :            :     virtual void     TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const;
      97                 :            : 
      98                 :            :     // we treat the size calculation completely on ourself here
      99                 :            :     virtual const Rectangle& GetCurrentBoundRect() const;
     100                 :            :     virtual const Rectangle& GetLastBoundRect() const;
     101                 :            :     virtual       void       RecalcBoundRect();
     102                 :            :     virtual       void       RecalcSnapRect();
     103                 :            :     virtual const Rectangle& GetSnapRect()  const;
     104                 :            :     virtual       void       SetSnapRect(const Rectangle& rRect);
     105                 :            :     virtual       void       NbcSetSnapRect(const Rectangle& rRect);
     106                 :            :     virtual const Rectangle& GetLogicRect() const;
     107                 :            :     virtual       void       SetLogicRect(const Rectangle& rRect);
     108                 :            :     virtual       void       NbcSetLogicRect(const Rectangle& rRect);
     109                 :            :     virtual ::basegfx::B2DPolyPolygon TakeXorPoly() const;
     110                 :            :     virtual       void       NbcMove  (const Size& rSiz);
     111                 :            :     virtual       void       NbcResize(const Point& rRef, const Fraction& xFact,
     112                 :            :                                        const Fraction& yFact);
     113                 :            :     virtual       void       Move  (const Size& rSiz);
     114                 :            :     virtual       void       Resize(const Point& rRef, const Fraction& xFact,
     115                 :            :                                     const Fraction& yFact);
     116                 :            : 
     117                 :            :     const SwFrmFmt *GetFmt() const;
     118                 :            :           SwFrmFmt *GetFmt();
     119                 :            : 
     120                 :            :     // methods to get pointers for the Fly
     121                 :       8716 :           SwFlyFrm* GetFlyFrm()         { return pFlyFrm; }
     122                 :      23975 :     const SwFlyFrm* GetFlyFrm() const   { return pFlyFrm; }
     123                 :            : 
     124                 :            :     void SetRect() const;
     125                 :            : 
     126                 :            :     // if an URL is attached to a graphic than this is a macro object
     127                 :            :     virtual bool       HasMacro() const;
     128                 :            :     virtual SdrObject* CheckMacroHit       (const SdrObjMacroHitRec& rRec) const;
     129                 :            :     virtual Pointer    GetMacroPointer     (const SdrObjMacroHitRec& rRec) const;
     130                 :            : 
     131                 :            :     // FullDrag support
     132                 :            :     virtual bool supportsFullDrag() const;
     133                 :            :     virtual SdrObject* getFullDragClone() const;
     134                 :            : };
     135                 :            : 
     136                 :            : #endif
     137                 :            : 
     138                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10