xref: /haiku/headers/os/interface/Picture.h (revision b6b0567fbd186f8ce8a0c90bdc7a7b5b4c649678)
1 /*
2  * Copyright 2001-2009, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  */
6 
7 #ifndef	_PICTURE_H
8 #define	_PICTURE_H
9 
10 #include <BeBuild.h>
11 #include <InterfaceDefs.h>
12 #include <Rect.h>
13 #include <Archivable.h>
14 
15 class BDataIO;
16 class BView;
17 struct _BPictureExtent_;
18 
19 // BPicture class --------------------------------------------------------------
20 class BPicture : public BArchivable {
21 public:
22 							BPicture();
23 							BPicture(const BPicture &original);
24 							BPicture(BMessage *data);
25 virtual						~BPicture();
26 static	BArchivable			*Instantiate(BMessage *data);
27 virtual	status_t			Archive(BMessage *data, bool deep = true) const;
28 virtual	status_t			Perform(perform_code d, void *arg);
29 
30 		status_t			Play(void **callBackTable,
31 								int32 tableEntries,
32 								void *userData);
33 
34 		status_t			Flatten(BDataIO *stream);
35 		status_t			Unflatten(BDataIO *stream);
36 
37 /*----- Private or reserved -----------------------------------------*/
38 private:
39 
40 friend class BWindow;
41 friend class BView;
42 friend class BPrintJob;
43 
44 virtual	void				_ReservedPicture1();
45 virtual	void				_ReservedPicture2();
46 virtual	void				_ReservedPicture3();
47 
48 		BPicture			&operator=(const BPicture &);
49 
50 		void				_InitData();
51 		void				_DisposeData();
52 
53 		void				_ImportOldData(const void *data, int32 size);
54 
55 		void				SetToken(int32 token);
56 		int32				Token() const;
57 
58 		bool				_AssertLocalCopy();
59 		bool				_AssertOldLocalCopy();
60 		bool				_AssertServerCopy();
61 
62 		status_t			_Upload();
63 		status_t			_Download();
64 
65 		/**Deprecated API**/
66 							BPicture(const void *data, int32 size);
67 		const void			*Data() const;
68 		int32				DataSize() const;
69 
70 		void				Usurp(BPicture *lameDuck);
71 		BPicture			*StepDown();
72 
73 
74 		int32				fToken;
75 		_BPictureExtent_		*fExtent;
76 		BPicture			*fUsurped;
77 
78 		uint32				_reserved[3];
79 };
80 //------------------------------------------------------------------------------
81 
82 #endif // _PICTURE_H
83 
84