116
|
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 TSTASKMONITOR_P_H
|
|
18 |
#define TSTASKMONITOR_P_H
|
|
19 |
|
|
20 |
|
|
21 |
#include <w32std.h>
|
|
22 |
|
|
23 |
#include <QList>
|
|
24 |
#include <QSharedPointer>
|
|
25 |
#include <QPair>
|
|
26 |
#include <QDateTime>
|
|
27 |
|
|
28 |
#include "tstaskmonitorobserver.h"
|
|
29 |
#include "tstasklauncher.h"
|
|
30 |
#include "tstaskmonitor.h"
|
|
31 |
|
|
32 |
class RDesReadStream;
|
|
33 |
class TsTask;
|
|
34 |
class TsTaskContent;
|
|
35 |
class CTsTaskMonitorClient;
|
|
36 |
class TsTaskMonitorHistory;
|
|
37 |
|
|
38 |
class TsTaskMonitorPrivate : public MTsTaskMonitorObserver, public TsTaskLauncher
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
TsTaskMonitorPrivate(TsTaskMonitor *q);
|
|
42 |
virtual ~TsTaskMonitorPrivate();
|
|
43 |
|
|
44 |
public:
|
|
45 |
QList<TsTaskChange> changeList(bool fullList = false);
|
|
46 |
|
|
47 |
public: // from MTsTaskMonitorObserver
|
|
48 |
virtual void HandleRunningAppChange();
|
|
49 |
|
|
50 |
public: // from TsTaskLauncher
|
|
51 |
virtual void openTask(const QByteArray &key);
|
|
52 |
virtual void closeTask(const QByteArray &key);
|
|
53 |
|
|
54 |
private: // helper methods
|
|
55 |
TsTaskMonitorHistory internalizeContentL(RDesReadStream &dataStream,
|
|
56 |
QSharedPointer<TsTaskContent> &content );
|
|
57 |
QDateTime dateTimeFromS60(const TTime &s60Time);
|
|
58 |
|
|
59 |
//for comparing algorithm
|
|
60 |
int findItemIndex(const QList<TsTaskMonitorHistory> &historyList,
|
|
61 |
const TsTaskMonitorHistory &item );
|
|
62 |
QList<int> findInserts(const QList<TsTaskMonitorHistory> &newHistory);
|
|
63 |
QList<int> findDeletes(const QList<TsTaskMonitorHistory> &newHistory);
|
|
64 |
QList<TsTaskChange> getDeletesChangeset(const QList<int> &deleteList);
|
|
65 |
QList<TsTaskChange> getInsertsChangeset(const QList<int> &insertList,
|
|
66 |
const QList< QSharedPointer<TsTaskContent> > &taskList);
|
|
67 |
QList<TsTaskMonitorHistory> substractInsertsFromNew(
|
|
68 |
const QList<int> &insertList,
|
|
69 |
const QList<TsTaskMonitorHistory> &newHistory );
|
|
70 |
QList<TsTaskMonitorHistory> substractDeletesFromOld(
|
|
71 |
const QList<int> &deleteList);
|
|
72 |
QList<TsTaskChange> findMovesAndUpdates(
|
|
73 |
const QList<TsTaskMonitorHistory> &newMinusInserts,
|
|
74 |
const QList< QSharedPointer<TsTaskContent> > &taskList,
|
|
75 |
QList<TsTaskMonitorHistory> &workingList);
|
|
76 |
|
|
77 |
private:
|
|
78 |
TsTaskMonitor *q_ptr;
|
|
79 |
CTsTaskMonitorClient *mClient;
|
|
80 |
RWsSession &mWsSession;
|
|
81 |
QList<TsTaskMonitorHistory> mTaskHistory;
|
|
82 |
};
|
|
83 |
|
|
84 |
#endif //TSTASKMONITOR_P_H
|