mmserv/voipaudioservices/VoIPServer/inc/VoIPQueueHandlerSrv.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 01:08:46 +0200
changeset 0 71ca22bcf22a
child 38 9e9fc5ab059f
permissions -rw-r--r--
Revision: 201003 Kit: 201005

/*
 * Copyright (c) 2007-2008 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:  CQueueHandler class declaration.
 *
 */

#ifndef __VOIPSERVERCALLBACKHANDLERSRV_H
#define __VOIPSERVERCALLBACKHANDLERSRV_H

// INCLUDES
#include <e32base.h>
#include <e32msgqueue.h>
#include "VoIPAudioClientServer.h"   // for TVoIPMsgBuf
// FORWARD DECLARATIONS


/**
 *  MQueueHandlerObserver
 *  Responsible for sending callbacks to the VoIP client app
 */
class MQueueHandlerObserverSrv
    {
public:
    virtual void Event(TInt aEventType, TInt aError) = 0;
    };

/**
 *  CQueueHandler
 *
 */
class CQueueHandlerSrv : public CActive
    {
public:

    /**
     * NewL()
     * Contructor that takes single queue pointer
     *
     */
    static CQueueHandlerSrv* NewL(MQueueHandlerObserverSrv* aObserver,
            RMsgQueue<TVoIPMsgBuf>* aMsgQueue);

    /**
     * destructor
     */
    ~CQueueHandlerSrv();

    /**
     * Start
     * Starts listening for events.
     *
     */
    void Start();

    /**
     * Returns request status.
     */
    TRequestStatus* Status();

private:

    /**
     * constructor
     */
    CQueueHandlerSrv(RMsgQueue<TVoIPMsgBuf>* aMsgQueue);

    void ConstructL(MQueueHandlerObserverSrv* aObserver);

    // from CActive
    void DoCancel();
    void RunL();
    TInt RunError(TInt aError);

private:
    // data

    MQueueHandlerObserverSrv* iObserver; // (not owned)
    RMsgQueue<TVoIPMsgBuf>* iMsgQueue;

    };

#endif      // __VOIPSERVERCALLBACKHANDLERSRV_H

// End of File