taskswitcher/server/inc/tsstorage.h
changeset 121 0b3699f6c654
child 119 50e220be30d1
equal deleted inserted replaced
115:3ab5c078b490 121:0b3699f6c654
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 #ifndef TSSTORAGE_H
       
    18 #define TSSTORAGE_H
       
    19 #include <e32base.h>
       
    20 
       
    21 #include "tsmodel.h"
       
    22 #include "tsmodelobserver.h"
       
    23 #include "tsdataobserver.h"
       
    24 #include "tsdatastorage.h"
       
    25 
       
    26 class CTsStorage: public CBase,
       
    27                   public MTsModel,
       
    28                   public MTsModelObserver,
       
    29                   public MTsDataObserver,
       
    30                   public MTsDataStorage
       
    31 {
       
    32 public:
       
    33     static CTsStorage* NewL(const TArray<MTsModel*> &aDataProviders);
       
    34     ~CTsStorage();
       
    35     
       
    36 private:
       
    37     CTsStorage();
       
    38     void ConstructL(const TArray<MTsModel*> &aDataProviders);
       
    39     TInt ResetModel();
       
    40     void ResetModelL();
       
    41     void PullDataL(const MTsModel& aSrc);
       
    42     void ReorderDataL();
       
    43 
       
    44 public://from MTsModelObserver
       
    45     void DataChanged(MTsModel& aModel);
       
    46 
       
    47 public://from MTsModel
       
    48     TInt Count() const;
       
    49     void SetObserver(MTsModelObserver* aObserver);
       
    50     
       
    51 private://from MTsModel
       
    52     const TDesC& DisplayNameL( TInt aOffset ) const;
       
    53     TInt IconHandleL( TInt aOffset ) const;
       
    54     TTime TimestampL( TInt aOffset ) const;
       
    55     TTime TimestampUpdateL(TInt offset) const;
       
    56     TTsModelItemKey KeyL( TInt aOffset ) const;
       
    57     TBool IsActiveL( TInt aOffset ) const;
       
    58     TBool IsClosableL( TInt aOffset ) const;
       
    59     TBool CloseL( TTsModelItemKey aKey ) const;
       
    60     TBool LaunchL( TTsModelItemKey aKey ) const;
       
    61     TTsModelItem FindL( TTsModelItemKey aKey ) const;
       
    62 
       
    63 public://from MTsDataObserver
       
    64     void DataChanged();
       
    65 
       
    66 public://from MTsDataStorage
       
    67     TBool IsSupported(TInt aFunction) const;
       
    68     void HandleDataL(TInt aFunction, RReadStream& aDataStream);
       
    69 
       
    70 private:
       
    71     RPointerArray<MTsModel> iDataProviders;
       
    72     RArray<TTsModelItem> iData;
       
    73     MTsModelObserver* iDataObserver;
       
    74 
       
    75 };
       
    76 
       
    77 #endif //TSSTORAGE_H