/* * Copyright 2001-2009, Haiku. * Distributed under the terms of the MIT License. * * Authors: * DarkWyrm * Stefano Ceccherini */ #ifndef SERVER_PICTURE_H #define SERVER_PICTURE_H #include #include #include #include class ServerApp; class View; class BFile; namespace BPrivate { class LinkReceiver; class PortLink; } class BList; class ServerPicture : public BReferenceable, public PictureDataWriter { public: ServerPicture(); ServerPicture(const ServerPicture& other); ServerPicture(const char* fileName, int32 offset); ~ServerPicture(); int32 Token() { return fToken; } bool SetOwner(ServerApp* owner); bool ReleaseClientReference(); void EnterStateChange(); void ExitStateChange(); void SyncState(View* view); void SetFontFromLink(BPrivate::LinkReceiver& link); void Play(View* view); void Usurp(ServerPicture* newPicture); ServerPicture* StepDown(); bool NestPicture(ServerPicture* picture); off_t DataLength() const; status_t ImportData(BPrivate::LinkReceiver& link); status_t ExportData(BPrivate::PortLink& link); protected: virtual void LastReferenceReleased(); private: typedef BObjectList PictureList; int32 fToken; BFile* fFile; BPositionIO* fData; PictureList* fPictures; ServerPicture* fUsurped; ServerApp* fOwner; bool fHasClientReference; }; #endif // SERVER_PICTURE_H