|
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 |
|
18 #ifndef LOGSENGINEAPITESTER_H |
|
19 #define LOGSENGINEAPITESTER_H |
|
20 |
|
21 #include <HbView.h> |
|
22 |
|
23 class HbListView; |
|
24 class HbLabel; |
|
25 class LogsModel; |
|
26 class LogsCustomFilter; |
|
27 class QAbstractItemModel; |
|
28 class TestModel; |
|
29 class LogsEvent; |
|
30 class CRepository; |
|
31 class LogsFilter; |
|
32 |
|
33 class TestView : public HbView |
|
34 { |
|
35 Q_OBJECT |
|
36 public: |
|
37 TestView(); |
|
38 ~TestView(); |
|
39 |
|
40 public slots: |
|
41 void changeFilter(); |
|
42 void addMissedCall(); |
|
43 void clearMissedCalls(); |
|
44 void updateMissedCallsLabel(); |
|
45 void deleteEvents(); |
|
46 void markingCompleted(int err); |
|
47 void clearingCompleted(int err); |
|
48 |
|
49 private: |
|
50 HbListView* mList; |
|
51 HbLabel* mLabel; |
|
52 TestModel* mModel; |
|
53 LogsModel* mLogsModel; |
|
54 LogsCustomFilter* mFilter; |
|
55 bool mShowAll; |
|
56 CRepository* mRepository; |
|
57 LogsFilter* mMissedCallsFilter; |
|
58 |
|
59 }; |
|
60 |
|
61 class TestModel : public QAbstractListModel |
|
62 { |
|
63 Q_OBJECT |
|
64 |
|
65 public: |
|
66 TestModel(QAbstractItemModel& logsModel); |
|
67 ~TestModel(); |
|
68 |
|
69 public: // From QAbstractListModel |
|
70 virtual int rowCount(const QModelIndex &parent) const; |
|
71 virtual QVariant data(const QModelIndex &index, int role) const; |
|
72 |
|
73 public slots: |
|
74 void handleModelUpdated(); |
|
75 |
|
76 private: |
|
77 void readEvents(); |
|
78 QString directionText(const LogsEvent& event); |
|
79 |
|
80 private: |
|
81 QStringList mEvents; |
|
82 QAbstractItemModel& mLogsModel; |
|
83 |
|
84 }; |
|
85 |
|
86 #endif |