cbs/cbsui/UiInc/CCbsUiTopicListMonitor.h
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:15:03 +0100
branchRCL_3
changeset 20 987c9837762f
parent 0 ff3b6d0fd310
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2002 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:  Header file for the CCbsUiTopicListMonitor class.
*
*
*/


#ifndef     CCBSUITOPICLISTMONITOR_H
#define     CCBSUITOPICLISTMONITOR_H

// INCLUDES
#include <e32base.h>
#include <CbsCommon.h>

 
//  FORWARD DECLARATIONS
class MCbs;
class MCbsUiTopicMonitorObserver;

//  CLASS DEFINITIONS 


/**
*  Monitors topic related events.  
*/
class CCbsUiTopicListMonitor : public CActive
    {
    public: // New functions

        /**
        * Create an instance of the class. 
        *
        * @param aServer cbs server
        */
        static CCbsUiTopicListMonitor* NewL( MCbs& aServer );

        /**
        * Destructor.
        */
        ~CCbsUiTopicListMonitor();

        /**
        * Issues the request.
        */
        void IssueRequest();

    public: // From CActive
        
        /**
        * It is called when server notifies.
        */
        void RunL();

        /**
        * Cancels the request.
        */
        void DoCancel();

    public: // New functions

        /**
        * Adds a observer to this monitor.
        *
        * @param aObserver Observer to be added.
        */
        void AddObserverL( MCbsUiTopicMonitorObserver* aObserver );

    private:

        typedef CArrayFixFlat<MCbsUiTopicMonitorObserver*>
            TCbsUiMonitorObservers;

        /**
        * Constructor.
        *
        * @param aServer cbs server
        */
        CCbsUiTopicListMonitor( MCbs& aServer );

        /**
        * Finalizes the construction.
        */
        void ConstructL();

    private: // Data

        // ETrue if request is active.
        TBool iContinue;

        // To issue the request.
        MCbs& iServer;

        // Observers who are interested in topic changes.
        // Monitor doesn't own the observers.
        TCbsUiMonitorObservers* iObservers;

        // Which topic handle the event is conserning.
        TCbsTopicNumber iTopicNumber;

        // What kind of event has been.
        TCbsTopicListEvent iEvent;
    };

#endif      //  CCBSUITOPICLISTMONITOR_H
            
// End of File