internetradio2.0/uiinc/irmessageobserver.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 19 Apr 2010 14:01:53 +0300
changeset 0 09774dfdd46b
permissions -rw-r--r--
Revision: 201011 Kit: 201015

/*
* Copyright (c) 2006-2007 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:  
*
*/


#ifndef IRMESSAGEOBSERVER_H
#define IRMESSAGEOBSERVER_H

#include <e32base.h>    // CBase
#include <msvapi.h>     // MMsvSessionObserver


class CIRUi;
 
	
/**
 * This is the message observer class is used for sms observing
 * When new message comes, the MMsvSessionObserver calls HandleSessionEventL which does the message handling
 * 
 * @code
 * 
 * CIRMessageObserver* obj
 * obj = CIRMessageObserver::NewL(instance of CIRUi* aUi); //creating message observer
 * 
 * @endcode
 * 
 */

 
class CIRMessageObserver : public CBase, public MMsvSessionObserver
    {
    public:
        /**
         * 2nd phase constructor.
         * @param aUi the instance of CIRUi
         * @return A pointer to the created instance of CIRMessageObserver
         */
        static CIRMessageObserver* NewL(CIRUi* aUi);
    
        /**
         * 2nd phase constructor.
         * @param aUi the instance of CIRUi
         * @return A pointer to the created instance of CIRMessageObserver
         */
        static CIRMessageObserver* NewLC(CIRUi* aUi);
    
        /**
         * Destructor.
         */
        ~CIRMessageObserver();
 
    public:
        /**
         * From MMsvSessionObserver.
         * Called when a session event occurs.
         */
        void HandleSessionEventL(TMsvSessionEvent aEvent,
                TAny* aArg1,
                TAny* aArg2,
                TAny* aArg3);
 
    private:
        /**
         * Symbian OS default constructor.
         * @param aObserver the observer which gets notified when message
         * events occur
         */
        CIRMessageObserver(CIRUi* aUi);
 
        /**
         * 2nd phase constructor.
         * Initializes objects.
         */
        void ConstructL();
 
    private:
        // Session with the messaging server
        CMsvSession* iMsvSession;

		// instance of CIRUi
		CIRUi* iUi;
    };
 
#endif /*IRMESSAGEOBSERVER_H*/