|
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 *aObserver ); |
|
42 |
|
43 protected: //from MTsModel |
|
44 const TDesC& DisplayNameL( TInt aOffset ) const; |
|
45 TInt IconHandleL( TInt aOffset ) const; |
|
46 TTime TimestampL( TInt aOffset ) const; |
|
47 TTime TimestampUpdateL(TInt offset) const; |
|
48 TTsModelItemKey KeyL( TInt aOffset ) const; |
|
49 TBool IsActiveL( TInt aOffset ) const; |
|
50 TBool IsClosableL( TInt aOffset ) const; |
|
51 TBool CloseL( TTsModelItemKey aKey ) const; |
|
52 TBool LaunchL( TTsModelItemKey aKey ) const; |
|
53 |
|
54 private: |
|
55 CTsService(); |
|
56 void ConstructL( QObject* aModel ); |
|
57 TInt IntValueL( TInt aOffset, const char* aKey ) const; |
|
58 TTime TimeValueL( TInt aOffset, const char* aKey ) const; |
|
59 const TDesC& StringValueL( TInt aOffset, const char* aKey ) const; |
|
60 private: |
|
61 QObject *iModel; |
|
62 QObject *iServiceObserver; |
|
63 MTsModelObserver *iModelObserver; |
|
64 HBufC *iBuffer; |
|
65 }; |
|
66 #endif //TSSERVICE_H |