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