author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 04 Oct 2010 00:13:15 +0300 | |
changeset 72 | 6f657153cbc5 |
parent 70 | a15d9966050f |
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:Header for entering To field (phone number, contact name). |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
18 |
#ifndef MSG_UNIFIED_EDITOR_ADDRESS_H |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
19 |
#define MSG_UNIFIED_EDITOR_ADDRESS_H |
31 | 20 |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
21 |
#include <msgunieditorbasewidget.h> |
31 | 22 |
|
23 |
#include <convergedmessageaddress.h> |
|
24 |
#include <QMap> |
|
25 |
||
26 |
class HbTextItem; |
|
27 |
class HbPushButton; |
|
28 |
class HbLineEdit; |
|
29 |
class HbAction; |
|
30 |
class MsgUnifiedEditorLineEdit; |
|
31 |
||
32 |
class MsgUnifiedEditorAddress : public MsgUnifiedEditorBaseWidget |
|
33 |
{ |
|
34 |
Q_OBJECT |
|
35 |
||
36 |
public: |
|
37 |
||
38 |
/** |
|
39 |
* Constructor |
|
40 |
*/ |
|
41 |
MsgUnifiedEditorAddress(const QString& label, |
|
42 |
QGraphicsItem *parent = 0); |
|
43 |
||
44 |
/** |
|
45 |
* Destructor |
|
46 |
*/ |
|
47 |
~MsgUnifiedEditorAddress(); |
|
48 |
||
49 |
/** |
|
50 |
* Seeker method to return back data to editor's view |
|
51 |
* By default, does not remove duplicates. |
|
52 |
* @param removeDuplicates, True if duplicate removal is needed |
|
53 |
*/ |
|
54 |
ConvergedMessageAddressList addresses(bool removeDuplicates=false); |
|
55 |
||
56 |
/** |
|
57 |
* Get total number of recipient's (including duplicates) |
|
58 |
*/ |
|
59 |
int addressCount(); |
|
60 |
||
61 |
/** |
|
62 |
* setter method to set address |
|
63 |
* @param addrlist, list of addresses to be set in address editor |
|
64 |
*/ |
|
70
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
65 |
void setAddresses(ConvergedMessageAddressList addrlist,bool aSkipCheck=FALSE); |
31 | 66 |
|
67 |
/** |
|
68 |
* Get amount of digits to be used in contact matching |
|
69 |
*/ |
|
70 |
static int contactMatchDigits(); |
|
71 |
||
72 |
/** |
|
73 |
* setter method to enable flag to skip max recipient limit query |
|
74 |
*/ |
|
75 |
void skipMaxRecipientQuery(bool skip); |
|
76 |
||
77 |
/** |
|
78 |
* validate contacts |
|
79 |
*/ |
|
80 |
bool validateContacts(); |
|
81 |
||
82 |
public slots: |
|
83 |
/** |
|
84 |
* To set focus on editable field. |
|
85 |
*/ |
|
86 |
void setFocus(); |
|
87 |
||
88 |
signals: |
|
89 |
/** |
|
90 |
* Emitted when send button from virtual ITUT is pressed. |
|
91 |
*/ |
|
92 |
void sendMessage(); |
|
93 |
||
94 |
/** |
|
95 |
* Emitted when content is added or removed |
|
96 |
*/ |
|
97 |
void contentChanged(); |
|
98 |
||
99 |
private slots: |
|
100 |
||
101 |
/** |
|
102 |
* called after selection from pbk. |
|
103 |
*/ |
|
104 |
void fetchContacts(); |
|
105 |
/** |
|
106 |
* Slot for handling valid returns from the phonebook contacts fetched. |
|
107 |
*/ |
|
108 |
void handleOk(const QVariant& result); |
|
109 |
||
110 |
/** |
|
111 |
* Slot for handling errors. Error ids are provided as |
|
112 |
*/ |
|
113 |
void handleError(int errorCode, const QString& errorMessage); |
|
114 |
||
115 |
/** |
|
116 |
* Called when contentsChanged signal is emitted by the line edit |
|
117 |
*/ |
|
118 |
void onContentsChanged(const QString&); |
|
119 |
||
120 |
/** |
|
121 |
* launch query for recipient limit usecase |
|
122 |
*/ |
|
123 |
void handleRecipientLimitReached(); |
|
124 |
||
125 |
/** |
|
126 |
* This slot is called when max recipients reached dialog is launched. |
|
127 |
* @param action selected action (yes or no). |
|
128 |
*/ |
|
129 |
void onMaxRecipientsReached(HbAction*); |
|
130 |
||
131 |
/** |
|
132 |
* Handle invalid contact dialog useraction |
|
133 |
*/ |
|
134 |
void handleInvalidContactDialog(HbAction* act); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
135 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
136 |
/** |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
137 |
* Unblocks signals for pbk buttion after some delay. |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
138 |
*/ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
139 |
void unblockSignals(); |
31 | 140 |
|
141 |
private: |
|
142 |
/** |
|
143 |
* Remove edit-field's user-deleted addresses from Map |
|
144 |
*/ |
|
145 |
void syncDeletionsToMap(); |
|
146 |
||
147 |
/** |
|
148 |
* Add edit-field's user-added addresses to Map |
|
149 |
*/ |
|
150 |
void syncAdditionsToMap(); |
|
151 |
||
152 |
/** |
|
153 |
* Removes duplicate addresses and gives unique address list |
|
154 |
*/ |
|
155 |
QStringList uniqueAddressList(); |
|
156 |
||
157 |
/** |
|
158 |
* Reset the addresslist to previous list |
|
159 |
*/ |
|
160 |
void resetToPrevious(); |
|
161 |
||
162 |
private: |
|
163 |
||
164 |
/** |
|
165 |
* Push button to launch phone book. |
|
166 |
*/ |
|
167 |
HbPushButton* mLaunchBtn; |
|
168 |
||
169 |
/** |
|
170 |
* line edit field. |
|
171 |
*/ |
|
172 |
MsgUnifiedEditorLineEdit* mAddressEdit; |
|
173 |
||
174 |
/** |
|
175 |
* address map. |
|
176 |
*/ |
|
177 |
QMap<QString, QString> mAddressMap; |
|
178 |
||
179 |
/** |
|
180 |
* holds the previous buffer inside address field |
|
181 |
*/ |
|
182 |
QString mPrevBuffer; |
|
183 |
||
184 |
/** |
|
185 |
* flag to skip max recipient limit query |
|
186 |
*/ |
|
187 |
bool mSkipMaxRecipientQuery; |
|
188 |
||
189 |
/** |
|
190 |
* flag to indicate that the SMS recipient limit is about |
|
191 |
* to be exceeded by a bulk insertion of addresses e.g. multiple |
|
192 |
* selection from contact selection dialog |
|
193 |
*/ |
|
194 |
bool mAboutToExceedMaxSmsRecipients; |
|
195 |
||
196 |
/** |
|
197 |
* flag to indicate that the MMS recipient limit is about |
|
198 |
* to be exceeded by a bulk insertion of addresses e.g. multiple |
|
199 |
* selection from contact selection dialog |
|
200 |
*/ |
|
201 |
bool mAboutToExceedMaxMmsRecipients; |
|
202 |
||
203 |
/** |
|
204 |
* count by which a bulk-insertion will exceed max MMS recipient |
|
205 |
* limit e.g. multiple selection from contact selection dialog |
|
206 |
*/ |
|
207 |
int mExceedsMaxMmsRecipientsBy; |
|
208 |
}; |
|
209 |
||
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
210 |
#endif //MSG_UNIFIED_EDITOR_ADDRESS_H |