1/*
2 * Copyright 2001-2015, 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
16const int32 kMsgAppServerRestarted = 'ASRe';
17const int32 kMsgRestartAppServer = 'ReAS';
18
19
20class 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 Launch(const char* mimeType, const entry_ref* ref,
32					const BList* messageList, int argc, const char* const* args,
33					const char** environment, team_id* appTeam,
34					thread_id* appThread, port_id* appPort, uint32* appToken,
35					bool launchSuspended)
36			{ return fRoster->_LaunchApp(mimeType, ref, messageList, argc,
37					args, environment, appTeam, appThread, appPort, appToken,
38					launchSuspended); }
39
40		status_t ShutDown(bool reboot, bool confirm, bool synchronous)
41			{ return fRoster->_ShutDown(reboot, confirm, synchronous); }
42		status_t IsShutDownInProgress(bool* inProgress)
43			{ return fRoster->_IsShutDownInProgress(inProgress); }
44
45		// needed by BApplication
46
47		status_t AddApplication(const char *mimeSig, const entry_ref *ref,
48					uint32 flags, team_id team, thread_id thread,
49					port_id port, bool fullReg, uint32 *token,
50					team_id *otherTeam) const
51			{ return fRoster->_AddApplication(mimeSig, ref, flags, team, thread,
52					port, fullReg, token, otherTeam); }
53
54		status_t SetSignature(team_id team, const char *mimeSig) const
55			{ return fRoster->_SetSignature(team, mimeSig); }
56
57		status_t CompleteRegistration(team_id team, thread_id thread,
58					port_id port) const
59			{ return fRoster->_CompleteRegistration(team, thread, port); }
60
61		status_t IsAppRegistered(const entry_ref *ref, team_id team,
62					uint32 token, bool *preRegistered, app_info *info) const
63			{ return fRoster->_IsAppRegistered(ref, team, token, preRegistered,
64					info); }
65
66		void SetWithoutRegistrar(bool noRegistrar) const
67			{ fRoster->_SetWithoutRegistrar(noRegistrar); }
68
69		status_t RemoveApp(team_id team) const
70			{ return fRoster->_RemoveApp(team); }
71
72		// needed by GetRecentTester
73
74		void AddToRecentApps(const char *appSig) const
75			{ fRoster->_AddToRecentApps(appSig); }
76
77		void ClearRecentDocuments() const
78			{ fRoster->_ClearRecentDocuments(); }
79
80		void ClearRecentFolders() const
81			{ fRoster->_ClearRecentFolders(); }
82
83		void ClearRecentApps() const
84			{ fRoster->_ClearRecentApps(); }
85
86		void LoadRecentLists(const char *file) const
87			{ fRoster->_LoadRecentLists(file); }
88
89		void SaveRecentLists(const char *file) const
90			{ fRoster->_SaveRecentLists(file); }
91
92		// needed by the debug server
93		void ApplicationCrashed(team_id team) const
94			{ fRoster->_ApplicationCrashed(team); }
95
96		void UpdateActiveApp(team_id team) const
97			{ fRoster->_UpdateActiveApp(team); }
98
99		static void InitBeRoster();
100		static void DeleteBeRoster();
101
102	private:
103		BRoster	*fRoster;
104};
105
106#endif	// _ROSTER_PRIVATE_H
107