xref: /haiku/headers/private/app/RosterPrivate.h (revision cbe35e2031cb2bfb757422f35006bb9bd382bed1)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //---------------------------------------------------------------------
5 
6 #ifndef _ROSTER_PRIVATE_H
7 #define _ROSTER_PRIVATE_H
8 
9 #include <Messenger.h>
10 #include <Roster.h>
11 
12 class BRoster::Private {
13 public:
14 	Private() : fRoster(const_cast<BRoster*>(be_roster)) {}
15 	Private(BRoster &roster) : fRoster(&roster) {}
16 	Private(BRoster *roster) : fRoster(roster) {}
17 
18 	void SetTo(BMessenger mainMessenger, BMessenger mimeMessenger);
19 
20 	status_t SendTo(BMessage *message, BMessage *reply, bool mime);
21 	bool IsMessengerValid(bool mime) const;
22 
23 	status_t ShutDown(bool reboot, bool confirm, bool synchronous)
24 		{ return fRoster->ShutDown(reboot, confirm, synchronous); }
25 
26 	// needed by BApplication
27 
28 	status_t AddApplication(const char *mimeSig, const entry_ref *ref,
29 							uint32 flags, team_id team, thread_id thread,
30 							port_id port, bool fullReg, uint32 *token,
31 							team_id *otherTeam) const
32 		{ return fRoster->AddApplication(mimeSig, ref, flags, team, thread,
33 										 port, fullReg, token, otherTeam); }
34 
35 	status_t SetSignature(team_id team, const char *mimeSig) const
36 		{ return fRoster->SetSignature(team, mimeSig); }
37 
38 	status_t CompleteRegistration(team_id team, thread_id thread,
39 								  port_id port) const
40 		{ return fRoster->CompleteRegistration(team, thread, port); }
41 
42 	bool IsAppPreRegistered(const entry_ref *ref, team_id team,
43 							app_info *info) const
44 		{ return fRoster->IsAppPreRegistered(ref, team, info); }
45 
46 	status_t RemoveApp(team_id team) const
47 		{ return fRoster->RemoveApp(team); }
48 
49 	// needed by GetRecentTester
50 
51 	void AddToRecentApps(const char *appSig) const
52 		{ fRoster->AddToRecentApps(appSig); }
53 
54 	void ClearRecentDocuments() const
55 		{ fRoster->ClearRecentDocuments(); }
56 
57 	void ClearRecentFolders() const
58 		{ fRoster->ClearRecentFolders(); }
59 
60 	void ClearRecentApps() const
61 		{ fRoster->ClearRecentApps(); }
62 
63 	void LoadRecentLists(const char *file) const
64 		{ fRoster->LoadRecentLists(file); }
65 
66 	void SaveRecentLists(const char *file) const
67 		{ fRoster->SaveRecentLists(file); }
68 
69 	static void InitBeRoster();
70 	static void DeleteBeRoster();
71 
72 private:
73 	BRoster	*fRoster;
74 };
75 
76 #endif	// _ROSTER_PRIVATE_H
77