xref: /haiku/headers/private/app/RosterPrivate.h (revision c90684742e7361651849be4116d0e5de3a817194)
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 class BRoster::Private {
17 	public:
18 		Private() : fRoster(const_cast<BRoster*>(be_roster)) {}
19 		Private(BRoster &roster) : fRoster(&roster) {}
20 		Private(BRoster *roster) : fRoster(roster) {}
21 
22 		void SetTo(BMessenger mainMessenger, BMessenger mimeMessenger);
23 
24 		status_t SendTo(BMessage *message, BMessage *reply, bool mime);
25 		bool IsMessengerValid(bool mime) const;
26 
27 		status_t ShutDown(bool reboot, bool confirm, bool synchronous)
28 			{ return fRoster->_ShutDown(reboot, confirm, synchronous); }
29 
30 		// needed by BApplication
31 
32 		status_t AddApplication(const char *mimeSig, const entry_ref *ref,
33 					uint32 flags, team_id team, thread_id thread,
34 					port_id port, bool fullReg, uint32 *token,
35 					team_id *otherTeam) const
36 			{ return fRoster->_AddApplication(mimeSig, ref, flags, team, thread,
37 					port, fullReg, token, otherTeam); }
38 
39 		status_t SetSignature(team_id team, const char *mimeSig) const
40 			{ return fRoster->_SetSignature(team, mimeSig); }
41 
42 		status_t CompleteRegistration(team_id team, thread_id thread,
43 					port_id port) const
44 			{ return fRoster->_CompleteRegistration(team, thread, port); }
45 
46 		status_t IsAppRegistered(const entry_ref *ref, team_id team,
47 					uint32 token, bool *preRegistered, app_info *info) const
48 			{ return fRoster->_IsAppRegistered(ref, team, token, preRegistered,
49 					info); }
50 
51 		status_t RemoveApp(team_id team) const
52 			{ return fRoster->_RemoveApp(team); }
53 
54 		// needed by GetRecentTester
55 
56 		void AddToRecentApps(const char *appSig) const
57 			{ fRoster->_AddToRecentApps(appSig); }
58 
59 		void ClearRecentDocuments() const
60 			{ fRoster->_ClearRecentDocuments(); }
61 
62 		void ClearRecentFolders() const
63 			{ fRoster->_ClearRecentFolders(); }
64 
65 		void ClearRecentApps() const
66 			{ fRoster->_ClearRecentApps(); }
67 
68 		void LoadRecentLists(const char *file) const
69 			{ fRoster->_LoadRecentLists(file); }
70 
71 		void SaveRecentLists(const char *file) const
72 			{ fRoster->_SaveRecentLists(file); }
73 
74 		// needed by the debug server
75 		void ApplicationCrashed(team_id team) const
76 			{ fRoster->_ApplicationCrashed(team); }
77 
78 		void UpdateActiveApp(team_id team) const
79 			{ fRoster->_UpdateActiveApp(team); }
80 
81 		static void InitBeRoster();
82 		static void DeleteBeRoster();
83 
84 	private:
85 		BRoster	*fRoster;
86 };
87 
88 #endif	// _ROSTER_PRIVATE_H
89