RosterPrivate.h revision 78e39852
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 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		void SetWithoutRegistrar(bool noRegistrar) const
56			{ fRoster->_SetWithoutRegistrar(noRegistrar); }
57
58		status_t RemoveApp(team_id team) const
59			{ return fRoster->_RemoveApp(team); }
60
61		// needed by GetRecentTester
62
63		void AddToRecentApps(const char *appSig) const
64			{ fRoster->_AddToRecentApps(appSig); }
65
66		void ClearRecentDocuments() const
67			{ fRoster->_ClearRecentDocuments(); }
68
69		void ClearRecentFolders() const
70			{ fRoster->_ClearRecentFolders(); }
71
72		void ClearRecentApps() const
73			{ fRoster->_ClearRecentApps(); }
74
75		void LoadRecentLists(const char *file) const
76			{ fRoster->_LoadRecentLists(file); }
77
78		void SaveRecentLists(const char *file) const
79			{ fRoster->_SaveRecentLists(file); }
80
81		// needed by the debug server
82		void ApplicationCrashed(team_id team) const
83			{ fRoster->_ApplicationCrashed(team); }
84
85		void UpdateActiveApp(team_id team) const
86			{ fRoster->_UpdateActiveApp(team); }
87
88		static void InitBeRoster();
89		static void DeleteBeRoster();
90
91	private:
92		BRoster	*fRoster;
93};
94
95#endif	// _ROSTER_PRIVATE_H
96