xref: /aoo42x/main/editeng/inc/editeng/bulitem.hxx (revision 4c5491ea)
1*4c5491eaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*4c5491eaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*4c5491eaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*4c5491eaSAndrew Rist  * distributed with this work for additional information
6*4c5491eaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*4c5491eaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*4c5491eaSAndrew Rist  * "License"); you may not use this file except in compliance
9*4c5491eaSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*4c5491eaSAndrew Rist  *
11*4c5491eaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*4c5491eaSAndrew Rist  *
13*4c5491eaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*4c5491eaSAndrew Rist  * software distributed under the License is distributed on an
15*4c5491eaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*4c5491eaSAndrew Rist  * KIND, either express or implied.  See the License for the
17*4c5491eaSAndrew Rist  * specific language governing permissions and limitations
18*4c5491eaSAndrew Rist  * under the License.
19*4c5491eaSAndrew Rist  *
20*4c5491eaSAndrew Rist  *************************************************************/
21*4c5491eaSAndrew Rist 
22*4c5491eaSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SVX_BULITEM_HXX
24cdf0e10cSrcweir #define _SVX_BULITEM_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir // include ---------------------------------------------------------------
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include "editeng/editengdllapi.h"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir 
31cdf0e10cSrcweir // define ----------------------------------------------------------------
32cdf0e10cSrcweir 
33cdf0e10cSrcweir // Styles
34cdf0e10cSrcweir #define BS_ABC_BIG          0
35cdf0e10cSrcweir #define BS_ABC_SMALL        1
36cdf0e10cSrcweir #define BS_ROMAN_BIG        2
37cdf0e10cSrcweir #define BS_ROMAN_SMALL      3
38cdf0e10cSrcweir #define BS_123              4
39cdf0e10cSrcweir #define BS_NONE             5
40cdf0e10cSrcweir #define BS_BULLET           6
41cdf0e10cSrcweir #define BS_BMP              128
42cdf0e10cSrcweir 
43cdf0e10cSrcweir // Justification
44cdf0e10cSrcweir #define BJ_HLEFT            0x01
45cdf0e10cSrcweir #define BJ_HRIGHT           0x02
46cdf0e10cSrcweir #define BJ_HCENTER          0x04
47cdf0e10cSrcweir #define BJ_VTOP             0x08
48cdf0e10cSrcweir #define BJ_VBOTTOM          0x10
49cdf0e10cSrcweir #define BJ_VCENTER          0x20
50cdf0e10cSrcweir 
51cdf0e10cSrcweir // Valid-Bits
52cdf0e10cSrcweir // Erstmal nur die Werte, die vom Dialog geaendert werden...
53cdf0e10cSrcweir #define VALID_FONTCOLOR     0x0001
54cdf0e10cSrcweir #define VALID_FONTNAME      0x0002
55cdf0e10cSrcweir #define VALID_SYMBOL        0x0004
56cdf0e10cSrcweir #define VALID_BITMAP        0x0008
57cdf0e10cSrcweir #define VALID_SCALE         0x0010
58cdf0e10cSrcweir #define VALID_START         0x0020
59cdf0e10cSrcweir #define VALID_STYLE         0x0040
60cdf0e10cSrcweir #define VALID_PREVTEXT      0x0080
61cdf0e10cSrcweir #define VALID_FOLLOWTEXT    0x0100
62cdf0e10cSrcweir #include <svl/poolitem.hxx>
63cdf0e10cSrcweir #include <vcl/font.hxx>
64cdf0e10cSrcweir #include <svtools/grfmgr.hxx>
65cdf0e10cSrcweir 
66cdf0e10cSrcweir // class SvxBulletItem ---------------------------------------------------
67cdf0e10cSrcweir 
68cdf0e10cSrcweir class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
69cdf0e10cSrcweir {
70cdf0e10cSrcweir     Font            aFont;
71cdf0e10cSrcweir     GraphicObject*  pGraphicObject;
72cdf0e10cSrcweir     String          aPrevText;
73cdf0e10cSrcweir     String          aFollowText;
74cdf0e10cSrcweir     sal_uInt16          nStart;
75cdf0e10cSrcweir     sal_uInt16          nStyle;
76cdf0e10cSrcweir     long            nWidth;
77cdf0e10cSrcweir     sal_uInt16          nScale;
78cdf0e10cSrcweir     sal_Unicode     cSymbol;
79cdf0e10cSrcweir     sal_uInt8            nJustify;
80cdf0e10cSrcweir     sal_uInt16          nValidMask; // Nur temporaer fuer GetAttribs/SetAttribs, wegen des grossen Bullets
81cdf0e10cSrcweir 
82cdf0e10cSrcweir #ifdef _SVX_BULITEM_CXX
83cdf0e10cSrcweir     void    SetDefaultFont_Impl();
84cdf0e10cSrcweir     void    SetDefaults_Impl();
85cdf0e10cSrcweir #endif
86cdf0e10cSrcweir 
87cdf0e10cSrcweir public:
88cdf0e10cSrcweir     TYPEINFO();
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     SvxBulletItem( sal_uInt16 nWhich = 0 );
91cdf0e10cSrcweir     SvxBulletItem( sal_uInt8 nStyle, const Font& rFont, sal_uInt16 nStart = 0, sal_uInt16 nWhich = 0 );
92cdf0e10cSrcweir     SvxBulletItem( const Font& rFont, sal_Unicode cSymbol, sal_uInt16 nWhich=0 );
93cdf0e10cSrcweir     SvxBulletItem( const Bitmap&, sal_uInt16 nWhich = 0 );
94cdf0e10cSrcweir     SvxBulletItem( const GraphicObject&, sal_uInt16 nWhich = 0 );
95cdf0e10cSrcweir     SvxBulletItem( SvStream& rStrm, sal_uInt16 nWhich = 0 );
96cdf0e10cSrcweir     SvxBulletItem( const SvxBulletItem& );
97cdf0e10cSrcweir     ~SvxBulletItem();
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
100cdf0e10cSrcweir     virtual SfxPoolItem*    Create( SvStream&, sal_uInt16 nVersion ) const;
101cdf0e10cSrcweir     virtual SvStream&       Store( SvStream & , sal_uInt16 nItemVersion ) const;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     String              GetFullText() const;
GetSymbol() const104cdf0e10cSrcweir     sal_Unicode         GetSymbol() const { return cSymbol; }
GetPrevText() const105cdf0e10cSrcweir     String              GetPrevText() const { return aPrevText; }
GetFollowText() const106cdf0e10cSrcweir     String              GetFollowText() const { return aFollowText; }
107cdf0e10cSrcweir 
GetStart() const108cdf0e10cSrcweir     sal_uInt16              GetStart() const { return nStart; }
GetWidth() const109cdf0e10cSrcweir     long                GetWidth() const { return nWidth; }
GetStyle() const110cdf0e10cSrcweir     sal_uInt16              GetStyle() const { return nStyle; }
GetJustification() const111cdf0e10cSrcweir     sal_uInt8                GetJustification() const { return nJustify; }
GetFont() const112cdf0e10cSrcweir     Font                GetFont() const { return aFont; }
GetScale() const113cdf0e10cSrcweir     sal_uInt16              GetScale() const { return nScale; }
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     Bitmap              GetBitmap() const;
116cdf0e10cSrcweir     void                SetBitmap( const Bitmap& rBmp );
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     const GraphicObject& GetGraphicObject() const;
119cdf0e10cSrcweir     void                 SetGraphicObject( const GraphicObject& rGraphicObject );
120cdf0e10cSrcweir 
SetSymbol(sal_Unicode c)121cdf0e10cSrcweir     void                SetSymbol( sal_Unicode c) { cSymbol = c; }
SetPrevText(const String & rStr)122cdf0e10cSrcweir     void                SetPrevText( const String& rStr) { aPrevText = rStr;}
SetFollowText(const String & rStr)123cdf0e10cSrcweir     void                SetFollowText(const String& rStr) { aFollowText=rStr;}
124cdf0e10cSrcweir 
SetStart(sal_uInt16 nNew)125cdf0e10cSrcweir     void                SetStart( sal_uInt16 nNew ) { nStart = nNew; }
SetWidth(long nNew)126cdf0e10cSrcweir     void                SetWidth( long nNew ) { nWidth = nNew; }
SetStyle(sal_uInt16 nNew)127cdf0e10cSrcweir     void                SetStyle( sal_uInt16 nNew ) { nStyle = nNew; }
SetJustification(sal_uInt8 nNew)128cdf0e10cSrcweir     void                SetJustification( sal_uInt8 nNew ) { nJustify = nNew; }
SetFont(const Font & rNew)129cdf0e10cSrcweir     void                SetFont( const Font& rNew) { aFont = rNew; }
SetScale(sal_uInt16 nNew)130cdf0e10cSrcweir     void                SetScale( sal_uInt16 nNew ) { nScale = nNew; }
131cdf0e10cSrcweir 
132cdf0e10cSrcweir     virtual sal_uInt16      GetVersion(sal_uInt16 nFileVersion) const;
133cdf0e10cSrcweir     virtual int         operator==( const SfxPoolItem& ) const;
134cdf0e10cSrcweir     virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
135cdf0e10cSrcweir                                     SfxMapUnit eCoreMetric,
136cdf0e10cSrcweir                                     SfxMapUnit ePresMetric,
137cdf0e10cSrcweir                                     String &rText, const IntlWrapper * = 0 ) const;
138cdf0e10cSrcweir 
139cdf0e10cSrcweir     static void         StoreFont( SvStream&, const Font& );
140cdf0e10cSrcweir     static Font         CreateFont( SvStream&, sal_uInt16 nVer );
141cdf0e10cSrcweir 
GetValidMask()142cdf0e10cSrcweir     sal_uInt16&             GetValidMask()                  { return nValidMask;    }
GetValidMask() const143cdf0e10cSrcweir     sal_uInt16              GetValidMask() const            { return nValidMask;    }
IsValid(sal_uInt16 nFlag) const144cdf0e10cSrcweir     sal_uInt16              IsValid( sal_uInt16 nFlag ) const   { return nValidMask & nFlag; }
SetValid(sal_uInt16 nFlag,sal_Bool bValid)145cdf0e10cSrcweir     void                SetValid( sal_uInt16 nFlag, sal_Bool bValid )
146cdf0e10cSrcweir                         {
147cdf0e10cSrcweir                             if ( bValid )
148cdf0e10cSrcweir                                 nValidMask |= nFlag;
149cdf0e10cSrcweir                             else
150cdf0e10cSrcweir                                 nValidMask &= ~nFlag;
151cdf0e10cSrcweir                         }
152cdf0e10cSrcweir     void                CopyValidProperties( const SvxBulletItem& rCopyFrom );
153cdf0e10cSrcweir };
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 
156cdf0e10cSrcweir #endif
157