xref: /trunk/main/editeng/inc/editeng/bulitem.hxx (revision 4c5491ea)
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 #ifndef _SVX_BULITEM_HXX
24 #define _SVX_BULITEM_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include "editeng/editengdllapi.h"
29 
30 
31 // define ----------------------------------------------------------------
32 
33 // Styles
34 #define BS_ABC_BIG          0
35 #define BS_ABC_SMALL        1
36 #define BS_ROMAN_BIG        2
37 #define BS_ROMAN_SMALL      3
38 #define BS_123              4
39 #define BS_NONE             5
40 #define BS_BULLET           6
41 #define BS_BMP              128
42 
43 // Justification
44 #define BJ_HLEFT            0x01
45 #define BJ_HRIGHT           0x02
46 #define BJ_HCENTER          0x04
47 #define BJ_VTOP             0x08
48 #define BJ_VBOTTOM          0x10
49 #define BJ_VCENTER          0x20
50 
51 // Valid-Bits
52 // Erstmal nur die Werte, die vom Dialog geaendert werden...
53 #define VALID_FONTCOLOR     0x0001
54 #define VALID_FONTNAME      0x0002
55 #define VALID_SYMBOL        0x0004
56 #define VALID_BITMAP        0x0008
57 #define VALID_SCALE         0x0010
58 #define VALID_START         0x0020
59 #define VALID_STYLE         0x0040
60 #define VALID_PREVTEXT      0x0080
61 #define VALID_FOLLOWTEXT    0x0100
62 #include <svl/poolitem.hxx>
63 #include <vcl/font.hxx>
64 #include <svtools/grfmgr.hxx>
65 
66 // class SvxBulletItem ---------------------------------------------------
67 
68 class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
69 {
70     Font            aFont;
71     GraphicObject*  pGraphicObject;
72     String          aPrevText;
73     String          aFollowText;
74     sal_uInt16          nStart;
75     sal_uInt16          nStyle;
76     long            nWidth;
77     sal_uInt16          nScale;
78     sal_Unicode     cSymbol;
79     sal_uInt8            nJustify;
80     sal_uInt16          nValidMask; // Nur temporaer fuer GetAttribs/SetAttribs, wegen des grossen Bullets
81 
82 #ifdef _SVX_BULITEM_CXX
83     void    SetDefaultFont_Impl();
84     void    SetDefaults_Impl();
85 #endif
86 
87 public:
88     TYPEINFO();
89 
90     SvxBulletItem( sal_uInt16 nWhich = 0 );
91     SvxBulletItem( sal_uInt8 nStyle, const Font& rFont, sal_uInt16 nStart = 0, sal_uInt16 nWhich = 0 );
92     SvxBulletItem( const Font& rFont, sal_Unicode cSymbol, sal_uInt16 nWhich=0 );
93     SvxBulletItem( const Bitmap&, sal_uInt16 nWhich = 0 );
94     SvxBulletItem( const GraphicObject&, sal_uInt16 nWhich = 0 );
95     SvxBulletItem( SvStream& rStrm, sal_uInt16 nWhich = 0 );
96     SvxBulletItem( const SvxBulletItem& );
97     ~SvxBulletItem();
98 
99     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
100     virtual SfxPoolItem*    Create( SvStream&, sal_uInt16 nVersion ) const;
101     virtual SvStream&       Store( SvStream & , sal_uInt16 nItemVersion ) const;
102 
103     String              GetFullText() const;
GetSymbol() const104     sal_Unicode         GetSymbol() const { return cSymbol; }
GetPrevText() const105     String              GetPrevText() const { return aPrevText; }
GetFollowText() const106     String              GetFollowText() const { return aFollowText; }
107 
GetStart() const108     sal_uInt16              GetStart() const { return nStart; }
GetWidth() const109     long                GetWidth() const { return nWidth; }
GetStyle() const110     sal_uInt16              GetStyle() const { return nStyle; }
GetJustification() const111     sal_uInt8                GetJustification() const { return nJustify; }
GetFont() const112     Font                GetFont() const { return aFont; }
GetScale() const113     sal_uInt16              GetScale() const { return nScale; }
114 
115     Bitmap              GetBitmap() const;
116     void                SetBitmap( const Bitmap& rBmp );
117 
118     const GraphicObject& GetGraphicObject() const;
119     void                 SetGraphicObject( const GraphicObject& rGraphicObject );
120 
SetSymbol(sal_Unicode c)121     void                SetSymbol( sal_Unicode c) { cSymbol = c; }
SetPrevText(const String & rStr)122     void                SetPrevText( const String& rStr) { aPrevText = rStr;}
SetFollowText(const String & rStr)123     void                SetFollowText(const String& rStr) { aFollowText=rStr;}
124 
SetStart(sal_uInt16 nNew)125     void                SetStart( sal_uInt16 nNew ) { nStart = nNew; }
SetWidth(long nNew)126     void                SetWidth( long nNew ) { nWidth = nNew; }
SetStyle(sal_uInt16 nNew)127     void                SetStyle( sal_uInt16 nNew ) { nStyle = nNew; }
SetJustification(sal_uInt8 nNew)128     void                SetJustification( sal_uInt8 nNew ) { nJustify = nNew; }
SetFont(const Font & rNew)129     void                SetFont( const Font& rNew) { aFont = rNew; }
SetScale(sal_uInt16 nNew)130     void                SetScale( sal_uInt16 nNew ) { nScale = nNew; }
131 
132     virtual sal_uInt16      GetVersion(sal_uInt16 nFileVersion) const;
133     virtual int         operator==( const SfxPoolItem& ) const;
134     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
135                                     SfxMapUnit eCoreMetric,
136                                     SfxMapUnit ePresMetric,
137                                     String &rText, const IntlWrapper * = 0 ) const;
138 
139     static void         StoreFont( SvStream&, const Font& );
140     static Font         CreateFont( SvStream&, sal_uInt16 nVer );
141 
GetValidMask()142     sal_uInt16&             GetValidMask()                  { return nValidMask;    }
GetValidMask() const143     sal_uInt16              GetValidMask() const            { return nValidMask;    }
IsValid(sal_uInt16 nFlag) const144     sal_uInt16              IsValid( sal_uInt16 nFlag ) const   { return nValidMask & nFlag; }
SetValid(sal_uInt16 nFlag,sal_Bool bValid)145     void                SetValid( sal_uInt16 nFlag, sal_Bool bValid )
146                         {
147                             if ( bValid )
148                                 nValidMask |= nFlag;
149                             else
150                                 nValidMask &= ~nFlag;
151                         }
152     void                CopyValidProperties( const SvxBulletItem& rCopyFrom );
153 };
154 
155 
156 #endif
157