Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_EDITENG_BULLETITEM_HXX
20 : #define INCLUDED_EDITENG_BULLETITEM_HXX
21 :
22 : #include <editeng/editengdllapi.h>
23 :
24 :
25 : // define ----------------------------------------------------------------
26 :
27 : // Styles
28 : #define BS_ABC_BIG 0
29 : #define BS_ABC_SMALL 1
30 : #define BS_ROMAN_BIG 2
31 : #define BS_ROMAN_SMALL 3
32 : #define BS_123 4
33 : #define BS_NONE 5
34 : #define BS_BULLET 6
35 : #define BS_BMP 128
36 :
37 : // Justification
38 : #define BJ_HLEFT 0x01
39 : #define BJ_HRIGHT 0x02
40 : #define BJ_HCENTER 0x04
41 : #define BJ_VTOP 0x08
42 : #define BJ_VBOTTOM 0x10
43 : #define BJ_VCENTER 0x20
44 :
45 : // Valid-Bits
46 : // First, only the values that are changed by the dialogue ...
47 : #define VALID_FONTCOLOR 0x0001
48 : #define VALID_FONTNAME 0x0002
49 : #define VALID_SYMBOL 0x0004
50 : #define VALID_BITMAP 0x0008
51 : #define VALID_SCALE 0x0010
52 : #define VALID_START 0x0020
53 : #define VALID_STYLE 0x0040
54 : #define VALID_PREVTEXT 0x0080
55 : #define VALID_FOLLOWTEXT 0x0100
56 : #include <svl/poolitem.hxx>
57 : #include <vcl/font.hxx>
58 : #include <svtools/grfmgr.hxx>
59 :
60 : // class SvxBulletItem ---------------------------------------------------
61 :
62 : class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
63 : {
64 : vcl::Font aFont;
65 : GraphicObject* pGraphicObject;
66 : OUString aPrevText;
67 : OUString aFollowText;
68 : sal_uInt16 nStart;
69 : sal_uInt16 nStyle;
70 : long nWidth;
71 : sal_uInt16 nScale;
72 : sal_Unicode cSymbol;
73 : sal_uInt8 nJustify;
74 : sal_uInt16 nValidMask; // Only temporary for GetAttribs / setAttribs,
75 : // because of the large Bullets
76 :
77 : void SetDefaultFont_Impl();
78 : void SetDefaults_Impl();
79 :
80 : public:
81 : TYPEINFO_OVERRIDE();
82 :
83 : explicit SvxBulletItem( sal_uInt16 nWhich = 0 );
84 : explicit SvxBulletItem( SvStream& rStrm, sal_uInt16 nWhich = 0 );
85 : SvxBulletItem( const SvxBulletItem& );
86 : virtual ~SvxBulletItem();
87 :
88 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
89 : virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nVersion ) const SAL_OVERRIDE;
90 : virtual SvStream& Store( SvStream & , sal_uInt16 nItemVersion ) const SAL_OVERRIDE;
91 :
92 : OUString GetFullText() const;
93 0 : sal_Unicode GetSymbol() const { return cSymbol; }
94 0 : OUString GetPrevText() const { return aPrevText; }
95 0 : OUString GetFollowText() const { return aFollowText; }
96 :
97 0 : sal_uInt16 GetStart() const { return nStart; }
98 0 : long GetWidth() const { return nWidth; }
99 0 : sal_uInt16 GetStyle() const { return nStyle; }
100 : sal_uInt8 GetJustification() const { return nJustify; }
101 0 : vcl::Font GetFont() const { return aFont; }
102 0 : sal_uInt16 GetScale() const { return nScale; }
103 :
104 : const GraphicObject& GetGraphicObject() const;
105 : void SetGraphicObject( const GraphicObject& rGraphicObject );
106 :
107 806 : void SetSymbol( sal_Unicode c) { cSymbol = c; }
108 0 : void SetPrevText( const OUString& rStr) { aPrevText = rStr;}
109 0 : void SetFollowText(const OUString& rStr) { aFollowText=rStr;}
110 :
111 806 : void SetStart( sal_uInt16 nNew ) { nStart = nNew; }
112 0 : void SetWidth( long nNew ) { nWidth = nNew; }
113 806 : void SetStyle( sal_uInt16 nNew ) { nStyle = nNew; }
114 : void SetJustification( sal_uInt8 nNew ) { nJustify = nNew; }
115 806 : void SetFont( const vcl::Font& rNew) { aFont = rNew; }
116 806 : void SetScale( sal_uInt16 nNew ) { nScale = nNew; }
117 :
118 : virtual sal_uInt16 GetVersion(sal_uInt16 nFileVersion) const SAL_OVERRIDE;
119 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
120 : virtual bool GetPresentation( SfxItemPresentation ePres,
121 : SfxMapUnit eCoreMetric,
122 : SfxMapUnit ePresMetric,
123 : OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
124 :
125 : static void StoreFont( SvStream&, const vcl::Font& );
126 : static vcl::Font CreateFont( SvStream&, sal_uInt16 nVer );
127 :
128 : sal_uInt16& GetValidMask() { return nValidMask; }
129 : sal_uInt16 GetValidMask() const { return nValidMask; }
130 0 : sal_uInt16 IsValid( sal_uInt16 nFlag ) const { return nValidMask & nFlag; }
131 : void SetValid( sal_uInt16 nFlag, bool bValid )
132 : {
133 : if ( bValid )
134 : nValidMask |= nFlag;
135 : else
136 : nValidMask &= ~nFlag;
137 : }
138 : void CopyValidProperties( const SvxBulletItem& rCopyFrom );
139 : };
140 :
141 :
142 : #endif
143 :
144 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|