taskswitcher/server/inc/hsrunningappserver.h
author Jaakko Haukipuro (Nokia-MS/Oulu) <Jaakko.Haukipuro@nokia.com>
Thu, 16 Sep 2010 12:11:40 +0100
changeset 117 c63ee96dbe5f
permissions -rw-r--r--
Missing activityfw and taskswitcher components - fix for Bug 3670

/*
* Copyright (c) 2009 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 RUNNINGAPPSERVER_H
#define RUNNINGAPPSERVER_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <w32std.h>
#include "tsdataobserver.h"

class CTsResourceManager;
class CTsWindowGroupsMonitor;
class MTsModel;
class CTsRunningAppModel;
class CTsStorage;
class CTsSerializedDataProvider;
class CTsServiceProvider;

/**
 *  CRunningAppServer
 * 
 */
class CRunningAppServer : public CServer2,
                          public MTsDataObserver,
                          public MTsDataObserverStorage
{
public:
    /**
     * Destructor.
     */
    ~CRunningAppServer();

    /**
     * Two-phased constructor.
     */
    static CRunningAppServer* NewLC();
    
public: //MHsDataObserver
    void DataChanged();
    
public: //MHsDataObserverStorage
    void PushL(CTsDataObserver*);
    void Pop(CTsDataObserver*);
    void Cancel(const RMessage2&);
    void Invalidate(const CSession2* session);

private:
    /**
     * Constructor for performing 1st stage construction
     */
    CRunningAppServer();

    /**
     * Default constructor for performing 2nd stage construction
     */
    void ConstructL();

    /**
     * Interface implementation
     * @see CServer2::NewSessionL(const TVersion&, const RMessage2&)
     */
    CSession2* NewSessionL(const TVersion& version, const RMessage2& message) const;
    
    void addProviders(RPointerArray<MTsModel> &dst, const CTsServiceProvider& serviceProvider);

private:
    RPointerArray<CTsDataObserver> mObservers;
    RWsSession mWsSession;
    CTsResourceManager* mResources;
    CTsWindowGroupsMonitor* mMonitor;
    CTsSerializedDataProvider* mSerializer;
    CTsStorage* mStorage; 
    CTsServiceProvider* mServiceProvider;
    CTsRunningAppModel* mAppsModel;
    CBase *mBacksteppingEngine;
};

#endif // RUNNINGAPPSERVER_H