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