xref: /AOO41X/main/svl/inc/svl/custritm.hxx (revision 39a19a47feaddbaa21988da8c7bf801707fd3d48)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SVTOOLS_CUSTRITM_HXX
25 #define _SVTOOLS_CUSTRITM_HXX
26 
27 #include "svl/svldllapi.h"
28 #include <tools/debug.hxx>
29 #include <svl/poolitem.hxx>
30 
31 //============================================================================
32 DBG_NAMEEX_VISIBILITY(CntUnencodedStringItem, SVL_DLLPUBLIC)
33 
34 class SVL_DLLPUBLIC CntUnencodedStringItem: public SfxPoolItem
35 {
36     XubString m_aValue;
37 
38 public:
39     TYPEINFO();
40 
CntUnencodedStringItem(sal_uInt16 which=0)41     CntUnencodedStringItem(sal_uInt16 which = 0): SfxPoolItem(which)
42     { DBG_CTOR(CntUnencodedStringItem, 0); }
43 
CntUnencodedStringItem(sal_uInt16 which,const XubString & rTheValue)44     CntUnencodedStringItem(sal_uInt16 which, const XubString & rTheValue):
45         SfxPoolItem(which), m_aValue(rTheValue)
46     { DBG_CTOR(CntUnencodedStringItem, 0); }
47 
CntUnencodedStringItem(const CntUnencodedStringItem & rItem)48     CntUnencodedStringItem(const CntUnencodedStringItem & rItem):
49         SfxPoolItem(rItem), m_aValue(rItem.m_aValue)
50     { DBG_CTOR(CntUnencodedStringItem, 0); }
51 
~CntUnencodedStringItem()52     virtual ~CntUnencodedStringItem() { DBG_DTOR(CntUnencodedStringItem, 0); }
53 
54     virtual int operator ==(const SfxPoolItem & rItem) const;
55 
56     virtual int Compare(const SfxPoolItem & rWith) const;
57 
58     virtual int Compare(SfxPoolItem const & rWith,
59                         IntlWrapper const & rIntlWrapper) const;
60 
61     virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
62                                                 SfxMapUnit, SfxMapUnit,
63                                                 XubString & rText,
64                                                 const IntlWrapper * = 0)
65         const;
66 
67     virtual sal_Bool QueryValue(com::sun::star::uno::Any& rVal,
68                             sal_uInt8 nMemberId = 0) const;
69 
70     virtual sal_Bool PutValue(const com::sun::star::uno::Any& rVal,
71                           sal_uInt8 nMemberId = 0);
72 
73     virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
74 
GetValue() const75     const XubString & GetValue() const { return m_aValue; }
76 
77     inline void SetValue(const XubString & rTheValue);
78 };
79 
SetValue(const XubString & rTheValue)80 inline void CntUnencodedStringItem::SetValue(const XubString & rTheValue)
81 {
82     DBG_ASSERT(GetRefCount() == 0,
83                "CntUnencodedStringItem::SetValue(): Pooled item");
84     m_aValue = rTheValue;
85 }
86 
87 #endif //  _SVTOOLS_CUSTRITM_HXX
88 
89