|
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 LOGSRECENTCALLSVIEW_H |
|
18 #define LOGSRECENTCALLSVIEW_H |
|
19 |
|
20 #include "logsfilter.h" |
|
21 #include "logsbaseview.h" |
|
22 #include <QGesture> |
|
23 |
|
24 class HbListView; |
|
25 class HbLabel; |
|
26 class LogsComponentRepository; |
|
27 class LogsModel; |
|
28 class HbAbstractViewItem; |
|
29 class LogsAbstractViewManager; |
|
30 class LogsEffectHandler; |
|
31 class HbGroupBox; |
|
32 class LogsMatchesModel; |
|
33 class LogsPageIndicator; |
|
34 |
|
35 |
|
36 /** |
|
37 * |
|
38 */ |
|
39 class LogsRecentCallsView : public LogsBaseView |
|
40 { |
|
41 Q_OBJECT |
|
42 friend class UT_LogsRecentCallsView; |
|
43 friend class UT_LogsViewManager; |
|
44 |
|
45 public: |
|
46 explicit LogsRecentCallsView( LogsComponentRepository& repository, |
|
47 LogsAbstractViewManager& viewManager ); |
|
48 ~LogsRecentCallsView(); |
|
49 |
|
50 public: // From LogsBaseView |
|
51 |
|
52 virtual void activated(bool showDialer, QVariant args); |
|
53 virtual void deactivated(); |
|
54 virtual bool isExitAllowed(); |
|
55 virtual void resetView(); |
|
56 |
|
57 public slots: |
|
58 |
|
59 void handleExit(); |
|
60 void callKeyPressed(); |
|
61 void markingCompleted(int err); |
|
62 |
|
63 protected slots: // from LogsBaseView |
|
64 |
|
65 virtual void handleBackSoftkey(); |
|
66 void openDialpad(); |
|
67 virtual void dialpadEditorTextChanged(); |
|
68 void changeFilter(HbAction* action); |
|
69 virtual void updateEmptyListWidgetsVisibility(); |
|
70 virtual void updateWidgetsSizeAndLayout(); |
|
71 |
|
72 |
|
73 private slots: |
|
74 |
|
75 void clearList(); |
|
76 void updateView(LogsServices::LogsView view); |
|
77 void leftFlick(); |
|
78 void rightFlick(); |
|
79 void dissappearByFadingComplete(); |
|
80 void dissappearByMovingComplete(); |
|
81 bool markMissedCallsSeen(); |
|
82 void scrollToTopItem(); |
|
83 |
|
84 private: // from LogsBaseView |
|
85 |
|
86 virtual void initView(); |
|
87 virtual QAbstractItemModel* model() const; |
|
88 virtual void updateCallButton(); |
|
89 |
|
90 private: |
|
91 |
|
92 void addStringsToMap(); |
|
93 void initListWidget(); |
|
94 void updateFilter(LogsFilter::FilterType type); |
|
95 void updateViewName(); |
|
96 void updateContextMenuItems(LogsServices::LogsView view); |
|
97 LogsFilter::FilterType getFilter(LogsServices::LogsView view); |
|
98 void changeView(LogsServices::LogsView view); |
|
99 void updateMenu(); |
|
100 void handleMissedCallsMarking(); |
|
101 |
|
102 //from HbWidget |
|
103 void gestureEvent(QGestureEvent *event); |
|
104 |
|
105 QSwipeGesture::SwipeDirection swipeAngleToDirection(int angle, int delta); |
|
106 |
|
107 private: |
|
108 |
|
109 HbGroupBox* mViewName; //not owned |
|
110 HbListView* mListView;//not owned |
|
111 LogsFilter* mFilter; //owned |
|
112 |
|
113 QMap<LogsBaseView::LogsViewMap, QString> mTitleMap; |
|
114 QMap<LogsServices::LogsView, LogsBaseView::LogsViewMap> mConversionMap; |
|
115 |
|
116 LogsModel* mModel; |
|
117 |
|
118 LogsServices::LogsView mCurrentView; |
|
119 LogsServices::LogsView mAppearingView; |
|
120 bool mMoveLeftInList; |
|
121 LogsEffectHandler* mEffectHandler; |
|
122 int mListViewX; |
|
123 LogsMatchesModel* mMatchesModel; |
|
124 bool mMarkingMissedAsSeen; |
|
125 LogsPageIndicator* mPageIndicator; |
|
126 bool mResetted; |
|
127 |
|
128 }; |
|
129 |
|
130 #endif // LOGSRECENTCALLSVIEW_H |