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 : namespace rtl
33 : {
34 : class OUString;
35 : }
36 :
37 : #define BRUSH_GRAPHIC_VERSION ((sal_uInt16)0x0001)
38 :
39 : enum SvxGraphicPosition
40 : {
41 : GPOS_NONE,
42 : GPOS_LT, GPOS_MT, GPOS_RT,
43 : GPOS_LM, GPOS_MM, GPOS_RM,
44 : GPOS_LB, GPOS_MB, GPOS_RB,
45 : GPOS_AREA, GPOS_TILED
46 : };
47 :
48 : #define PARA_DEST_PARA 0
49 : #define PARA_DEST_CHAR 1
50 :
51 : class SvxBrushItem_Impl;
52 : class EDITENG_DLLPUBLIC SvxBrushItem : public SfxPoolItem
53 : {
54 : Color aColor;
55 : SvxBrushItem_Impl* pImpl;
56 : String* pStrLink;
57 : String* pStrFilter;
58 : SvxGraphicPosition eGraphicPos;
59 : sal_Bool bLoadAgain;
60 :
61 : void ApplyGraphicTransparency_Impl();
62 : DECL_STATIC_LINK( SvxBrushItem, DoneHdl_Impl, void *);
63 : // wird nur von Create benutzt
64 : SvxBrushItem( SvStream& rStrm,
65 : sal_uInt16 nVersion, sal_uInt16 nWhich );
66 :
67 : public:
68 : TYPEINFO();
69 :
70 : explicit SvxBrushItem( sal_uInt16 nWhich );
71 : SvxBrushItem( const Color& rColor, sal_uInt16 nWhich );
72 :
73 : SvxBrushItem( const Graphic& rGraphic,
74 : SvxGraphicPosition ePos, sal_uInt16 nWhich );
75 : SvxBrushItem( const GraphicObject& rGraphicObj,
76 : SvxGraphicPosition ePos, sal_uInt16 nWhich );
77 : SvxBrushItem( const String& rLink, const String& rFilter,
78 : SvxGraphicPosition ePos, sal_uInt16 nWhich );
79 : SvxBrushItem( const SvxBrushItem& );
80 : SvxBrushItem( const CntWallpaperItem&, sal_uInt16 nWhich );
81 :
82 : ~SvxBrushItem();
83 :
84 : public:
85 :
86 : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
87 : SfxMapUnit eCoreMetric,
88 : SfxMapUnit ePresMetric,
89 : String &rText, const IntlWrapper * = 0 ) const;
90 :
91 : virtual int operator==( const SfxPoolItem& ) const;
92 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
93 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
94 :
95 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
96 : virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nVersion ) const;
97 : virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const;
98 : virtual sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
99 :
100 5969 : const Color& GetColor() const { return aColor; }
101 13 : Color& GetColor() { return aColor; }
102 1147 : void SetColor( const Color& rCol) { aColor = rCol; }
103 :
104 : void SetDoneLink( const Link& rLink );
105 :
106 7817 : SvxGraphicPosition GetGraphicPos() const { return eGraphicPos; }
107 :
108 : void PurgeMedium() const;
109 :
110 : const Graphic* GetGraphic() const;
111 : const GraphicObject* GetGraphicObject() const;
112 0 : const String* GetGraphicLink() const { return pStrLink; }
113 0 : const String* GetGraphicFilter() const { return pStrFilter; }
114 :
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: */
|