xref: /haiku/headers/private/app/RosterPrivate.h (revision 56430ad8002b8fd1ac69b590e9cc130de6d9e852)
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 
16 const int32 kMsgAppServerRestarted = 'ASRe';
17 const int32 kMsgRestartAppServer = 'ReAS';
18 
19 
20 class 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 
43 		// needed by BApplication
44 
45 		status_t AddApplication(const char *mimeSig, const entry_ref *ref,
46 					uint32 flags, team_id team, thread_id thread,
47 					port_id port, bool fullReg, uint32 *token,
48 					team_id *otherTeam) const
49 			{ return fRoster->_AddApplication(mimeSig, ref, flags, team, thread,
50 					port, fullReg, token, otherTeam); }
51 
52 		status_t SetSignature(team_id team, const char *mimeSig) const
53 			{ return fRoster->_SetSignature(team, mimeSig); }
54 
55 		status_t CompleteRegistration(team_id team, thread_id thread,
56 					port_id port) const
57 			{ return fRoster->_CompleteRegistration(team, thread, port); }
58 
59 		status_t IsAppRegistered(const entry_ref *ref, team_id team,
60 					uint32 token, bool *preRegistered, app_info *info) const
61 			{ return fRoster->_IsAppRegistered(ref, team, token, preRegistered,
62 					info); }
63 
64 		void SetWithoutRegistrar(bool noRegistrar) const
65 			{ fRoster->_SetWithoutRegistrar(noRegistrar); }
66 
67 		status_t RemoveApp(team_id team) const
68 			{ return fRoster->_RemoveApp(team); }
69 
70 		// needed by GetRecentTester
71 
72 		void AddToRecentApps(const char *appSig) const
73 			{ fRoster->_AddToRecentApps(appSig); }
74 
75 		void ClearRecentDocuments() const
76 			{ fRoster->_ClearRecentDocuments(); }
77 
78 		void ClearRecentFolders() const
79 			{ fRoster->_ClearRecentFolders(); }
80 
81 		void ClearRecentApps() const
82 			{ fRoster->_ClearRecentApps(); }
83 
84 		void LoadRecentLists(const char *file) const
85 			{ fRoster->_LoadRecentLists(file); }
86 
87 		void SaveRecentLists(const char *file) const
88 			{ fRoster->_SaveRecentLists(file); }
89 
90 		// needed by the debug server
91 		void ApplicationCrashed(team_id team) const
92 			{ fRoster->_ApplicationCrashed(team); }
93 
94 		void UpdateActiveApp(team_id team) const
95 			{ fRoster->_UpdateActiveApp(team); }
96 
97 		static void InitBeRoster();
98 		static void DeleteBeRoster();
99 
100 	private:
101 		BRoster	*fRoster;
102 };
103 
104 #endif	// _ROSTER_PRIVATE_H
105