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: 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 HbToolBar;
|
|
25 |
class HbListView;
|
|
26 |
class HbListWidget;
|
|
27 |
class HbListWidgetItem;
|
|
28 |
class HbAbstractViewItem;
|
|
29 |
class HbAction;
|
|
30 |
/**
|
|
31 |
* List view implementation for showing Draft messages.
|
|
32 |
*/
|
|
33 |
class DraftsListView: public MsgBaseView
|
|
34 |
{
|
|
35 |
Q_OBJECT
|
|
36 |
|
|
37 |
public:
|
|
38 |
/**
|
|
39 |
* Constructor
|
|
40 |
*/
|
|
41 |
explicit DraftsListView(QGraphicsItem *parent = 0);
|
|
42 |
|
|
43 |
/**
|
|
44 |
* Destructor
|
|
45 |
*/
|
|
46 |
virtual ~DraftsListView();
|
|
47 |
|
|
48 |
private:
|
|
49 |
|
|
50 |
/**
|
|
51 |
* Creates the menu items.
|
|
52 |
*/
|
|
53 |
void setupMenu();
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Creates the toolbar & toolbar extension.
|
|
57 |
*/
|
|
58 |
void setupToolbar();
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Creates the list view.
|
|
62 |
*/
|
|
63 |
void setupListView();
|
|
64 |
|
|
65 |
private slots:
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Do delayed loading.
|
|
69 |
*/
|
|
70 |
void doDelayedLoading();
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Opens a Draft message.
|
|
74 |
*/
|
|
75 |
void openDraftMessage();
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Deletes a Draft message.
|
|
79 |
*/
|
|
80 |
void deleteDraftMessage();
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Deletes all Draft messages.
|
|
84 |
*/
|
|
85 |
void deleteAllDraftMessage();
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Invokes editor for creating new message.
|
|
89 |
*/
|
|
90 |
void createNewMessage();
|
|
91 |
|
|
92 |
/**
|
|
93 |
* Opens a Draft message.
|
|
94 |
* @param index Index of the list item activated.
|
|
95 |
*/
|
|
96 |
void openDraftMessage(const QModelIndex &index);
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Item specific long press handler.
|
|
100 |
* @param item Item which is long pressed.
|
|
101 |
* @param coords Screen coordinates of the click.
|
|
102 |
*/
|
|
103 |
void handleLongPressed(HbAbstractViewItem *item, const QPointF &coords);
|
|
104 |
|
|
105 |
/**
|
|
106 |
* Handles toolbar extension item clicks.
|
|
107 |
* @param item Activated toolbar extension item.
|
|
108 |
*/
|
|
109 |
void handleViewExtnActivated(HbListWidgetItem *item);
|
|
110 |
|
|
111 |
/**
|
|
112 |
* This slot is hit when rows are inserted/removed in model.
|
|
113 |
*/
|
|
114 |
void handleModelChanged();
|
|
115 |
|
|
116 |
/**
|
|
117 |
* This slot is called when delete message dialog is launched.
|
|
118 |
* @param action selected action (yes or no).
|
|
119 |
*/
|
|
120 |
void onDialogDeleteMsg(HbAction* action);
|
|
121 |
|
|
122 |
/**
|
|
123 |
* This slot is called when delete message dialog is launched.
|
|
124 |
* @param action selected action (yes or no).
|
|
125 |
*/
|
|
126 |
void onDialogDeleteAllMessages(HbAction* action);
|
|
127 |
|
|
128 |
private:
|
|
129 |
|
|
130 |
/**
|
|
131 |
* List view for Draft messages.
|
|
132 |
* Own.
|
|
133 |
*/
|
|
134 |
HbListView *mListView;
|
|
135 |
|
|
136 |
/**
|
|
137 |
* Container widget of toolbar extension.
|
|
138 |
* ToolBar takes ownership.
|
|
139 |
*/
|
|
140 |
HbListWidget *mViewExtnList;
|
|
141 |
|
|
142 |
/**
|
|
143 |
* Pointer to views toolbar.
|
|
144 |
* Not Own.
|
|
145 |
*/
|
|
146 |
HbToolBar *mToolBar;
|
|
147 |
|
|
148 |
/**
|
|
149 |
* Views in toolbar extension.
|
|
150 |
*/
|
|
151 |
enum viewExtnIds
|
|
152 |
{
|
|
153 |
DRAFTS_EXTN = 0x00, CONVERSATIONS_EXTN = 0x01
|
|
154 |
};
|
|
155 |
|
|
156 |
};
|
|
157 |
|
|
158 |
#endif /* DRAFTS_LISTVIEW_H */
|
|
159 |
|
|
160 |
// EOF
|