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 _SVX_BRSHITEM_HXX
20 : #define _SVX_BRSHITEM_HXX
21 :
22 : #include <svl/poolitem.hxx>
23 : #include <vcl/wall.hxx>
24 : #include <tools/link.hxx>
25 : #include <editeng/editengdllapi.h>
26 :
27 : // class SvxBrushItem ----------------------------------------------------
28 :
29 : class Graphic;
30 : class GraphicObject;
31 : class CntWallpaperItem;
32 : class String;
33 :
34 : #define BRUSH_GRAPHIC_VERSION ((sal_uInt16)0x0001)
35 :
36 : enum SvxGraphicPosition
37 : {
38 : GPOS_NONE,
39 : GPOS_LT, GPOS_MT, GPOS_RT,
40 : GPOS_LM, GPOS_MM, GPOS_RM,
41 : GPOS_LB, GPOS_MB, GPOS_RB,
42 : GPOS_AREA, GPOS_TILED
43 : };
44 :
45 : #define PARA_DEST_PARA 0
46 : #define PARA_DEST_CHAR 1
47 :
48 : class SvxBrushItem_Impl;
49 : class EDITENG_DLLPUBLIC SvxBrushItem : public SfxPoolItem
50 : {
51 : Color aColor;
52 : sal_Int32 nShadingValue;
53 : SvxBrushItem_Impl* pImpl;
54 : String* pStrLink;
55 : String* pStrFilter;
56 : SvxGraphicPosition eGraphicPos;
57 : sal_Bool bLoadAgain;
58 :
59 : void ApplyGraphicTransparency_Impl();
60 : DECL_STATIC_LINK( SvxBrushItem, DoneHdl_Impl, void *);
61 : // wird nur von Create benutzt
62 : SvxBrushItem( SvStream& rStrm,
63 : sal_uInt16 nVersion, sal_uInt16 nWhich );
64 :
65 : public:
66 : TYPEINFO();
67 :
68 : explicit SvxBrushItem( sal_uInt16 nWhich );
69 : SvxBrushItem( const Color& rColor, sal_uInt16 nWhich );
70 :
71 : SvxBrushItem( const Graphic& rGraphic,
72 : SvxGraphicPosition ePos, sal_uInt16 nWhich );
73 : SvxBrushItem( const GraphicObject& rGraphicObj,
74 : SvxGraphicPosition ePos, sal_uInt16 nWhich );
75 : SvxBrushItem( const String& rLink, const String& rFilter,
76 : SvxGraphicPosition ePos, sal_uInt16 nWhich );
77 : SvxBrushItem( const SvxBrushItem& );
78 : SvxBrushItem( const CntWallpaperItem&, sal_uInt16 nWhich );
79 :
80 : ~SvxBrushItem();
81 :
82 : public:
83 :
84 : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
85 : SfxMapUnit eCoreMetric,
86 : SfxMapUnit ePresMetric,
87 : OUString &rText, const IntlWrapper * = 0 ) const;
88 :
89 : virtual int operator==( const SfxPoolItem& ) const;
90 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
91 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
92 :
93 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
94 : virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nVersion ) const;
95 : virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
96 : virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
97 :
98 103896 : const Color& GetColor() const { return aColor; }
99 3681 : Color& GetColor() { return aColor; }
100 1310 : void SetColor( const Color& rCol) { aColor = rCol; }
101 :
102 : void SetDoneLink( const Link& rLink );
103 :
104 105514 : SvxGraphicPosition GetGraphicPos() const { return eGraphicPos; }
105 :
106 : void PurgeMedium() const;
107 :
108 2 : sal_uInt32 GetShadingValue() const { return nShadingValue; }
109 : const Graphic* GetGraphic() const;
110 : const GraphicObject* GetGraphicObject() const;
111 271 : const String* GetGraphicLink() const { return pStrLink; }
112 0 : const String* GetGraphicFilter() const { return pStrFilter; }
113 :
114 : void SetShadingValue( const sal_uInt32 nNew );
115 : void SetGraphicPos( SvxGraphicPosition eNew );
116 : void SetGraphic( const Graphic& rNew );
117 : void SetGraphicObject( const GraphicObject& rNewObj );
118 : void SetGraphicLink( const String& rNew );
119 : void SetGraphicFilter( const String& rNew );
120 :
121 : SvxBrushItem& operator=( const SvxBrushItem& rItem);
122 :
123 : static SvxGraphicPosition WallpaperStyle2GraphicPos( WallpaperStyle eStyle );
124 : static WallpaperStyle GraphicPos2WallpaperStyle( SvxGraphicPosition ePos );
125 : };
126 :
127 : #endif // #ifndef _SVX_BRSHITEM_HXX
128 :
129 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|