LCOV - code coverage report
Current view: top level - libreoffice/svx/inc/svx - svdomeas.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 2 0.0 %
Date: 2012-12-17 Functions: 0 2 0.0 %
Legend: Lines: hit not hit

          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 _SVDOMEAS_HXX
      21             : #define _SVDOMEAS_HXX
      22             : 
      23             : #include <svx/svdotext.hxx>
      24             : #include "svx/svxdllapi.h"
      25             : #include <editeng/measfld.hxx>
      26             : 
      27             : //************************************************************
      28             : //   Vorausdeklarationen
      29             : //************************************************************
      30             : 
      31             : class SdrOutliner;
      32             : struct ImpMeasureRec;
      33             : struct ImpMeasurePoly;
      34             : 
      35             : namespace sdr { namespace properties {
      36             :     class MeasureProperties;
      37             : }}
      38             : 
      39             : //************************************************************
      40             : //   Hilfsklasse SdrMeasureObjGeoData
      41             : //************************************************************
      42             : 
      43             : class SdrMeasureObjGeoData : public SdrTextObjGeoData
      44             : {
      45             : public:
      46             :     Point                       aPt1;
      47             :     Point                       aPt2;
      48             : 
      49             : public:
      50             :     SdrMeasureObjGeoData();
      51             :     virtual ~SdrMeasureObjGeoData();
      52             : };
      53             : 
      54             : //************************************************************
      55             : //   SdrMeasureObj
      56             : //************************************************************
      57             : 
      58           0 : class SVX_DLLPUBLIC SdrMeasureObj : public SdrTextObj
      59             : {
      60             : private:
      61             :     // to allow sdr::properties::MeasureProperties access to SetTextDirty()
      62             :     friend class sdr::properties::MeasureProperties;
      63             : 
      64             :     friend class                SdrMeasureField;
      65             : 
      66             : protected:
      67             :     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
      68             :     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
      69             : 
      70             :     Point                       aPt1;
      71             :     Point                       aPt2;
      72             :     bool                        bTextDirty;
      73             : 
      74             : protected:
      75             :     void ImpTakeAttr(ImpMeasureRec& rRec) const;
      76             :     void TakeRepresentation( XubString& rStr, SdrMeasureFieldKind eMeasureFieldKind ) const;
      77             :     void ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& rPol) const;
      78             :     basegfx::B2DPolyPolygon ImpCalcXPoly(const ImpMeasurePoly& rPol) const;
      79             :     void ImpEvalDrag(ImpMeasureRec& rRec, const SdrDragStat& rDrag) const;
      80           0 :     void SetTextDirty() { bTextDirty=sal_True; SetTextSizeDirty(); if (!aOutRect.IsEmpty()) { SetBoundRectDirty(); SetRectsDirty(sal_True); } }
      81             :     void UndirtyText() const;
      82             : 
      83             :     virtual SdrObjGeoData* NewGeoData() const;
      84             :     virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
      85             :     virtual void RestGeoData(const SdrObjGeoData& rGeo);
      86             : 
      87             : public:
      88             :     TYPEINFO();
      89             :     SdrMeasureObj();
      90             :     SdrMeasureObj(const Point& rPt1, const Point& rPt2);
      91             :     virtual ~SdrMeasureObj();
      92             : 
      93             :     virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
      94             :     virtual sal_uInt16 GetObjIdentifier() const;
      95             :     virtual void TakeUnrotatedSnapRect(Rectangle& rRect) const;
      96             :     virtual SdrMeasureObj* Clone() const;
      97             : 
      98             :     virtual void TakeObjNameSingul(String& rName) const;
      99             :     virtual void TakeObjNamePlural(String& rName) const;
     100             : 
     101             :     virtual basegfx::B2DPolyPolygon TakeXorPoly() const;
     102             :     virtual sal_uInt32 GetHdlCount() const;
     103             :     virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const;
     104             : 
     105             :     // special drag methods
     106             :     virtual bool hasSpecialDrag() const;
     107             :     virtual bool beginSpecialDrag(SdrDragStat& rDrag) const;
     108             :     virtual bool applySpecialDrag(SdrDragStat& rDrag);
     109             :     virtual String getSpecialDragComment(const SdrDragStat& rDrag) const;
     110             : 
     111             :     virtual bool BegCreate(SdrDragStat& rStat);
     112             :     virtual bool MovCreate(SdrDragStat& rStat);
     113             :     virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
     114             :     virtual bool BckCreate(SdrDragStat& rStat);
     115             :     virtual void BrkCreate(SdrDragStat& rStat);
     116             :     virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const;
     117             :     virtual Pointer GetCreatePointer() const;
     118             : 
     119             :     virtual void NbcMove(const Size& rSiz);
     120             :     virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
     121             :     virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
     122             :     virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
     123             :     virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear);
     124             :     virtual long GetRotateAngle() const;
     125             :     virtual void RecalcSnapRect();
     126             : 
     127             :     virtual sal_uInt32 GetSnapPointCount() const;
     128             :     virtual Point GetSnapPoint(sal_uInt32 i) const;
     129             : 
     130             :     virtual sal_Bool IsPolyObj() const;
     131             :     virtual sal_uInt32 GetPointCount() const;
     132             :     virtual Point GetPoint(sal_uInt32 i) const;
     133             :     virtual void NbcSetPoint(const Point& rPnt, sal_uInt32 i);
     134             : 
     135             :     virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
     136             : 
     137             :     virtual sal_Bool BegTextEdit(SdrOutliner& rOutl);
     138             :     virtual const Size& GetTextSize() const;
     139             :     virtual void TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, bool bNoEditText = false,
     140             :         Rectangle* pAnchorRect=NULL, bool bLineWidth = true ) const;
     141             :     virtual void TakeTextAnchorRect(Rectangle& rAnchorRect) const;
     142             :     virtual void TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const;
     143             :     virtual sal_uInt16 GetOutlinerViewAnchorMode() const;
     144             :     virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
     145             :     virtual OutlinerParaObject* GetOutlinerParaObject() const;
     146             : 
     147             :     virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
     148             :         bool bEdit, Color*& rpTxtColor, Color*& rpFldColor, String& rRet) const;
     149             : 
     150             :     // #i97878#
     151             :     virtual sal_Bool TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DPolyPolygon& rPolyPolygon) const;
     152             :     virtual void TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const basegfx::B2DPolyPolygon& rPolyPolygon);
     153             : };
     154             : 
     155             : /////////////////////////////////////////////////////////////////////////////////////////////////
     156             : //
     157             : // Creating:
     158             : // ~~~~~~~~~
     159             : // Dragging von Bezugspunkt 1 zu Bezugspunkt 2 -> Bezugskante
     160             : //
     161             : // Die Defaults:
     162             : // ~~~~~~~~~~~~~
     163             : // Masslinie und Masshilfslinien: Haarlinien solid schwarz
     164             : // Pfeile:     2mm x 4mm
     165             : // Textgroesse
     166             : //                              ___
     167             : //     |        Masszahl       | 2mm
     168             : //     |<--------------------->|---
     169             : //     |                       | 8mm
     170             : //     |                       |
     171             : //    Pt1============#        Pt2-- <----Bezugskante (von Pt1 nach Pt2)
     172             : //     #             #         |___ <- Ueberstand der Masshilfslinie(n)
     173             : //     #             #=========#
     174             : //     # Zu bemassendes Objekt #
     175             : //     #=======================#
     176             : //
     177             : // Attribute:
     178             : // ~~~~~~~~~~
     179             : // 1. Wo steht der Text: mitte, rechts oder links (def=automatik)
     180             : // 2. Text oberhalb der Linie oder unterhalb oder Linie unterbrochen durch Text (def=automatik)
     181             : // 3. Den Abstand der Masslinie zur Bezugskante (=zum bemassten Objekt).
     182             : //    Default=8mm
     183             : // 4. Masslinie unterhalb der Bezugskante (default=nein)
     184             : // 5. Die Ueberlaenge(n) der Masshilfslinien ueber die Bezugskante (2x, default=0)
     185             : // 6. Den Ueberhang der Masshilfslinien ueber die Masslinie (default=2mm)
     186             : // 7. Den Abstand der Masshilfslinien zur Bezugskante
     187             : //
     188             : // Dragging:                    Handle          Shift
     189             : // ~~~~~~~~~
     190             : // -  Die Bezugspunkte        SolidQuadHdl   nur die Laenge
     191             : // 1.+2. Anpacken des Textes
     192             : // 3.+4. Hdl am Pfeil (2x)    SolidQuadHdl   nur den Bool
     193             : // 5.    Hdl am Endpunkt      CircHdl        beide Laengen?
     194             : // 6.+7. Kein Dragging
     195             : //
     196             : // Offen:
     197             : // ~~~~~~
     198             : // - Radien (gleich als Typ verankern
     199             : //
     200             : // Special:
     201             : // ~~~~~~~~
     202             : // Connecting an max. 2 Objekte
     203             : // -> Bei Copy, etc. den entspr. Code der Verbinder verwenden?!?
     204             : // wird wohl recht kompliziert werden ...
     205             : //
     206             : /////////////////////////////////////////////////////////////////////////////////////////////////
     207             : 
     208             : #endif //_SVDOMEAS_HXX
     209             : 
     210             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10