Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _SVX_BRSHITEM_HXX
29 : : #define _SVX_BRSHITEM_HXX
30 : :
31 : : #include <svl/poolitem.hxx>
32 : : #include <vcl/wall.hxx>
33 : : #include <tools/link.hxx>
34 : : #include <editeng/editengdllapi.h>
35 : :
36 : : // class SvxBrushItem ----------------------------------------------------
37 : :
38 : : class Graphic;
39 : : class GraphicObject;
40 : : class CntWallpaperItem;
41 : : namespace rtl
42 : : {
43 : : class OUString;
44 : : }
45 : :
46 : : #define BRUSH_GRAPHIC_VERSION ((sal_uInt16)0x0001)
47 : :
48 : : enum SvxGraphicPosition
49 : : {
50 : : GPOS_NONE,
51 : : GPOS_LT, GPOS_MT, GPOS_RT,
52 : : GPOS_LM, GPOS_MM, GPOS_RM,
53 : : GPOS_LB, GPOS_MB, GPOS_RB,
54 : : GPOS_AREA, GPOS_TILED
55 : : };
56 : :
57 : : #define PARA_DEST_PARA 0
58 : : #define PARA_DEST_CHAR 1
59 : :
60 : : class SvxBrushItem_Impl;
61 : : class EDITENG_DLLPUBLIC SvxBrushItem : public SfxPoolItem
62 : : {
63 : : Color aColor;
64 : : SvxBrushItem_Impl* pImpl;
65 : : String* pStrLink;
66 : : String* pStrFilter;
67 : : SvxGraphicPosition eGraphicPos;
68 : : sal_Bool bLoadAgain;
69 : :
70 : : void ApplyGraphicTransparency_Impl();
71 : : DECL_STATIC_LINK( SvxBrushItem, DoneHdl_Impl, void *);
72 : : // wird nur von Create benutzt
73 : : SvxBrushItem( SvStream& rStrm,
74 : : sal_uInt16 nVersion, sal_uInt16 nWhich );
75 : :
76 : : public:
77 : : TYPEINFO();
78 : :
79 : : SvxBrushItem( sal_uInt16 nWhich );
80 : : SvxBrushItem( const Color& rColor, sal_uInt16 nWhich );
81 : :
82 : : SvxBrushItem( const Graphic& rGraphic,
83 : : SvxGraphicPosition ePos, sal_uInt16 nWhich );
84 : : SvxBrushItem( const GraphicObject& rGraphicObj,
85 : : SvxGraphicPosition ePos, sal_uInt16 nWhich );
86 : : SvxBrushItem( const String& rLink, const String& rFilter,
87 : : SvxGraphicPosition ePos, sal_uInt16 nWhich );
88 : : SvxBrushItem( const SvxBrushItem& );
89 : : SvxBrushItem( const CntWallpaperItem&, sal_uInt16 nWhich );
90 : :
91 : : ~SvxBrushItem();
92 : :
93 : : public:
94 : :
95 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
96 : : SfxMapUnit eCoreMetric,
97 : : SfxMapUnit ePresMetric,
98 : : String &rText, const IntlWrapper * = 0 ) const;
99 : :
100 : : virtual int operator==( const SfxPoolItem& ) const;
101 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
102 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
103 : :
104 : : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
105 : : virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nVersion ) const;
106 : : virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
107 : : virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
108 : :
109 : 214791 : const Color& GetColor() const { return aColor; }
110 : 5145 : Color& GetColor() { return aColor; }
111 : 740 : void SetColor( const Color& rCol) { aColor = rCol; }
112 : :
113 : : void SetDoneLink( const Link& rLink );
114 : :
115 : 222964 : SvxGraphicPosition GetGraphicPos() const { return eGraphicPos; }
116 : :
117 : : void PurgeMedium() const;
118 : :
119 : : const Graphic* GetGraphic() const;
120 : : const GraphicObject* GetGraphicObject() const;
121 : 0 : const String* GetGraphicLink() const { return pStrLink; }
122 : 0 : const String* GetGraphicFilter() const { return pStrFilter; }
123 : :
124 : : void SetGraphicPos( SvxGraphicPosition eNew );
125 : : void SetGraphic( const Graphic& rNew );
126 : : void SetGraphicObject( const GraphicObject& rNewObj );
127 : : void SetGraphicLink( const String& rNew );
128 : : void SetGraphicFilter( const String& rNew );
129 : :
130 : : SvxBrushItem& operator=( const SvxBrushItem& rItem);
131 : :
132 : : static SvxGraphicPosition WallpaperStyle2GraphicPos( WallpaperStyle eStyle );
133 : : static WallpaperStyle GraphicPos2WallpaperStyle( SvxGraphicPosition ePos );
134 : : };
135 : :
136 : : #endif // #ifndef _SVX_BRSHITEM_HXX
137 : :
138 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|