Added TRoster instance to the registrar application and dispatching of the application registration messages.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@410 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2002-07-23 23:40:12 +00:00
parent f9fd58cc75
commit 51d6b22ec1
2 changed files with 24 additions and 0 deletions

View File

@ -13,15 +13,18 @@
#include "ClipboardHandler.h" #include "ClipboardHandler.h"
#include "MIMEManager.h" #include "MIMEManager.h"
#include "Registrar.h" #include "Registrar.h"
#include "TRoster.h"
// constructor // constructor
Registrar::Registrar() Registrar::Registrar()
: BApplication(kRegistrarSignature), : BApplication(kRegistrarSignature),
fRoster(NULL),
fClipboardHandler(NULL), fClipboardHandler(NULL),
fMIMEManager(NULL) fMIMEManager(NULL)
{ {
FUNCTION_START(); FUNCTION_START();
// move the following code to ReadyToRun() once it works. // move the following code to ReadyToRun() once it works.
fRoster = new TRoster;
fClipboardHandler = new ClipboardHandler; fClipboardHandler = new ClipboardHandler;
AddHandler(fClipboardHandler); AddHandler(fClipboardHandler);
fMIMEManager = new MIMEManager; fMIMEManager = new MIMEManager;
@ -36,6 +39,7 @@ FUNCTION_START();
fMIMEManager->Quit(); fMIMEManager->Quit();
RemoveHandler(fClipboardHandler); RemoveHandler(fClipboardHandler);
delete fClipboardHandler; delete fClipboardHandler;
delete fRoster;
} }
// MessageReceived // MessageReceived
@ -62,6 +66,21 @@ FUNCTION_START();
message->SendReply(&reply); message->SendReply(&reply);
break; break;
} }
case B_REG_ADD_APP:
fRoster->HandleAddApplication(message);
break;
case B_REG_COMPLETE_REGISTRATION:
fRoster->HandleCompleteRegistration(message);
break;
case B_REG_IS_PRE_REGISTERED:
fRoster->HandleIsAppPreRegistered(message);
break;
case B_REG_REMOVE_PRE_REGISTERED_APP:
fRoster->HandleRemovePreRegApp(message);
break;
case B_REG_REMOVE_APP:
fRoster->HandleRemoveApp(message);
break;
default: default:
BApplication::MessageReceived(message); BApplication::MessageReceived(message);
break; break;

View File

@ -31,6 +31,10 @@
class ClipboardHandler; class ClipboardHandler;
class MIMEManager; class MIMEManager;
namespace BPrivate {
class TRoster;
};
class Registrar : public BApplication { class Registrar : public BApplication {
public: public:
Registrar(); Registrar();
@ -41,6 +45,7 @@ public:
virtual bool QuitRequested(); virtual bool QuitRequested();
private: private:
BPrivate::TRoster *fRoster;
ClipboardHandler *fClipboardHandler; ClipboardHandler *fClipboardHandler;
MIMEManager *fMIMEManager; MIMEManager *fMIMEManager;
}; };