LCOV - code coverage report
Current view: top level - libreoffice/svl/inc/svl - cintitem.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 15 31 48.4 %
Date: 2012-12-27 Functions: 7 18 38.9 %
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 _SVTOOLS_CINTITEM_HXX
      21             : #define _SVTOOLS_CINTITEM_HXX
      22             : 
      23             : #include "svl/svldllapi.h"
      24             : #include <tools/debug.hxx>
      25             : #include <svl/poolitem.hxx>
      26             : 
      27             : //============================================================================
      28             : DBG_NAMEEX_VISIBILITY(CntByteItem, SVL_DLLPUBLIC)
      29             : 
      30             : class SVL_DLLPUBLIC CntByteItem: public SfxPoolItem
      31             : {
      32             :     sal_uInt8 m_nValue;
      33             : 
      34             : public:
      35             :     TYPEINFO();
      36             : 
      37           0 :     CntByteItem(sal_uInt16 which = 0, sal_uInt8 nTheValue = 0):
      38           0 :         SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntByteItem, 0); }
      39             : 
      40           0 :     CntByteItem(const CntByteItem & rItem):
      41           0 :         SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
      42           0 :     { DBG_CTOR(CntByteItem, 0); }
      43             : 
      44           0 :     virtual ~CntByteItem() { DBG_DTOR(CntByteItem, 0); }
      45             : 
      46             :     virtual int operator ==(const SfxPoolItem & rItem) const;
      47             : 
      48             :     using SfxPoolItem::Compare;
      49             :     virtual int Compare(const SfxPoolItem & rWith) const;
      50             : 
      51             :     virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
      52             :                                                 SfxMapUnit, SfxMapUnit,
      53             :                                                 XubString & rText,
      54             :                                                 const IntlWrapper * = 0)
      55             :         const;
      56             : 
      57             :     virtual bool QueryValue(com::sun::star::uno::Any& rVal,
      58             :                             sal_uInt8 nMemberId = 0) const;
      59             : 
      60             :     virtual bool PutValue(const com::sun::star::uno::Any& rVal,
      61             :                           sal_uInt8 nMemberId = 0);
      62             : 
      63             :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
      64             : 
      65             :     virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
      66             : 
      67             :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
      68             : 
      69             :     virtual sal_uInt8 GetMin() const;
      70             : 
      71             :     virtual sal_uInt8 GetMax() const;
      72             : 
      73             :     virtual SfxFieldUnit GetUnit() const;
      74             : 
      75             :     sal_uInt8 GetValue() const { return m_nValue; }
      76             : 
      77             :     inline void SetValue(sal_uInt8 nTheValue);
      78             : };
      79             : 
      80             : inline void CntByteItem::SetValue(sal_uInt8 nTheValue)
      81             : {
      82             :     DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item");
      83             :     m_nValue = nTheValue;
      84             : }
      85             : 
      86             : //============================================================================
      87             : DBG_NAMEEX_VISIBILITY(CntUInt16Item, SVL_DLLPUBLIC)
      88             : 
      89             : class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem
      90             : {
      91             :     sal_uInt16 m_nValue;
      92             : 
      93             : public:
      94             :     TYPEINFO();
      95             : 
      96           0 :     CntUInt16Item(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0):
      97           0 :         SfxPoolItem(which), m_nValue(nTheValue)
      98           0 :     { DBG_CTOR(CntUInt16Item, 0); }
      99             : 
     100             :     CntUInt16Item(sal_uInt16 which, SvStream & rStream);
     101             : 
     102        4522 :     CntUInt16Item(const CntUInt16Item & rItem):
     103        4522 :         SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
     104        4522 :     { DBG_CTOR(CntUInt16Item, 0); }
     105             : 
     106        4364 :     virtual ~CntUInt16Item() { DBG_DTOR(CntUInt16Item, 0); }
     107             : 
     108             :     virtual int operator ==(const SfxPoolItem & rItem) const;
     109             : 
     110             :     using SfxPoolItem::Compare;
     111             :     virtual int Compare(const SfxPoolItem & rWith) const;
     112             : 
     113             :     virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
     114             :                                                 SfxMapUnit, SfxMapUnit,
     115             :                                                 XubString & rText,
     116             :                                                 const IntlWrapper * = 0)
     117             :         const;
     118             : 
     119             :     virtual bool QueryValue(com::sun::star::uno::Any& rVal,
     120             :                             sal_uInt8 nMemberId = 0) const;
     121             : 
     122             :     virtual bool PutValue(const com::sun::star::uno::Any& rVal,
     123             :                           sal_uInt8 nMemberId = 0);
     124             : 
     125             :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
     126             : 
     127             :     virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
     128             : 
     129             :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
     130             : 
     131             :     virtual sal_uInt16 GetMin() const;
     132             : 
     133             :     virtual sal_uInt16 GetMax() const;
     134             : 
     135             :     virtual SfxFieldUnit GetUnit() const;
     136             : 
     137             :     sal_Int16 GetValue() const { return m_nValue; }
     138             : 
     139             :     inline void SetValue(sal_uInt16 nTheValue);
     140             : };
     141             : 
     142             : inline void CntUInt16Item::SetValue(sal_uInt16 nTheValue)
     143             : {
     144             :     DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item");
     145             :     m_nValue = nTheValue;
     146             : }
     147             : 
     148             : //============================================================================
     149             : DBG_NAMEEX_VISIBILITY(CntInt32Item, SVL_DLLPUBLIC)
     150             : 
     151             : class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem
     152             : {
     153             :     sal_Int32 m_nValue;
     154             : 
     155             : public:
     156             :     TYPEINFO();
     157             : 
     158        4556 :     CntInt32Item(sal_uInt16 which = 0, sal_Int32 nTheValue = 0):
     159        4556 :         SfxPoolItem(which), m_nValue(nTheValue)
     160        4556 :     { DBG_CTOR(CntInt32Item, 0); }
     161             : 
     162             :     CntInt32Item(sal_uInt16 which, SvStream & rStream);
     163             : 
     164        4949 :     CntInt32Item(const CntInt32Item & rItem):
     165        4949 :         SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
     166        4949 :     { DBG_CTOR(CntInt32Item, 0); }
     167             : 
     168        3162 :     virtual ~CntInt32Item() { DBG_DTOR(CntInt32Item, 0); }
     169             : 
     170             :     virtual int operator ==(const SfxPoolItem & rItem) const;
     171             : 
     172             :     using SfxPoolItem::Compare;
     173             :     virtual int Compare(const SfxPoolItem & rWith) const;
     174             : 
     175             :     virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
     176             :                                                 SfxMapUnit, SfxMapUnit,
     177             :                                                 XubString & rText,
     178             :                                                 const IntlWrapper * = 0)
     179             :         const;
     180             : 
     181             :     virtual bool QueryValue(com::sun::star::uno::Any& rVal,
     182             :                             sal_uInt8 nMemberId = 0) const;
     183             : 
     184             :     virtual bool PutValue(const com::sun::star::uno::Any& rVal,
     185             :                           sal_uInt8 nMemberId = 0);
     186             : 
     187             :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
     188             : 
     189             :     virtual SvStream & Store(SvStream &, sal_uInt16) const;
     190             : 
     191             :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
     192             : 
     193             :     virtual sal_Int32 GetMin() const;
     194             : 
     195             :     virtual sal_Int32 GetMax() const;
     196             : 
     197             :     virtual SfxFieldUnit GetUnit() const;
     198             : 
     199           0 :     sal_Int32 GetValue() const { return m_nValue; }
     200             : 
     201             :     inline void SetValue(sal_Int32 nTheValue);
     202             : };
     203             : 
     204           0 : inline void CntInt32Item::SetValue(sal_Int32 nTheValue)
     205             : {
     206             :     DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item");
     207           0 :     m_nValue = nTheValue;
     208           0 : }
     209             : 
     210             : //============================================================================
     211             : DBG_NAMEEX_VISIBILITY(CntUInt32Item, SVL_DLLPUBLIC)
     212             : 
     213             : class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem
     214             : {
     215             :     sal_uInt32 m_nValue;
     216             : 
     217             : public:
     218             :     TYPEINFO();
     219             : 
     220           0 :     CntUInt32Item(sal_uInt16 which = 0, sal_uInt32 nTheValue = 0):
     221           0 :         SfxPoolItem(which), m_nValue(nTheValue)
     222           0 :     { DBG_CTOR(CntUInt32Item, 0); }
     223             : 
     224             :     CntUInt32Item(sal_uInt16 nWhich, SvStream & rStream);
     225             : 
     226         183 :     CntUInt32Item(const CntUInt32Item & rItem):
     227         183 :         SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
     228         183 :     { DBG_CTOR(CntUInt32Item, 0); }
     229             : 
     230         469 :     virtual ~CntUInt32Item() { DBG_DTOR(CntUInt32Item, 0); }
     231             : 
     232             :     virtual int operator ==(const SfxPoolItem & rItem) const;
     233             : 
     234             :     using SfxPoolItem::Compare;
     235             :     virtual int Compare(const SfxPoolItem & rWith) const;
     236             : 
     237             :     virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
     238             :                                                 SfxMapUnit, SfxMapUnit,
     239             :                                                 XubString & rText,
     240             :                                                 const IntlWrapper * = 0)
     241             :         const;
     242             : 
     243             :     virtual bool QueryValue(com::sun::star::uno::Any& rVal,
     244             :                             sal_uInt8 nMemberId = 0) const;
     245             : 
     246             :     virtual bool PutValue(const com::sun::star::uno::Any& rVal,
     247             :                           sal_uInt8 nMemberId = 0);
     248             : 
     249             :     virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
     250             : 
     251             :     virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
     252             : 
     253             :     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
     254             : 
     255             :     virtual sal_uInt32 GetMin() const;
     256             : 
     257             :     virtual sal_uInt32 GetMax() const;
     258             : 
     259             :     virtual SfxFieldUnit GetUnit() const;
     260             : 
     261             :     sal_uInt32 GetValue() const { return m_nValue; }
     262             : 
     263             :     inline void SetValue(sal_uInt32 nTheValue);
     264             : };
     265             : 
     266             : inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue)
     267             : {
     268             :     DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item");
     269             :     m_nValue = nTheValue;
     270             : }
     271             : 
     272             : #endif // _SVTOOLS_CINTITEM_HXX
     273             : 
     274             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10