|
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 TSRUNNINGAPPMODEL_H |
|
18 #define TSRUNNINGAPPMODEL_H |
|
19 |
|
20 #include "tsmodel.h" |
|
21 #include "tsdatastorage.h" |
|
22 #include "tsdataobserver.h" |
|
23 |
|
24 #include <tswindowgroupsobserver.h> |
|
25 |
|
26 class CTsDataList; |
|
27 class CTsScreenshotProvider; |
|
28 |
|
29 NONSHARABLE_CLASS(CTsRunningAppModel) : public CBase, public MTsModel, public MTsDataStorage, public MTsDataObserver |
|
30 { |
|
31 |
|
32 public: |
|
33 static CTsRunningAppModel *NewL(MTsResourceManager &resources, MTsWindowGroupsMonitor &monitor); |
|
34 static CTsRunningAppModel *NewLC(MTsResourceManager &resources, MTsWindowGroupsMonitor &monitor); |
|
35 |
|
36 ~CTsRunningAppModel(); |
|
37 |
|
38 private: |
|
39 CTsRunningAppModel(MTsResourceManager &resources); |
|
40 void ConstructL(MTsResourceManager &resources, MTsWindowGroupsMonitor &monitor); |
|
41 |
|
42 // MHsDataObserver interface implementation |
|
43 public: |
|
44 virtual void DataChanged(); |
|
45 |
|
46 // MTsDataStorage interface implementation |
|
47 public: |
|
48 TBool isSupported(TInt function) const; |
|
49 void handleDataL(TInt function, RReadStream& dataStream); |
|
50 |
|
51 public: |
|
52 virtual TInt count() const; |
|
53 virtual void setObserver(MTsModelObserver *observer); |
|
54 |
|
55 public: |
|
56 virtual const TDesC& displayNameL(TInt offset) const; |
|
57 virtual TInt iconHandleL(TInt offset) const; |
|
58 virtual TTime timestampL(TInt offset) const; |
|
59 virtual TTsModelItemKey keyL(TInt offset) const; |
|
60 virtual TBool isActiveL(TInt offset) const; |
|
61 virtual TBool isClosableL(TInt offset) const; |
|
62 |
|
63 public: |
|
64 virtual TBool closeL(TTsModelItemKey key) const; |
|
65 virtual TBool launchL(TTsModelItemKey key) const; |
|
66 |
|
67 private: // owned |
|
68 CTsDataList *mDataList; |
|
69 |
|
70 private: // not owned |
|
71 MTsModelObserver *mObserver; |
|
72 CTsScreenshotProvider *mScreenshotProvider; |
|
73 MTsResourceManager &mResources; |
|
74 |
|
75 }; |
|
76 |
|
77 #endif //TSRUNNINGAPPMODEL_H |