1eb797182SAxel Dörfler/*
278e39852SAxel Dörfler * Copyright 2001-2015, Haiku.
3eb797182SAxel Dörfler * Distributed under the terms of the MIT License.
4eb797182SAxel Dörfler *
5eb797182SAxel Dörfler * Authors:
6eb797182SAxel Dörfler *		Ingo Weinhold (bonefish@users.sf.net)
7eb797182SAxel Dörfler */
82ed834e3SIngo Weinhold#ifndef _ROSTER_PRIVATE_H
92ed834e3SIngo Weinhold#define _ROSTER_PRIVATE_H
102ed834e3SIngo Weinhold
11eb797182SAxel Dörfler
122ed834e3SIngo Weinhold#include <Messenger.h>
132ed834e3SIngo Weinhold#include <Roster.h>
142ed834e3SIngo Weinhold
15eb797182SAxel Dörfler
1604209cddSczeidlerconst int32 kMsgAppServerRestarted = 'ASRe';
1704209cddSczeidlerconst int32 kMsgRestartAppServer = 'ReAS';
1804209cddSczeidler
1904209cddSczeidler
202ed834e3SIngo Weinholdclass BRoster::Private {
21eb797182SAxel Dörfler	public:
22eb797182SAxel Dörfler		Private() : fRoster(const_cast<BRoster*>(be_roster)) {}
23eb797182SAxel Dörfler		Private(BRoster &roster) : fRoster(&roster) {}
24eb797182SAxel Dörfler		Private(BRoster *roster) : fRoster(roster) {}
252ed834e3SIngo Weinhold
26eb797182SAxel Dörfler		void SetTo(BMessenger mainMessenger, BMessenger mimeMessenger);
272ed834e3SIngo Weinhold
28eb797182SAxel Dörfler		status_t SendTo(BMessage *message, BMessage *reply, bool mime);
29eb797182SAxel Dörfler		bool IsMessengerValid(bool mime) const;
302ed834e3SIngo Weinhold
31fb7dad2bSAxel Dörfler		status_t Launch(const char* mimeType, const entry_ref* ref,
32fb7dad2bSAxel Dörfler					const BList* messageList, int argc, const char* const* args,
335b9f6b54SMichael Lotz					const char** environment, team_id* appTeam,
349e73b627SAxel Dörfler					thread_id* appThread, port_id* appPort, uint32* appToken,
359e73b627SAxel Dörfler					bool launchSuspended)
36fb7dad2bSAxel Dörfler			{ return fRoster->_LaunchApp(mimeType, ref, messageList, argc,
379e73b627SAxel Dörfler					args, environment, appTeam, appThread, appPort, appToken,
389e73b627SAxel Dörfler					launchSuspended); }
39fb7dad2bSAxel Dörfler
40eb797182SAxel Dörfler		status_t ShutDown(bool reboot, bool confirm, bool synchronous)
41eb797182SAxel Dörfler			{ return fRoster->_ShutDown(reboot, confirm, synchronous); }
42925d069dSIngo Weinhold
43eb797182SAxel Dörfler		// needed by BApplication
442ed834e3SIngo Weinhold
45eb797182SAxel Dörfler		status_t AddApplication(const char *mimeSig, const entry_ref *ref,
46eb797182SAxel Dörfler					uint32 flags, team_id team, thread_id thread,
47eb797182SAxel Dörfler					port_id port, bool fullReg, uint32 *token,
48eb797182SAxel Dörfler					team_id *otherTeam) const
49eb797182SAxel Dörfler			{ return fRoster->_AddApplication(mimeSig, ref, flags, team, thread,
50eb797182SAxel Dörfler					port, fullReg, token, otherTeam); }
512ed834e3SIngo Weinhold
52eb797182SAxel Dörfler		status_t SetSignature(team_id team, const char *mimeSig) const
53eb797182SAxel Dörfler			{ return fRoster->_SetSignature(team, mimeSig); }
542ed834e3SIngo Weinhold
55eb797182SAxel Dörfler		status_t CompleteRegistration(team_id team, thread_id thread,
56eb797182SAxel Dörfler					port_id port) const
57eb797182SAxel Dörfler			{ return fRoster->_CompleteRegistration(team, thread, port); }
582ed834e3SIngo Weinhold
596bfd06d1SIngo Weinhold		status_t IsAppRegistered(const entry_ref *ref, team_id team,
606bfd06d1SIngo Weinhold					uint32 token, bool *preRegistered, app_info *info) const
616bfd06d1SIngo Weinhold			{ return fRoster->_IsAppRegistered(ref, team, token, preRegistered,
626bfd06d1SIngo Weinhold					info); }
632ed834e3SIngo Weinhold
6478e39852SAxel Dörfler		void SetWithoutRegistrar(bool noRegistrar) const
6578e39852SAxel Dörfler			{ fRoster->_SetWithoutRegistrar(noRegistrar); }
6678e39852SAxel Dörfler
67eb797182SAxel Dörfler		status_t RemoveApp(team_id team) const
68eb797182SAxel Dörfler			{ return fRoster->_RemoveApp(team); }
692ed834e3SIngo Weinhold
70eb797182SAxel Dörfler		// needed by GetRecentTester
712ed834e3SIngo Weinhold
72eb797182SAxel Dörfler		void AddToRecentApps(const char *appSig) const
73eb797182SAxel Dörfler			{ fRoster->_AddToRecentApps(appSig); }
742ed834e3SIngo Weinhold
75eb797182SAxel Dörfler		void ClearRecentDocuments() const
76eb797182SAxel Dörfler			{ fRoster->_ClearRecentDocuments(); }
772ed834e3SIngo Weinhold
78eb797182SAxel Dörfler		void ClearRecentFolders() const
79eb797182SAxel Dörfler			{ fRoster->_ClearRecentFolders(); }
802ed834e3SIngo Weinhold
81eb797182SAxel Dörfler		void ClearRecentApps() const
82eb797182SAxel Dörfler			{ fRoster->_ClearRecentApps(); }
832ed834e3SIngo Weinhold
84eb797182SAxel Dörfler		void LoadRecentLists(const char *file) const
85eb797182SAxel Dörfler			{ fRoster->_LoadRecentLists(file); }
862ed834e3SIngo Weinhold
87eb797182SAxel Dörfler		void SaveRecentLists(const char *file) const
88eb797182SAxel Dörfler			{ fRoster->_SaveRecentLists(file); }
892ed834e3SIngo Weinhold
9082584ab9SAxel Dörfler		// needed by the debug server
9182584ab9SAxel Dörfler		void ApplicationCrashed(team_id team) const
9282584ab9SAxel Dörfler			{ fRoster->_ApplicationCrashed(team); }
9382584ab9SAxel Dörfler
94c2f641f2SAxel Dörfler		void UpdateActiveApp(team_id team) const
95c2f641f2SAxel Dörfler			{ fRoster->_UpdateActiveApp(team); }
96c2f641f2SAxel Dörfler
97eb797182SAxel Dörfler		static void InitBeRoster();
98eb797182SAxel Dörfler		static void DeleteBeRoster();
995ac11568SIngo Weinhold
100eb797182SAxel Dörfler	private:
101eb797182SAxel Dörfler		BRoster	*fRoster;
1022ed834e3SIngo Weinhold};
1032ed834e3SIngo Weinhold
1042ed834e3SIngo Weinhold#endif	// _ROSTER_PRIVATE_H
105