taskswitcher/server/inc/tsservice.h
changeset 117 c63ee96dbe5f
equal deleted inserted replaced
115:3ab5c078b490 117:c63ee96dbe5f
       
     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 TSSERVICE_H
       
    18 #define TSSERVICE_H
       
    19 
       
    20 #include <e32base.h>
       
    21 
       
    22 #include "tsmodel.h"
       
    23 #include "tsdataobserver.h"
       
    24 
       
    25 class QObject;
       
    26 class TsAbstractModel;
       
    27 
       
    28 class CTsService: public CBase,
       
    29                   public MTsModel,
       
    30                   public MTsDataObserver
       
    31 {
       
    32 public:
       
    33     static CTsService* NewLC(QObject* model);
       
    34     ~CTsService();
       
    35 
       
    36 public: //from MTsDataObserver
       
    37     void DataChanged();
       
    38 
       
    39 public: //from MTsModel
       
    40     TInt count() const;
       
    41     void setObserver(MTsModelObserver *observer);
       
    42     
       
    43 protected: //from MTsModel
       
    44     const TDesC& displayNameL(TInt offset) const;
       
    45     TInt iconHandleL(TInt offset) const;
       
    46     TTime timestampL(TInt offset) const;
       
    47     TTsModelItemKey keyL(TInt offset) const;
       
    48     TBool isActiveL(TInt offset) const;
       
    49     TBool isClosableL(TInt offset) const;
       
    50     TBool closeL(TTsModelItemKey key) const;
       
    51     TBool launchL(TTsModelItemKey key) const;
       
    52     
       
    53 private:
       
    54     CTsService();
       
    55     void ConstructL(QObject* model);
       
    56     TInt intValueL(TInt offset, const char *key) const;
       
    57     TTime timeValueL(TInt offset, const char *key) const;
       
    58     const TDesC& stringValueL(TInt offset, const char *key) const;
       
    59 private:
       
    60     QObject *mModel;
       
    61     QObject *mServiceObserver;
       
    62     MTsModelObserver *mModelObserver;
       
    63     HBufC *mBuffer;
       
    64 };
       
    65 #endif //TSSERVICE_H