diff -r f5050f1da672 -r 04becd199f91 javaextensions/midprms_db/rmsplugin/src/rmsextensionplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/midprms_db/rmsplugin/src/rmsextensionplugin.h Tue Apr 27 16:30:29 2010 +0300 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Java Captain extension plugin for RMS +* +*/ + +#ifndef RMSEXTENSIONPLUGIN_H +#define RMSEXTENSIONPLUGIN_H + +#include +#include + +#include "javaosheaders.h" +#include "commslistener.h" +#include "extensionplugininterface.h" + +namespace java +{ +namespace rms +{ +const int MSG_ID_RECORD_CHANGE = 1; +const int MSG_ID_LISTENER_CHANGE = 2; +const int MSG_ID_LISTENER_COUNT = 3; + +const int ADD_LISTENER = 0; +const int REMOVE_LISTENER = 1; + +using namespace java::captain; +using namespace java::comms; + +OS_NONSHARABLE_CLASS(RmsExtensionPlugin) : public ExtensionPluginInterface, public CommsListener +{ +public: + RmsExtensionPlugin(); + virtual ~RmsExtensionPlugin(); + + // ExtensionPluginInterface methods + virtual void startPlugin(CoreInterface* aCore); + virtual void stopPlugin(); + virtual CommsListener* getCommsListener(); + + // CommsListener + virtual void processMessage(CommsMessage& aMessage); + +protected: + virtual void addListener(std::string aName, int aAddress); + virtual void removeListener(std::string aName, int aAddress); + virtual void notifyListeners(std::string aName, CommsMessage& aMessage); + virtual void sendListenerCount(std::string aName, CommsMessage& aSender); + virtual CommsMessage createListenerCountMsg(std::string aName, int aCount); + virtual int send(CommsMessage& aMessage); + + CoreInterface* mCore; + + typedef std::map< std::string, std::vector > listeners_t; + typedef listeners_t::iterator listenersIterator; + listeners_t mListeners; +}; + +} // namespace rms +} // namespace java + +#endif // RMSEXTENSIONPLUGIN_H +