author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 17 Sep 2010 08:28:39 +0300 | |
changeset 70 | a15d9966050f |
parent 44 | 36f374c67aa8 |
child 47 | 5b14749788d7 |
permissions | -rw-r--r-- |
31 | 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 MSG_LIST_VIEW_H |
|
19 |
#define MSG_LIST_VIEW_H |
|
20 |
||
21 |
// INCLUDES |
|
22 |
#include "msgbaseview.h" |
|
23 |
||
24 |
// FORWARD DECLARATIONS |
|
25 |
class HbListView; |
|
26 |
class HbAbstractViewItem; |
|
27 |
class HbListWidget; |
|
28 |
class HbListWidgetItem; |
|
29 |
class HbAction; |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
30 |
class QGraphicsLinearLayout; |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
31 |
|
31 | 32 |
/** |
33 |
* This class provides the message list view for the messaging application. |
|
34 |
* Data source for this view is the conversation list model. |
|
35 |
*/ |
|
36 |
class MsgListView: public MsgBaseView |
|
37 |
{ |
|
38 |
Q_OBJECT |
|
39 |
||
40 |
public: |
|
41 |
/** |
|
42 |
* Constructor |
|
43 |
*/ |
|
44 |
explicit MsgListView(QGraphicsItem *parent = 0); |
|
45 |
||
46 |
/** |
|
47 |
* Destructor |
|
48 |
*/ |
|
49 |
virtual ~MsgListView(); |
|
50 |
||
51 |
private slots: |
|
52 |
/* |
|
53 |
* Handler for long tap of a list item. |
|
54 |
* @param viewItem Lon tapped view item |
|
55 |
* @param point X and Y co-ordinates of long tap |
|
56 |
*/ |
|
57 |
void longPressed(HbAbstractViewItem* viewItem, const QPointF& point); |
|
58 |
||
59 |
/* |
|
60 |
* Handler for short tap of a list item and Item specific menu |
|
61 |
* Opens the conversation view. |
|
62 |
* @param index Model index of the list item tapped. |
|
63 |
*/ |
|
64 |
void openConversation(const QModelIndex& index); |
|
65 |
||
66 |
/** |
|
67 |
* Handler for new message button trigger |
|
68 |
*/ |
|
69 |
void sendNewMessage(); |
|
70 |
||
71 |
/** |
|
72 |
*Popup the message settings dialog |
|
73 |
*/ |
|
74 |
void settings(); |
|
75 |
||
76 |
// -------------------------Item Specific Menu----------------------- // |
|
77 |
||
78 |
/** |
|
79 |
* Opens the conversation view. |
|
80 |
*/ |
|
81 |
void openConversation(); |
|
82 |
||
83 |
/** |
|
84 |
* Opens the contact information |
|
85 |
*/ |
|
86 |
void showContact(); |
|
87 |
||
88 |
/** |
|
89 |
* Deletes the seleted item from the list of Conversations |
|
90 |
*/ |
|
91 |
void deleteItem(); |
|
92 |
||
93 |
/** |
|
94 |
* Handles toolbar extension item clicks. |
|
95 |
* @param item Activated toolbar extension item. |
|
96 |
*/ |
|
97 |
void handleViewExtnActivated(HbListWidgetItem *item); |
|
98 |
||
99 |
/** |
|
100 |
* Constructs view when viewReady is emitted. |
|
101 |
*/ |
|
102 |
void doDelayedConstruction(); |
|
103 |
||
104 |
/** |
|
105 |
* Handles saving to contacts |
|
106 |
*/ |
|
107 |
void saveToContacts(); |
|
108 |
||
109 |
/** |
|
110 |
* Opens contact card for resolved contact. |
|
111 |
*/ |
|
112 |
void contactInfo(); |
|
113 |
||
114 |
/** |
|
115 |
* This slot is called when delete message dialog is launched. |
|
116 |
* @param action selected action (yes or no). |
|
117 |
*/ |
|
118 |
void onDialogDeleteMsg(HbAction* action); |
|
119 |
||
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
120 |
/** |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
121 |
* This slot is called when appengine emits the partialdeleteconversationlist event. |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
122 |
* This performs grab of the HbAbstractviewitem on which delete was called. |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
123 |
* @param conversation id of the item. |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
124 |
*/ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
125 |
void enableListitem( int conversationId ); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
126 |
|
31 | 127 |
private: |
128 |
||
129 |
/** |
|
130 |
* Initialize the list view inside the main view |
|
131 |
*/ |
|
132 |
void setupListView(); |
|
133 |
||
134 |
/** |
|
135 |
* Initialize the view specific menu |
|
136 |
*/ |
|
137 |
void setupMenu(); |
|
138 |
||
139 |
/** |
|
140 |
* Initialize the tool bar of the view |
|
141 |
*/ |
|
142 |
void setupToolBar(); |
|
143 |
||
144 |
private: |
|
145 |
/** |
|
146 |
* List view |
|
147 |
* Own. |
|
148 |
*/ |
|
149 |
HbListView* mMsgList; |
|
150 |
||
151 |
/** |
|
152 |
* Container widget of toolbar extension. |
|
153 |
* ToolBar takes ownership. |
|
154 |
*/ |
|
155 |
HbListWidget *mViewExtnList; |
|
156 |
||
157 |
/** |
|
158 |
* Views in toolbar extension. |
|
159 |
*/ |
|
160 |
enum viewExtnIds |
|
161 |
{ |
|
162 |
DRAFTS_EXTN = 0x00, CONVERSATIONS_EXTN = 0x01 |
|
163 |
}; |
|
164 |
||
165 |
/** |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
166 |
* Main layout |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
167 |
* Own |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
168 |
*/ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
169 |
QGraphicsLinearLayout *mMainLayout; |
31 | 170 |
}; |
171 |
||
172 |
#endif // MSG_LIST_VIEW_H |