javamanager/javacaptain/extensionplugins/settingslistener/src.s60/settingslistenerimpl.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 18 Aug 2010 09:43:15 +0300
changeset 61 bf7ee68962da
parent 48 e0d6e9bd3ca7
permissions -rw-r--r--
Revision: v2.2.9 Kit: 201033

/*
* 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:  Platform specific component which manages all the listeners
*                     listening changes in system configuration. Currently only Central
*                     Repository listening is supported.
*
*/

#ifndef SETTINGSLISTENERIMPL_H
#define SETTINGSLISTENERIMPL_H

#include <vector>
#include <memory>
#include <cenrepnotifyhandler.h>

#include "javaosheaders.h"
#include "settingslistenerinterface.h"

namespace java
{
namespace captain
{

class CoreInterface;
class CenRepListener;

OS_NONSHARABLE_CLASS(SettingsListenerImpl) :  public SettingsListenerInterface
{
public:
    SettingsListenerImpl(CoreInterface* aCore);
    virtual ~SettingsListenerImpl();

    // SystemSettingsChangeListenerInterface
    virtual void startListening();
    virtual void stopListening();

private:
    void cleanUp();
    CenRepListener* createCenRepKeyListener(TUid aRepoId, TUint32 aKeyId,
                                            CCenRepNotifyHandler::TCenRepKeyType aKeyType,
                                            TInt& aErrorCode);

    CoreInterface* mCore;  // resource not owned
    typedef std::vector<CenRepListener*> crListeners_t;
    crListeners_t mCenRepListeners; // listeners are owned resources.

};

} // namespace captain
} // namespace java

#endif // SETTINGSLISTENERIMPL_H