xref: /trunk/main/svx/inc/svx/xbtmpit.hxx (revision 70d3707a)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef _SVX_XBTMPIT_HXX
23 #define _SVX_XBTMPIT_HXX
24 
25 #include <svx/svxdllapi.h>
26 #include <svx/xit.hxx>
27 #include <svtools/grfmgr.hxx>
28 
29 class SdrModel;
30 class BitmapColor;
31 
32 //////////////////////////////////////////////////////////////////////////////
33 // helper to construct historical 8x8 bitmaps with two colors
34 
35 Bitmap SVX_DLLPUBLIC createHistorical8x8FromArray(const sal_uInt16* pArray, Color aColorPix, Color aColorBack);
36 bool SVX_DLLPUBLIC isHistorical8x8(const BitmapEx& rBitmapEx, BitmapColor& o_rBack, BitmapColor& o_rFront);
37 
38 //////////////////////////////////////////////////////////////////////////////
39 // class XFillBitmapItem
40 
41 class SVX_DLLPUBLIC XFillBitmapItem : public NameOrIndex
42 {
43 private:
44 	GraphicObject   maGraphicObject;
45 
46 public:
47 			TYPEINFO();
XFillBitmapItem()48 			XFillBitmapItem() : NameOrIndex(XATTR_FILLBITMAP, -1 ) {}
49 			XFillBitmapItem(long nIndex, const GraphicObject& rGraphicObject);
50 			XFillBitmapItem(const String& rName, const GraphicObject& rGraphicObject);
51 			XFillBitmapItem(SfxItemPool* pPool, const GraphicObject& rGraphicObject);
52 			XFillBitmapItem( SfxItemPool* pPool );
53 			XFillBitmapItem( const XFillBitmapItem& rItem );
54 			XFillBitmapItem( SvStream& rIn, sal_uInt16 nVer = 0 );
55 
56 	virtual int             operator==( const SfxPoolItem& rItem ) const;
57 	virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const;
58 	virtual SfxPoolItem*    Create( SvStream& rIn, sal_uInt16 nVer ) const;
59 	virtual SvStream&       Store( SvStream& rOut, sal_uInt16 nItemVersion  ) const;
60 	virtual sal_uInt16          GetVersion( sal_uInt16 nFileFormatVersion ) const;
61 
62 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
63 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
64 
65 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
66 									SfxMapUnit eCoreMetric,
67 									SfxMapUnit ePresMetric,
68                                     String &rText, const IntlWrapper * = 0 ) const;
69 
70     const GraphicObject& GetGraphicObject() const;
71     void SetGraphicObject(const GraphicObject& rGraphicObject);
72 
73 	static sal_Bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
74 	XFillBitmapItem* checkForUniqueItem( SdrModel* pModel ) const;
75 };
76 
77 #endif
78