merge the formfield patch from ooo-build
[ooovba.git] / svx / inc / bulitem.hxx
blob4f2b665408776b002cc8a9e66bac4ca2ef2e86b0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: bulitem.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_BULITEM_HXX
31 #define _SVX_BULITEM_HXX
33 // include ---------------------------------------------------------------
35 #include "svx/svxdllapi.h"
38 // define ----------------------------------------------------------------
40 // Styles
41 #define BS_ABC_BIG 0
42 #define BS_ABC_SMALL 1
43 #define BS_ROMAN_BIG 2
44 #define BS_ROMAN_SMALL 3
45 #define BS_123 4
46 #define BS_NONE 5
47 #define BS_BULLET 6
48 #define BS_BMP 128
50 // Justification
51 #define BJ_HLEFT 0x01
52 #define BJ_HRIGHT 0x02
53 #define BJ_HCENTER 0x04
54 #define BJ_VTOP 0x08
55 #define BJ_VBOTTOM 0x10
56 #define BJ_VCENTER 0x20
58 // Valid-Bits
59 // Erstmal nur die Werte, die vom Dialog geaendert werden...
60 #define VALID_FONTCOLOR 0x0001
61 #define VALID_FONTNAME 0x0002
62 #define VALID_SYMBOL 0x0004
63 #define VALID_BITMAP 0x0008
64 #define VALID_SCALE 0x0010
65 #define VALID_START 0x0020
66 #define VALID_STYLE 0x0040
67 #define VALID_PREVTEXT 0x0080
68 #define VALID_FOLLOWTEXT 0x0100
69 #include <svtools/poolitem.hxx>
70 #include <vcl/font.hxx>
71 #include <goodies/grfmgr.hxx>
73 // class SvxBulletItem ---------------------------------------------------
75 class SVX_DLLPUBLIC SvxBulletItem : public SfxPoolItem
77 Font aFont;
78 GraphicObject* pGraphicObject;
79 String aPrevText;
80 String aFollowText;
81 USHORT nStart;
82 USHORT nStyle;
83 long nWidth;
84 USHORT nScale;
85 sal_Unicode cSymbol;
86 BYTE nJustify;
87 USHORT nValidMask; // Nur temporaer fuer GetAttribs/SetAttribs, wegen des grossen Bullets
89 #ifdef _SVX_BULITEM_CXX
90 void SetDefaultFont_Impl();
91 void SetDefaults_Impl();
92 #endif
94 public:
95 TYPEINFO();
97 SvxBulletItem( USHORT nWhich = 0 );
98 SvxBulletItem( BYTE nStyle, const Font& rFont, USHORT nStart = 0, USHORT nWhich = 0 );
99 SvxBulletItem( const Font& rFont, sal_Unicode cSymbol, USHORT nWhich=0 );
100 SvxBulletItem( const Bitmap&, USHORT nWhich = 0 );
101 SvxBulletItem( const GraphicObject&, USHORT nWhich = 0 );
102 SvxBulletItem( SvStream& rStrm, USHORT nWhich = 0 );
103 SvxBulletItem( const SvxBulletItem& );
104 ~SvxBulletItem();
106 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
107 virtual SfxPoolItem* Create( SvStream&, USHORT nVersion ) const;
108 virtual SvStream& Store( SvStream & , USHORT nItemVersion ) const;
110 String GetFullText() const;
111 sal_Unicode GetSymbol() const { return cSymbol; }
112 String GetPrevText() const { return aPrevText; }
113 String GetFollowText() const { return aFollowText; }
115 USHORT GetStart() const { return nStart; }
116 long GetWidth() const { return nWidth; }
117 USHORT GetStyle() const { return nStyle; }
118 BYTE GetJustification() const { return nJustify; }
119 Font GetFont() const { return aFont; }
120 USHORT GetScale() const { return nScale; }
122 Bitmap GetBitmap() const;
123 void SetBitmap( const Bitmap& rBmp );
125 const GraphicObject& GetGraphicObject() const;
126 void SetGraphicObject( const GraphicObject& rGraphicObject );
128 void SetSymbol( sal_Unicode c) { cSymbol = c; }
129 void SetPrevText( const String& rStr) { aPrevText = rStr;}
130 void SetFollowText(const String& rStr) { aFollowText=rStr;}
132 void SetStart( USHORT nNew ) { nStart = nNew; }
133 void SetWidth( long nNew ) { nWidth = nNew; }
134 void SetStyle( USHORT nNew ) { nStyle = nNew; }
135 void SetJustification( BYTE nNew ) { nJustify = nNew; }
136 void SetFont( const Font& rNew) { aFont = rNew; }
137 void SetScale( USHORT nNew ) { nScale = nNew; }
139 virtual USHORT GetVersion(USHORT nFileVersion) const;
140 virtual int operator==( const SfxPoolItem& ) const;
141 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
142 SfxMapUnit eCoreMetric,
143 SfxMapUnit ePresMetric,
144 String &rText, const IntlWrapper * = 0 ) const;
146 static void StoreFont( SvStream&, const Font& );
147 static Font CreateFont( SvStream&, USHORT nVer );
149 USHORT& GetValidMask() { return nValidMask; }
150 USHORT GetValidMask() const { return nValidMask; }
151 USHORT IsValid( USHORT nFlag ) const { return nValidMask & nFlag; }
152 void SetValid( USHORT nFlag, BOOL bValid )
154 if ( bValid )
155 nValidMask |= nFlag;
156 else
157 nValidMask &= ~nFlag;
159 void CopyValidProperties( const SvxBulletItem& rCopyFrom );
163 #endif