merge the formfield patch from ooo-build
[ooovba.git] / binfilter / inc / bf_goodies / graphicobject.hxx
blob6fb2d6fd03bb22740903e5689f33a4a149978ec7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: graphicobject.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _BF_GOODIES_GRAPHICOBJECT_HXX
32 #define _BF_GOODIES_GRAPHICOBJECT_HXX
34 #ifndef _GRFMGR_HXX
35 #include <goodies/grfmgr.hxx>
36 #endif
38 // wrapper for GraphicAttr for binfilter
39 namespace binfilter {
40 class BfGraphicAttr : public GraphicAttr
42 public:
43 BfGraphicAttr();
44 ~BfGraphicAttr();
45 void SetTransparency( BYTE cTransparency );
47 }//end of namespace binfilter
49 // wrapper for GraphicObject for binfilter
50 namespace binfilter {
51 class BfGraphicObject : public GraphicObject
53 protected:
54 virtual void GraphicManagerDestroyed();
55 virtual ULONG GetReleaseFromCache() const;
56 virtual SvStream* GetSwapStream() const;
57 virtual void Load( SvStream& );
58 virtual void Save( SvStream& );
59 virtual void Assign( const SvDataCopyStream& );
61 public:
62 TYPEINFO();
63 BfGraphicObject( const GraphicManager* pMgr = NULL );
64 BfGraphicObject( const Graphic& rGraphic, const GraphicManager* pMgr = NULL );
65 BfGraphicObject( const BfGraphicObject& rCacheObj, const GraphicManager* pMgr = NULL );
66 BfGraphicObject( const ByteString& rUniqueID, const GraphicManager* pMgr = NULL );
67 ~BfGraphicObject();
69 BOOL operator==( const BfGraphicObject& rCacheObj ) const;
70 const Graphic& GetGraphic() const;
71 void SetAttr( const BfGraphicAttr& rAttr );
72 const BfGraphicAttr& GetAttr() const;
73 ByteString GetUniqueID() const;
74 BfGraphicObject& operator=( const BfGraphicObject& rCacheObj );
75 void SetUserData();
76 void SetUserData( const String& rUserData );
77 void SetGraphic( const Graphic& rGraphic );
78 void SetGraphic( const Graphic& rGraphic, const String& rLink );
79 void SetSwapState();
80 void FireSwapInRequest();
81 void FireSwapOutRequest();
82 void StopAnimation( OutputDevice* pOut = NULL, long nExtraData = 0L );
83 BOOL Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
84 const BfGraphicAttr* pAttr = NULL, ULONG nFlags = GRFMGR_DRAW_STANDARD );
85 String GetUserData() const;
86 void SetSwapStreamHdl( const Link& rHdl, const ULONG nSwapOutTimeout = 0UL );
87 void ReleaseFromCache();
88 String GetLink() const;
89 void SetLink( const String& rLink );
90 BOOL SwapOut();
91 BOOL SwapOut( SvStream* pOStm );
92 BOOL SwapIn();
93 BOOL SwapIn( SvStream* pIStm );
95 }//end of namespace binfilter
96 #endif // _BF_GOODIES_GRAPHICOBJECT_HXX