Cleaned up BRoster's friends mess. All access to private BRoster functionality is now done through the newly added BRoster::Private class, which is BRoster's only friend (poor BRoster ;-).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2664 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+3
-19
@@ -39,17 +39,6 @@ class BList;
|
||||
class BMessage;
|
||||
class BNodeInfo;
|
||||
|
||||
// TODO: relocate these private prototypes
|
||||
extern "C" int _init_roster_();
|
||||
extern "C" int _delete_roster_();
|
||||
status_t _send_to_roster_(BMessage *message, BMessage *reply, bool mime);
|
||||
bool _is_valid_roster_mess_(bool mime);
|
||||
|
||||
namespace BPrivate {
|
||||
void init_registrar_roster(BMessenger mainMessenger,
|
||||
BMessenger mimeMessenger);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/* --------- app_info Struct and Values ------------------------ */
|
||||
|
||||
@@ -149,15 +138,10 @@ public:
|
||||
const char *appSig = NULL) const;
|
||||
|
||||
/*----- Private or reserved ------------------------------*/
|
||||
class Private;
|
||||
|
||||
private:
|
||||
friend class BApplication;
|
||||
friend class BWindow;
|
||||
friend class _BAppCleanup_;
|
||||
friend int _init_roster_();
|
||||
friend status_t _send_to_roster_(BMessage *, BMessage *, bool);
|
||||
friend bool _is_valid_roster_mess_(bool);
|
||||
friend void BPrivate::init_registrar_roster(BMessenger, BMessenger);
|
||||
friend class GetRecentTester;
|
||||
friend class Private;
|
||||
|
||||
class ArgVector;
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
#ifndef _ROSTER_PRIVATE_H
|
||||
#define _ROSTER_PRIVATE_H
|
||||
|
||||
#include <Messenger.h>
|
||||
#include <Roster.h>
|
||||
|
||||
class BRoster::Private {
|
||||
public:
|
||||
Private() : fRoster(const_cast<BRoster*>(be_roster)) {}
|
||||
Private(BRoster &roster) : fRoster(&roster) {}
|
||||
Private(BRoster *roster) : fRoster(roster) {}
|
||||
|
||||
void SetTo(BMessenger mainMessenger, BMessenger mimeMessenger);
|
||||
|
||||
status_t SendTo(BMessage *message, BMessage *reply, bool mime);
|
||||
bool IsMessengerValid(bool mime) const;
|
||||
|
||||
// needed by BApplication
|
||||
|
||||
status_t AddApplication(const char *mimeSig, const entry_ref *ref,
|
||||
uint32 flags, team_id team, thread_id thread,
|
||||
port_id port, bool fullReg, uint32 *token,
|
||||
team_id *otherTeam) const
|
||||
{ return fRoster->AddApplication(mimeSig, ref, flags, team, thread,
|
||||
port, fullReg, token, otherTeam); }
|
||||
|
||||
status_t SetSignature(team_id team, const char *mimeSig) const
|
||||
{ return fRoster->SetSignature(team, mimeSig); }
|
||||
|
||||
status_t CompleteRegistration(team_id team, thread_id thread,
|
||||
port_id port) const
|
||||
{ return fRoster->CompleteRegistration(team, thread, port); }
|
||||
|
||||
bool IsAppPreRegistered(const entry_ref *ref, team_id team,
|
||||
app_info *info) const
|
||||
{ return fRoster->IsAppPreRegistered(ref, team, info); }
|
||||
|
||||
status_t RemoveApp(team_id team) const
|
||||
{ return fRoster->RemoveApp(team); }
|
||||
|
||||
// needed by GetRecentTester
|
||||
|
||||
void AddToRecentApps(const char *appSig) const
|
||||
{ fRoster->AddToRecentApps(appSig); }
|
||||
|
||||
void ClearRecentDocuments() const
|
||||
{ fRoster->ClearRecentDocuments(); }
|
||||
|
||||
void ClearRecentFolders() const
|
||||
{ fRoster->ClearRecentFolders(); }
|
||||
|
||||
void ClearRecentApps() const
|
||||
{ fRoster->ClearRecentApps(); }
|
||||
|
||||
void LoadRecentLists(const char *file) const
|
||||
{ fRoster->LoadRecentLists(file); }
|
||||
|
||||
void SaveRecentLists(const char *file) const
|
||||
{ fRoster->SaveRecentLists(file); }
|
||||
|
||||
private:
|
||||
BRoster *fRoster;
|
||||
};
|
||||
|
||||
extern "C" int _init_roster_();
|
||||
extern "C" int _delete_roster_();
|
||||
|
||||
#endif // _ROSTER_PRIVATE_H
|
||||
Reference in New Issue
Block a user