1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
37 /*--------------------------------------------------------------------
38 Beschreibung: Benutzerfelder
39 --------------------------------------------------------------------*/
41 class SW_DLLPUBLIC SwUserFieldType
: public SwValueFieldType
51 SwUserFieldType( SwDoc
* pDocPtr
, const String
& );
53 virtual const String
& GetName() const;
54 virtual SwFieldType
* Copy() const;
56 String
Expand(sal_uInt32 nFmt
, USHORT nSubType
, USHORT nLng
);
58 String
GetContent( sal_uInt32 nFmt
= 0 );
59 void SetContent( const String
& rStr
, sal_uInt32 nFmt
= 0 );
61 inline BOOL
IsValid() const;
62 inline void ChgValid( BOOL bNew
);
64 virtual void Modify( SfxPoolItem
* pOld
, SfxPoolItem
* pNew
);
66 double GetValue(SwCalc
& rCalc
); // Member nValue neu berrechnen
67 inline double GetValue() const;
68 inline void SetValue(const double nVal
);
70 inline USHORT
GetType() const;
71 inline void SetType(USHORT
);
73 BOOL
IsDeleted() const { return bDeleted
; }
74 void SetDeleted( BOOL b
) { bDeleted
= b
; }
76 virtual BOOL
QueryValue( com::sun::star::uno::Any
& rVal
, USHORT nMId
) const;
77 virtual BOOL
PutValue( const com::sun::star::uno::Any
& rVal
, USHORT nMId
);
80 inline BOOL
SwUserFieldType::IsValid() const
81 { return bValidValue
; }
83 inline void SwUserFieldType::ChgValid( BOOL bNew
)
84 { bValidValue
= bNew
; }
86 inline double SwUserFieldType::GetValue() const
89 inline void SwUserFieldType::SetValue(const double nVal
)
92 inline USHORT
SwUserFieldType::GetType() const
95 inline void SwUserFieldType::SetType(USHORT nSub
)
98 EnableFormat(!(nSub
& nsSwGetSetExpType::GSE_STRING
));
101 /*--------------------------------------------------------------------
102 Beschreibung: Benutzerfelder
103 --------------------------------------------------------------------*/
105 class SW_DLLPUBLIC SwUserField
: public SwValueField
110 SwUserField(SwUserFieldType
*, USHORT nSub
= 0, sal_uInt32 nFmt
= 0);
112 virtual USHORT
GetSubType() const;
113 virtual void SetSubType(USHORT nSub
);
115 virtual double GetValue() const;
116 virtual void SetValue( const double& rVal
);
118 virtual String
Expand() const;
119 virtual SwField
* Copy() const;
120 virtual String
GetCntnt(BOOL bName
= FALSE
) const;
122 // Name kann nicht geaendert werden
123 virtual const String
& GetPar1() const;
126 virtual String
GetPar2() const;
127 virtual void SetPar2(const String
& rStr
);
128 virtual BOOL
QueryValue( com::sun::star::uno::Any
& rVal
, USHORT nWhichId
) const;
129 virtual BOOL
PutValue( const com::sun::star::uno::Any
& rVal
, USHORT nWhichId
);
132 #endif // _USRFLD_HXX