|
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: Drafts List View for displaying drafts messages. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef DRAFTS_LISTVIEW_H |
|
19 #define DRAFTS_LISTVIEW_H |
|
20 |
|
21 #include <msgbaseview.h> |
|
22 |
|
23 // FORWARD DECLARATIONS |
|
24 class HbListView; |
|
25 class HbListWidget; |
|
26 class HbListWidgetItem; |
|
27 class HbAbstractViewItem; |
|
28 |
|
29 /** |
|
30 * List view implementation for showing Draft messages. |
|
31 */ |
|
32 class DraftsListView: public MsgBaseView |
|
33 { |
|
34 Q_OBJECT |
|
35 |
|
36 public: |
|
37 /** |
|
38 * Constructor |
|
39 */ |
|
40 explicit DraftsListView(QGraphicsItem *parent = 0); |
|
41 |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 virtual ~DraftsListView(); |
|
46 |
|
47 private: |
|
48 /** |
|
49 * Creates the view items like menu, toolbar & list etc. |
|
50 */ |
|
51 void createView(); |
|
52 |
|
53 /** |
|
54 * Creates the menu items. |
|
55 */ |
|
56 void setupMenu(); |
|
57 |
|
58 /** |
|
59 * Creates the toolbar & toolbar extension. |
|
60 */ |
|
61 void setupToolbar(); |
|
62 |
|
63 /** |
|
64 * Creates the list view. |
|
65 */ |
|
66 void setupListView(); |
|
67 |
|
68 private slots: |
|
69 /** |
|
70 * Opens a Draft message. |
|
71 */ |
|
72 void openDraftMessage(); |
|
73 |
|
74 /** |
|
75 * Deletes a Draft message. |
|
76 */ |
|
77 void deleteDraftMessage(); |
|
78 |
|
79 /** |
|
80 * Invokes editor for creating new message. |
|
81 */ |
|
82 void createNewMessage(); |
|
83 |
|
84 /** |
|
85 * Opens a Draft message. |
|
86 * @param index Index of the list item activated. |
|
87 */ |
|
88 void openDraftMessage(const QModelIndex &index); |
|
89 |
|
90 /** |
|
91 * Item specific long press handler. |
|
92 * @param item Item which is long pressed. |
|
93 * @param coords Screen coordinates of the click. |
|
94 */ |
|
95 void handleLongPressed(HbAbstractViewItem *item, const QPointF &coords); |
|
96 |
|
97 /** |
|
98 * Handles toolbar extension item clicks. |
|
99 * @param item Activated toolbar extension item. |
|
100 */ |
|
101 void handleViewExtnActivated(HbListWidgetItem *item); |
|
102 |
|
103 private: |
|
104 |
|
105 /** |
|
106 * List view for Draft messages. |
|
107 * Own. |
|
108 */ |
|
109 HbListView *mListView; |
|
110 |
|
111 /** |
|
112 * Container widget of toolbar extension. |
|
113 * ToolBar takes ownership. |
|
114 */ |
|
115 HbListWidget *mViewExtnList; |
|
116 |
|
117 /** |
|
118 * Views in toolbar extension. |
|
119 */ |
|
120 enum viewExtnIds |
|
121 { |
|
122 DRAFTS_EXTN = 0x00, CONVERSATIONS_EXTN = 0x01 |
|
123 }; |
|
124 }; |
|
125 |
|
126 #endif /* DRAFTS_LISTVIEW_H */ |
|
127 |
|
128 // EOF |