LCOV - code coverage report
Current view: top level - svx/inc/svx - rulritem.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 31 45 68.9 %
Date: 2012-08-25 Functions: 29 43 67.4 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 9 18 50.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                 :            : #ifndef _SVX_RULRITEM_HXX
      29                 :            : #define _SVX_RULRITEM_HXX
      30                 :            : 
      31                 :            : #include <tools/gen.hxx>
      32                 :            : #include <svl/poolitem.hxx>
      33                 :            : #include "svx/svxdllapi.h"
      34                 :            : #include <vector>
      35                 :            : 
      36         [ -  + ]:       4842 : class SVX_DLLPUBLIC SvxLongLRSpaceItem : public SfxPoolItem
      37                 :            : {
      38                 :            :     long    lLeft;         // nLeft or the negativ first-line indentation
      39                 :            :     long    lRight;        // the unproblematic right edge
      40                 :            : 
      41                 :            :   protected:
      42                 :            : 
      43                 :            :     virtual int              operator==( const SfxPoolItem& ) const;
      44                 :            :     virtual bool             QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
      45                 :            :     virtual bool             PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
      46                 :            : 
      47                 :            :     virtual String           GetValueText() const;
      48                 :            :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
      49                 :            :                                     SfxMapUnit eCoreMetric,
      50                 :            :                                     SfxMapUnit ePresMetric,
      51                 :            :                                     String &rText, const IntlWrapper * = 0 ) const;
      52                 :            : 
      53                 :            :     virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
      54                 :            : 
      55                 :            : private:
      56                 :            :     SVX_DLLPRIVATE const SvxLongLRSpaceItem& operator=(const SvxLongLRSpaceItem &); // n.i.
      57                 :            : 
      58                 :            : public:
      59                 :            :     TYPEINFO();
      60                 :            :     SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId);
      61                 :            :     SvxLongLRSpaceItem(const SvxLongLRSpaceItem &);
      62                 :            :     SvxLongLRSpaceItem();
      63                 :            : 
      64                 :        941 :     long    GetLeft() const { return lLeft; }
      65                 :       2728 :     long    GetRight() const { return lRight; }
      66                 :          0 :     void    SetLeft(long lArgLeft) {lLeft=lArgLeft;}
      67                 :          0 :     void    SetRight(long lArgRight) {lRight=lArgRight;}
      68                 :            : };
      69                 :            : 
      70         [ -  + ]:       4822 : class SVX_DLLPUBLIC SvxLongULSpaceItem : public SfxPoolItem
      71                 :            : {
      72                 :            :     long    lLeft;         // nLeft or the negative first-line indentation
      73                 :            :     long    lRight;        // the unproblematic right edge
      74                 :            : 
      75                 :            :   protected:
      76                 :            : 
      77                 :            :     virtual int              operator==( const SfxPoolItem& ) const;
      78                 :            :     virtual bool             QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
      79                 :            :     virtual bool             PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
      80                 :            : 
      81                 :            :     virtual String           GetValueText() const;
      82                 :            :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
      83                 :            :                                     SfxMapUnit eCoreMetric,
      84                 :            :                                     SfxMapUnit ePresMetric,
      85                 :            :                                     String &rText, const IntlWrapper * = 0 ) const;
      86                 :            : 
      87                 :            :     virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
      88                 :            : 
      89                 :            : private:
      90                 :            :     SVX_DLLPRIVATE const SvxLongULSpaceItem& operator=(const SvxLongULSpaceItem &); // n.i.
      91                 :            : 
      92                 :            : public:
      93                 :            :     TYPEINFO();
      94                 :            :     SvxLongULSpaceItem(long lUpper, long lLower, sal_uInt16 nId);
      95                 :            :     SvxLongULSpaceItem(const SvxLongULSpaceItem &);
      96                 :            :     SvxLongULSpaceItem();
      97                 :            : 
      98                 :        938 :     long    GetUpper() const { return lLeft; }
      99                 :        937 :     long    GetLower() const { return lRight; }
     100                 :          0 :     void    SetUpper(long lArgLeft) {lLeft=lArgLeft;}
     101                 :          0 :     void    SetLower(long lArgRight) {lRight=lArgRight;}
     102                 :            : };
     103                 :            : 
     104         [ -  + ]:       6050 : class SVX_DLLPUBLIC SvxPagePosSizeItem : public SfxPoolItem
     105                 :            : {
     106                 :            :     Point aPos;
     107                 :            :     long lWidth;
     108                 :            :     long lHeight;
     109                 :            : protected:
     110                 :            :     virtual int              operator==( const SfxPoolItem& ) const;
     111                 :            :     virtual bool             QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
     112                 :            :     virtual bool             PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
     113                 :            : 
     114                 :            :     virtual String           GetValueText() const;
     115                 :            :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
     116                 :            :                                     SfxMapUnit eCoreMetric,
     117                 :            :                                     SfxMapUnit ePresMetric,
     118                 :            :                                     String &rText, const IntlWrapper * = 0 ) const;
     119                 :            : 
     120                 :            :     virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
     121                 :            : 
     122                 :            : private:
     123                 :            :     SVX_DLLPRIVATE const SvxPagePosSizeItem& operator=(const SvxPagePosSizeItem &); // n.i.
     124                 :            : public:
     125                 :            :     TYPEINFO();
     126                 :            :     SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight);
     127                 :            :     SvxPagePosSizeItem(const SvxPagePosSizeItem &);
     128                 :            :     SvxPagePosSizeItem();
     129                 :            : 
     130                 :       1885 :     const Point &GetPos() const { return aPos; }
     131                 :       3674 :     long    GetWidth() const { return lWidth; }
     132                 :       1880 :     long    GetHeight() const { return lHeight; }
     133                 :            : };
     134                 :            : 
     135                 :            : struct SvxColumnDescription
     136                 :            : {
     137                 :            :     long nStart;                    /* Start of the column */
     138                 :            :     long nEnd;                      /* End of the column */
     139                 :            :     sal_Bool bVisible;              /* Visibility */
     140                 :            : 
     141                 :            :     long nEndMin;         //min. possible position of end
     142                 :            :     long nEndMax;         //max. possible position of end
     143                 :            : 
     144                 :            :     SvxColumnDescription():
     145                 :            :         nStart(0), nEnd(0), bVisible(sal_True), nEndMin(0), nEndMax(0) {}
     146                 :            : 
     147                 :         66 :     SvxColumnDescription(const SvxColumnDescription &rCopy) :
     148                 :            :         nStart(rCopy.nStart), nEnd(rCopy.nEnd),
     149                 :            :         bVisible(rCopy.bVisible),
     150                 :         66 :         nEndMin(rCopy.nEndMin), nEndMax(rCopy.nEndMax)
     151                 :         66 :          {}
     152                 :            : 
     153                 :            :     SvxColumnDescription(long start, long end, sal_Bool bVis = sal_True):
     154                 :            :         nStart(start), nEnd(end),
     155                 :            :         bVisible(bVis),
     156                 :            :         nEndMin(0), nEndMax(0) {}
     157                 :            : 
     158                 :            :     SvxColumnDescription(long start, long end,
     159                 :            :                         long endMin, long endMax, sal_Bool bVis = sal_True):
     160                 :            :         nStart(start), nEnd(end),
     161                 :            :         bVisible(bVis),
     162                 :            :         nEndMin(endMin), nEndMax(endMax)
     163                 :            :          {}
     164                 :            : 
     165                 :         12 :     int operator==(const SvxColumnDescription &rCmp) const {
     166                 :            :         return nStart == rCmp.nStart &&
     167                 :            :             bVisible == rCmp.bVisible &&
     168                 :            :             nEnd == rCmp.nEnd &&
     169                 :            :             nEndMin == rCmp.nEndMin &&
     170 [ +  - ][ +  - ]:         12 :                 nEndMax == rCmp.nEndMax;
         [ +  - ][ +  - ]
                 [ +  - ]
     171                 :            :     }
     172                 :         12 :     int operator!=(const SvxColumnDescription &rCmp) const {
     173                 :         12 :         return !operator==(rCmp);
     174                 :            :     }
     175                 :          0 :     long GetWidth() const { return nEnd - nStart; }
     176                 :            : };
     177                 :            : 
     178                 :            : class SVX_DLLPUBLIC SvxColumnItem : public SfxPoolItem
     179                 :            : {
     180                 :            :     std::vector<SvxColumnDescription> aColumns;// Column array
     181                 :            :     long    nLeft,      // Left edge for the table
     182                 :            :            nRight;      // Right edge for the table; for columns always
     183                 :            :                                 // equal to the surrounding frame
     184                 :            :     sal_uInt16 nActColumn;  // the current column
     185                 :            :     sal_uInt8  bTable;      // table?
     186                 :            :     sal_uInt8  bOrtho;     // evenly spread columns
     187                 :            : 
     188                 :            : protected:
     189                 :            :     virtual int              operator==( const SfxPoolItem& ) const;
     190                 :            : 
     191                 :            :     virtual String           GetValueText() const;
     192                 :            :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
     193                 :            :                                     SfxMapUnit eCoreMetric,
     194                 :            :                                     SfxMapUnit ePresMetric,
     195                 :            :                                     String &rText, const IntlWrapper * = 0 ) const;
     196                 :            : 
     197                 :            :     virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
     198                 :            :     virtual bool             QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
     199                 :            :     virtual bool             PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
     200                 :            : public:
     201                 :            :     TYPEINFO();
     202                 :            :     // right edge of the surrounding frame
     203                 :            :     // nLeft, nRight each the distance to the surrounding frame
     204                 :            :     SvxColumnItem(sal_uInt16 nAct = 0); // columns
     205                 :            :     SvxColumnItem(sal_uInt16 nActCol,
     206                 :            :                   sal_uInt16 nLeft, sal_uInt16 nRight = 0); // Table with borders
     207                 :            :     SvxColumnItem(const SvxColumnItem &);
     208                 :            :     ~SvxColumnItem();
     209                 :            : 
     210                 :            :     const SvxColumnItem &operator=(const SvxColumnItem &);
     211                 :            : 
     212                 :        138 :     sal_uInt16 Count() const { return aColumns.size(); }
     213                 :         60 :     SvxColumnDescription &operator[](sal_uInt16 i)
     214                 :         60 :         { return aColumns[i]; }
     215                 :         68 :     const SvxColumnDescription &operator[](sal_uInt16 i) const
     216                 :         68 :         { return aColumns[i]; }
     217                 :            :     void Insert(const SvxColumnDescription &rDesc, sal_uInt16 nPos) {
     218                 :            :         aColumns.insert(aColumns.begin() + nPos, rDesc);
     219                 :            :     }
     220                 :            :     void   Append(const SvxColumnDescription &rDesc) { Insert(rDesc, Count()); }
     221                 :          0 :     void   SetLeft(long left) { nLeft = left; }
     222                 :          0 :     void   SetRight(long right) { nRight = right; }
     223                 :            :     void   SetActColumn(sal_uInt16 nCol) { nActColumn = nCol; }
     224                 :            : 
     225                 :         28 :     sal_uInt16 GetActColumn() const { return nActColumn; }
     226                 :          0 :     sal_Bool   IsFirstAct() const { return nActColumn == 0; }
     227                 :          0 :     sal_Bool   IsLastAct() const { return nActColumn == Count()-1; }
     228                 :          8 :     long GetLeft() { return nLeft; }
     229                 :          8 :     long GetRight() { return nRight; }
     230                 :            : 
     231                 :         20 :     sal_Bool   IsTable() const { return bTable; }
     232                 :            : 
     233                 :            :     sal_Bool   CalcOrtho() const;
     234                 :            :     void   SetOrtho(sal_Bool bVal) { bOrtho = bVal; }
     235                 :            :     sal_Bool   IsOrtho () const { return sal_False ; }
     236                 :            : 
     237                 :            :     sal_Bool IsConsistent() const  { return nActColumn < aColumns.size(); }
     238                 :            : };
     239                 :            : 
     240                 :            : // class SvxObjectItem ---------------------------------------------------
     241                 :            : 
     242         [ -  + ]:         10 : class SVX_DLLPUBLIC SvxObjectItem : public SfxPoolItem
     243                 :            : {
     244                 :            : private:
     245                 :            :     long   nStartX;                    /* Start in x direction */
     246                 :            :     long   nEndX;                      /* End in x direction */
     247                 :            :     long   nStartY;                    /* Start in y direction */
     248                 :            :     long   nEndY;                      /* Ende in y direction */
     249                 :            :     sal_Bool bLimits;                  /* boundary limit control by the application */
     250                 :            : protected:
     251                 :            :     virtual int              operator==( const SfxPoolItem& ) const;
     252                 :            : 
     253                 :            :     virtual String           GetValueText() const;
     254                 :            :     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
     255                 :            :                                     SfxMapUnit eCoreMetric,
     256                 :            :                                     SfxMapUnit ePresMetric,
     257                 :            :                                     String &rText, const IntlWrapper * = 0 ) const;
     258                 :            : 
     259                 :            :     virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
     260                 :            :     virtual bool             QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
     261                 :            :     virtual bool             PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
     262                 :            : private:
     263                 :            :     SVX_DLLPRIVATE const SvxObjectItem &operator=(const SvxObjectItem &); // n.i.
     264                 :            : public:
     265                 :            :     TYPEINFO();
     266                 :            :     SvxObjectItem(long nStartX, long nEndX,
     267                 :            :                   long nStartY, long nEndY,
     268                 :            :                   sal_Bool bLimits = sal_False);
     269                 :            :     SvxObjectItem(const SvxObjectItem &);
     270                 :            : 
     271                 :          0 :     sal_Bool   HasLimits() const { return bLimits; }
     272                 :            : 
     273                 :          2 :     long   GetStartX() const { return nStartX; }
     274                 :          2 :     long   GetEndX() const { return nEndX; }
     275                 :          2 :     long   GetStartY() const { return nStartY; }
     276                 :          2 :     long   GetEndY() const { return nEndY; }
     277                 :            : 
     278                 :          0 :     void   SetStartX(long l) { nStartX = l; }
     279                 :          0 :     void   SetEndX(long l) { nEndX = l; }
     280                 :          0 :     void   SetStartY(long l) { nStartY = l; }
     281                 :          0 :     void   SetEndY(long l) { nEndY = l; }
     282                 :            : };
     283                 :            : 
     284                 :            : 
     285                 :            : #endif
     286                 :            : 
     287                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10