mmshplugins/mmshaoplugin/inc/musaoplugin.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 15:12:07 +0300
branchRCL_3
changeset 22 73a1feb507fb
parent 0 f0cf47e981f9
child 23 bc78a40cd63c
permissions -rw-r--r--
Revision: 201032 Kit: 201035

/*
* Copyright (c) 2005-2006 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:  Main plugin class
*
*/


#ifndef MUSAOPLUGIN_H
#define MUSAOPLUGIN_H


#include <e32base.h>    
#include <AlwaysOnlineEComInterface.h>
#include <ecom/implementationproxy.h>
#include <etel.h>    
#include <etelmm.h>  
#include <e32property.h>

#include "musunittesting.h"
#include "mmuscallstateobserver.h"
#include "musmanager.h"

// Enable the below line if Kodiak Ptt has to be monitered
//class CMusPttCallMonitor;
class CMusPropertyMonitor;
class CMusTsyPropertyMonitor;

IMPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount );

/**
 * Main plugin class
 *
 * @lib musaoplugin.dll
 */
class CMusAoPlugin : public CAlwaysOnlineEComInterface,
                     public MMusCallStateObserver
    {
public:

    /**
     * Two-phased constructor
     *
     * @since S60 v3.2
     * @return New CMusAoPlugin instance
     */
    static CMusAoPlugin* NewL();

    /**
     * C++ destructor.
     */
    virtual ~CMusAoPlugin();
    
    
public: // new API

    /**
     * Define start up resource properties
     *
     * @since S60 v3.2
     */
    void DefinePropertiesL();

    /**
     * Delete when AO end
     *
     * @since S60 v3.2
     */

    void DeleteProperties();
    
    
public: // from MMusCallStateObserver

    void MusCallStateChanged();
    

private: // constructors

    /**
     * C++ constructor.
     */
    CMusAoPlugin();

    /**
     * Symbian second-phase constructor.
     */
    void ConstructL();
    
    /**
     * Utility function to define and set keys.
     */
	void DefinePropertyL(TInt aKey,RProperty::TType aType,TInt aVal);

    /**
     * Utility function to define and set keys.
     */
	void DefinePropertyL(TInt aKey,RProperty::TType aType,const TDesC& aVal);

	/**
     * Utility function to delete keys.
     */
	void DeleteProperty(TInt aKey);

	/**
     * Starts Mus Manager Client.In turn it will start Mus Manager
     * Server and Availability Plugin.
     */
    void StartMusClientL();

    /*
     * Stops Mus Manager Client.
     */ 
    void StopMusClient();

	
public: // from base class CAlwaysOnlineEComInterface

    /**
     *  Commands from alwaysonlinemanager to plugin
     *
     * @since S60 v3.2
     * @param aCommand, command Id
     * @param aParameters, parameter pack
     * @return return value
     */
    virtual TAny* HandleServerCommandL( TInt aCommand,
                                        TDesC8* aParameters );	

private: // data
   
    /**
     * Instance of MusManager Client. Owned.
     */
    CMusManager* iManager;
    

    /* Property Monitor  */
    CMusPropertyMonitor*      iPropertyMonitor;

    /** 
     *  Telephony Property Key monitor.
     *  Monitors the call connect/disconnect events.
     */
    CMusTsyPropertyMonitor*   iTsyPropertyMonitor;

    /* Ptt Call Monitor  */
    // Enable the below line if Kodiak Ptt has to be monitered
    // CMusPttCallMonitor*       iPttCallMonitor;

    /**
     * RTelServer handle
     */
    RTelServer iServer;

    /**
     * RMobilePhone handle
     */
    RMobilePhone iPhone;    

    /** 
     *  Error status.
     */
    TInt iError;
   
    MUS_UNITTEST( UT_CMusAoPlugin )
    };

#endif // MUSAOPLUGIN_H