xref: /haiku/headers/private/app/RosterPrivate.h (revision 2b76973fa2401f7a5edf68e6470f3d3210cbcff3)
1 /*
2  * Copyright 2001-2007, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Ingo Weinhold (bonefish@users.sf.net)
7  */
8 #ifndef _ROSTER_PRIVATE_H
9 #define _ROSTER_PRIVATE_H
10 
11 
12 #include <Messenger.h>
13 #include <Roster.h>
14 
15 
16 const int32 kMsgAppServerRestarted = 'ASRe';
17 const int32 kMsgRestartAppServer = 'ReAS';
18 
19 
20 class BRoster::Private {
21 	public:
22 		Private() : fRoster(const_cast<BRoster*>(be_roster)) {}
23 		Private(BRoster &roster) : fRoster(&roster) {}
24 		Private(BRoster *roster) : fRoster(roster) {}
25 
26 		void SetTo(BMessenger mainMessenger, BMessenger mimeMessenger);
27 
28 		status_t SendTo(BMessage *message, BMessage *reply, bool mime);
29 		bool IsMessengerValid(bool mime) const;
30 
31 		status_t ShutDown(bool reboot, bool confirm, bool synchronous)
32 			{ return fRoster->_ShutDown(reboot, confirm, synchronous); }
33 
34 		// needed by BApplication
35 
36 		status_t AddApplication(const char *mimeSig, const entry_ref *ref,
37 					uint32 flags, team_id team, thread_id thread,
38 					port_id port, bool fullReg, uint32 *token,
39 					team_id *otherTeam) const
40 			{ return fRoster->_AddApplication(mimeSig, ref, flags, team, thread,
41 					port, fullReg, token, otherTeam); }
42 
43 		status_t SetSignature(team_id team, const char *mimeSig) const
44 			{ return fRoster->_SetSignature(team, mimeSig); }
45 
46 		status_t CompleteRegistration(team_id team, thread_id thread,
47 					port_id port) const
48 			{ return fRoster->_CompleteRegistration(team, thread, port); }
49 
50 		status_t IsAppRegistered(const entry_ref *ref, team_id team,
51 					uint32 token, bool *preRegistered, app_info *info) const
52 			{ return fRoster->_IsAppRegistered(ref, team, token, preRegistered,
53 					info); }
54 
55 		status_t RemoveApp(team_id team) const
56 			{ return fRoster->_RemoveApp(team); }
57 
58 		// needed by GetRecentTester
59 
60 		void AddToRecentApps(const char *appSig) const
61 			{ fRoster->_AddToRecentApps(appSig); }
62 
63 		void ClearRecentDocuments() const
64 			{ fRoster->_ClearRecentDocuments(); }
65 
66 		void ClearRecentFolders() const
67 			{ fRoster->_ClearRecentFolders(); }
68 
69 		void ClearRecentApps() const
70 			{ fRoster->_ClearRecentApps(); }
71 
72 		void LoadRecentLists(const char *file) const
73 			{ fRoster->_LoadRecentLists(file); }
74 
75 		void SaveRecentLists(const char *file) const
76 			{ fRoster->_SaveRecentLists(file); }
77 
78 		// needed by the debug server
79 		void ApplicationCrashed(team_id team) const
80 			{ fRoster->_ApplicationCrashed(team); }
81 
82 		void UpdateActiveApp(team_id team) const
83 			{ fRoster->_UpdateActiveApp(team); }
84 
85 		static void InitBeRoster();
86 		static void DeleteBeRoster();
87 
88 	private:
89 		BRoster	*fRoster;
90 };
91 
92 #endif	// _ROSTER_PRIVATE_H
93