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 _CELLATR_HXX
30 : : #define _CELLATR_HXX
31 : :
32 : : #include <svl/intitem.hxx>
33 : : #include <svl/zforlist.hxx>
34 : : #include "swdllapi.h"
35 : : #include "format.hxx"
36 : : #include "cellfml.hxx"
37 : :
38 [ - + ]: 422 : class SW_DLLPUBLIC SwTblBoxNumFormat : public SfxUInt32Item
39 : : {
40 : : sal_Bool bAuto; ///< automatically given flag
41 : : public:
42 : : SwTblBoxNumFormat( sal_uInt32 nFormat = NUMBERFORMAT_TEXT,
43 : : sal_Bool bAuto = sal_False );
44 : :
45 : : // "pure virtual methods" of SfxPoolItem
46 : : virtual int operator==( const SfxPoolItem& ) const;
47 : : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
48 : :
49 : : inline SwTblBoxNumFormat& operator=( const SwTblBoxNumFormat& rAttr )
50 : : {
51 : : SetValue( rAttr.GetValue() );
52 : : SetAutoFlag( rAttr.GetAutoFlag() );
53 : : return *this;
54 : : }
55 : :
56 : : sal_Bool GetAutoFlag() const { return bAuto; }
57 : : void SetAutoFlag( sal_Bool bFlag = sal_True ) { bAuto = bFlag; }
58 : : };
59 : :
60 [ # # ]: 0 : class SwTblBoxFormula : public SfxPoolItem, public SwTableFormula
61 : : {
62 : : SwModify* pDefinedIn; // Modify object where the formula is located
63 : : // can only be TableBoxFormat
64 : :
65 : : public:
66 : : SwTblBoxFormula( const String& rFormula );
67 [ + - ][ - + ]: 146 : ~SwTblBoxFormula() {};
68 : :
69 : : // "pure virtual methods" of SfxPoolItem
70 : : virtual int operator==( const SfxPoolItem& ) const;
71 : : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
72 : :
73 : 0 : inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
74 : 0 : inline void ChgDefinedIn( const SwModify* pNew )
75 : 0 : { pDefinedIn = (SwModify*)pNew; }
76 : : // BoxAttribut -> BoxStartNode
77 : : virtual const SwNode* GetNodeOfFormula() const;
78 : :
79 : : SwTableBox* GetTableBox();
80 : : const SwTableBox* GetTableBox() const
81 : : { return ((SwTblBoxFormula*)this)->GetTableBox(); }
82 : :
83 : : void ChangeState( const SfxPoolItem* pItem );
84 : : void Calc( SwTblCalcPara& rCalcPara, double& rValue );
85 : : };
86 : :
87 [ - + ]: 428 : class SW_DLLPUBLIC SwTblBoxValue : public SfxPoolItem
88 : : {
89 : : double nValue;
90 : : public:
91 : : SwTblBoxValue();
92 : : SwTblBoxValue( const double aVal );
93 : :
94 : : // "pure virtual methods" of SfxPoolItem
95 : : virtual int operator==( const SfxPoolItem& ) const;
96 : : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
97 : :
98 : : inline SwTblBoxValue& operator=( const SwTblBoxValue& rCmp )
99 : : {
100 : : nValue = rCmp.nValue;
101 : : return *this;
102 : : }
103 : :
104 : 496 : double GetValue() const { return nValue; }
105 : : };
106 : :
107 : :
108 : :
109 : : //***************************************************************************
110 : :
111 : 228 : inline const SwTblBoxNumFormat &SwAttrSet::GetTblBoxNumFmt(sal_Bool bInP) const
112 : 228 : { return (const SwTblBoxNumFormat&)Get( RES_BOXATR_FORMAT,bInP); }
113 : 0 : inline const SwTblBoxFormula &SwAttrSet::GetTblBoxFormula(sal_Bool bInP) const
114 : 0 : { return (const SwTblBoxFormula&)Get( RES_BOXATR_FORMULA,bInP); }
115 : 208 : inline const SwTblBoxValue &SwAttrSet::GetTblBoxValue(sal_Bool bInP) const
116 : 208 : { return (const SwTblBoxValue&)Get( RES_BOXATR_VALUE, bInP); }
117 : :
118 : : //***************************************************************************
119 : :
120 : 228 : inline const SwTblBoxNumFormat &SwFmt::GetTblBoxNumFmt(sal_Bool bInP) const
121 : 228 : { return aSet.GetTblBoxNumFmt(bInP); }
122 : 0 : inline const SwTblBoxFormula &SwFmt::GetTblBoxFormula(sal_Bool bInP) const
123 : 0 : { return aSet.GetTblBoxFormula(bInP); }
124 : 208 : inline const SwTblBoxValue &SwFmt::GetTblBoxValue(sal_Bool bInP) const
125 : 208 : { return aSet.GetTblBoxValue(bInP); }
126 : :
127 : : #endif
128 : :
129 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|