xref: /haiku/src/servers/app/ServerPicture.h (revision cfc3fa87da824bdf593eb8b817a83b6376e77935)
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 namespace BPrivate {
20 	class LinkReceiver;
21 	class PortLink;
22 }
23 class BList;
24 
25 class ServerPicture : public PictureDataWriter {
26 public:
27 		int32		Token() { return fToken; }
28 
29 		void		EnterStateChange();
30 		void		ExitStateChange();
31 
32 		void		SyncState(View *view);
33 		void		SetFontFromLink(BPrivate::LinkReceiver& link);
34 
35 		void		Play(View *view);
36 
37 		void 		Usurp(ServerPicture *newPicture);
38 		ServerPicture*	StepDown();
39 
40 		bool		NestPicture(ServerPicture *picture);
41 
42 		off_t		DataLength() const;
43 
44 		status_t	ImportData(BPrivate::LinkReceiver &link);
45 		status_t	ExportData(BPrivate::PortLink &link);
46 
47 private:
48 friend class	ServerApp;
49 
50 		ServerPicture();
51 		ServerPicture(const ServerPicture &);
52 		ServerPicture(const char *fileName, const int32 &offset);
53 		~ServerPicture();
54 
55 		int32		fToken;
56 		BPositionIO	*fData;
57 		// DrawState	*fState;
58 		BList		*fPictures;
59 		ServerPicture	*fUsurped;
60 };
61 
62 #endif	// SERVER_PICTURE_H
63