xref: /haiku/src/servers/app/ServerPicture.h (revision 0562493379cd52eb7103531f895f10bb8e77c085)
1 /*
2  * Copyright 2001-2008, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		DarkWyrm <bpmagic@columbus.rr.com>
7  *		Stefano Ceccherini <stefano.ceccherini@gmail.com>
8  */
9 #ifndef SERVER_PICTURE_H
10 #define SERVER_PICTURE_H
11 
12 #include <DataIO.h>
13 
14 #include <PictureDataWriter.h>
15 
16 
17 class ServerApp;
18 class View;
19 class BFile;
20 
21 namespace BPrivate {
22 	class LinkReceiver;
23 	class PortLink;
24 }
25 class BList;
26 
27 class ServerPicture : public PictureDataWriter {
28 public:
29 		int32		Token() { return fToken; }
30 
31 		void		EnterStateChange();
32 		void		ExitStateChange();
33 
34 		void		SyncState(View *view);
35 		void		SetFontFromLink(BPrivate::LinkReceiver& link);
36 
37 		void		Play(View *view);
38 
39 		void 		Usurp(ServerPicture *newPicture);
40 		ServerPicture*	StepDown();
41 
42 		bool		NestPicture(ServerPicture *picture);
43 
44 		off_t		DataLength() const;
45 
46 		status_t	ImportData(BPrivate::LinkReceiver &link);
47 		status_t	ExportData(BPrivate::PortLink &link);
48 
49 private:
50 friend class	ServerApp;
51 
52 		ServerPicture();
53 		ServerPicture(const ServerPicture &);
54 		ServerPicture(const char *fileName, const int32 &offset);
55 		~ServerPicture();
56 
57 		int32		fToken;
58 		BFile		*fFile;
59 		BPositionIO	*fData;
60 		// DrawState	*fState;
61 		BList		*fPictures;
62 		ServerPicture	*fUsurped;
63 };
64 
65 #endif	// SERVER_PICTURE_H
66