bluetoothengine/headsetsimulator/core/inc/Plugin/hscodpluginbase.h
author michal.sulewski
Wed, 15 Sep 2010 15:59:44 +0200
branchheadsetsimulator
changeset 60 90dbfc0435e3
permissions -rw-r--r--
source code commit

/*
 * Component Name: Headset Simulator
 * Author: Comarch S.A.
 * Version: 1.0
 * Copyright (c) 2010 Comarch S.A.
 *  
 * This Software is submitted by Comarch S.A. to Symbian Foundation Limited on 
 * the basis of the Member Contribution Agreement entered between Comarch S.A. 
 * and Symbian Foundation Limited on 5th June 2009 (“Agreement”) and may be 
 * used only in accordance with the terms and conditions of the Agreement. 
 * Any other usage, duplication or redistribution of this Software is not 
 * allowed without written permission of Comarch S.A.
 * 
 */

#ifndef HSCODPLUGINBASE_H_
#define HSCODPLUGINBASE_H_

#include <ecom.h>
#include <btdevice.h>
#include <e32property.h>
#include <bt_subscribe.h>
#include <hsecompluginbase.h>

/**
 * CoD plugin UID
 */
const TUid KHsCoDBaseInterfaceDefinitionUid =
    {
    0xE0009DC2
    };

/**
 * @brief Abstract methods for CoD plugin
 */
class MHsCoDBase
{
public:
    /**
     * Destructor
     */
    virtual ~MHsCoDBase() { };

    /**
     * Sets new Class of Device in properties registry
     */
    virtual void SetNewCodL() = 0;

    /**
     * Restores Class of Device  
     * 
     * @return error code value
     */
    virtual TInt RestoreOldCod() = 0;

    /**
     * Saves old CoD
     * 
     * @return error code value
     */
    virtual TInt SaveOldCod() = 0;
};

/**
 * @brief Class allows to set new CoD. Each CoD plugin should derive from this class. 
 */
class CHsCoDBase : protected CHsEComPluginBase, public MHsCoDBase
{
public:

    /**
     * Two-phase constructor
     * @param aUid plugin's UID
     * @return instance of class
     */
    static CHsCoDBase* NewL( const TUid aUid );

    /**
     * Two-phase constructor
     * @param aData plugin's name
     * @return instance of class
     */
    static CHsCoDBase* NewL( const TDesC8 &aData );

    /**
     * Destructor.
     */
    virtual ~CHsCoDBase();

public:
    //Methods inherited from MHsCoDBase

    virtual void SetNewCodL() = 0;

    virtual TInt RestoreOldCod();

    virtual TInt SaveOldCod();

protected:
    /**
     * Restores Class of Device
     * 
     * @return error code value
     */
    TInt SetDefaultCod();

    /** Default Class of Device */
    TUint32 iDefaultDeviceClass;

};

#include "hscodpluginbase.inl"

#endif /* HSCODPLUGINBASE_H_ */