1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _SVX_BRSHITEM_HXX
20 #define _SVX_BRSHITEM_HXX
22 #include <svl/poolitem.hxx>
23 #include <vcl/wall.hxx>
24 #include <tools/link.hxx>
25 #include <editeng/editengdllapi.h>
27 // class SvxBrushItem ----------------------------------------------------
31 class CntWallpaperItem
;
33 #define BRUSH_GRAPHIC_VERSION ((sal_uInt16)0x0001)
35 enum SvxGraphicPosition
38 GPOS_LT
, GPOS_MT
, GPOS_RT
,
39 GPOS_LM
, GPOS_MM
, GPOS_RM
,
40 GPOS_LB
, GPOS_MB
, GPOS_RB
,
44 #define PARA_DEST_PARA 0
45 #define PARA_DEST_CHAR 1
47 class SvxBrushItem_Impl
;
48 class EDITENG_DLLPUBLIC SvxBrushItem
: public SfxPoolItem
51 SvxBrushItem_Impl
* pImpl
;
54 SvxGraphicPosition eGraphicPos
;
57 void ApplyGraphicTransparency_Impl();
58 DECL_STATIC_LINK( SvxBrushItem
, DoneHdl_Impl
, void *);
59 // wird nur von Create benutzt
60 SvxBrushItem( SvStream
& rStrm
,
61 sal_uInt16 nVersion
, sal_uInt16 nWhich
);
66 explicit SvxBrushItem( sal_uInt16 nWhich
);
67 SvxBrushItem( const Color
& rColor
, sal_uInt16 nWhich
);
69 SvxBrushItem( const Graphic
& rGraphic
,
70 SvxGraphicPosition ePos
, sal_uInt16 nWhich
);
71 SvxBrushItem( const GraphicObject
& rGraphicObj
,
72 SvxGraphicPosition ePos
, sal_uInt16 nWhich
);
73 SvxBrushItem( const String
& rLink
, const String
& rFilter
,
74 SvxGraphicPosition ePos
, sal_uInt16 nWhich
);
75 SvxBrushItem( const SvxBrushItem
& );
76 SvxBrushItem( const CntWallpaperItem
&, sal_uInt16 nWhich
);
82 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
83 SfxMapUnit eCoreMetric
,
84 SfxMapUnit ePresMetric
,
85 OUString
&rText
, const IntlWrapper
* = 0 ) const;
87 virtual int operator==( const SfxPoolItem
& ) const;
88 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const;
89 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 );
91 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
92 virtual SfxPoolItem
* Create( SvStream
&, sal_uInt16 nVersion
) const;
93 virtual SvStream
& Store( SvStream
& , sal_uInt16 nItemVersion
) const;
94 virtual sal_uInt16
GetVersion( sal_uInt16 nFileVersion
) const;
96 const Color
& GetColor() const { return aColor
; }
97 Color
& GetColor() { return aColor
; }
98 void SetColor( const Color
& rCol
) { aColor
= rCol
; }
100 void SetDoneLink( const Link
& rLink
);
102 SvxGraphicPosition
GetGraphicPos() const { return eGraphicPos
; }
104 void PurgeMedium() const;
106 const Graphic
* GetGraphic() const;
107 const GraphicObject
* GetGraphicObject() const;
108 const String
* GetGraphicLink() const { return pStrLink
; }
109 const String
* GetGraphicFilter() const { return pStrFilter
; }
111 void SetGraphicPos( SvxGraphicPosition eNew
);
112 void SetGraphic( const Graphic
& rNew
);
113 void SetGraphicObject( const GraphicObject
& rNewObj
);
114 void SetGraphicLink( const String
& rNew
);
115 void SetGraphicFilter( const String
& rNew
);
117 SvxBrushItem
& operator=( const SvxBrushItem
& rItem
);
119 static SvxGraphicPosition
WallpaperStyle2GraphicPos( WallpaperStyle eStyle
);
120 static WallpaperStyle
GraphicPos2WallpaperStyle( SvxGraphicPosition ePos
);
123 #endif // #ifndef _SVX_BRSHITEM_HXX
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */