|
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: nmrecipientlineedit.h |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef NMRECIPIENTLINEEDIT_H_ |
|
19 #define NMRECIPIENTLINEEDIT_H_ |
|
20 |
|
21 #include <nmailuiwidgetsdef.h> |
|
22 #include <nmhtmllineedit.h> |
|
23 #include <nmaddress.h> |
|
24 |
|
25 class QGraphicsItem; |
|
26 |
|
27 |
|
28 class NMAILUIWIDGETS_EXPORT NmRecipientLineEdit : public NmHtmlLineEdit |
|
29 { |
|
30 Q_OBJECT |
|
31 |
|
32 public: |
|
33 NmRecipientLineEdit(QGraphicsItem *parent = 0); |
|
34 virtual ~NmRecipientLineEdit(); |
|
35 |
|
36 // Get the emailaddress list generated from the content of the lineedit. |
|
37 QList<NmAddress> emailAddressList(); |
|
38 |
|
39 public slots: |
|
40 #ifdef Q_OS_SYMBIAN |
|
41 void addSelectedContacts(const QVariant &selectedContacts); |
|
42 #endif |
|
43 |
|
44 protected: // from HbLineEdit |
|
45 void keyPressEvent(QKeyEvent *event); |
|
46 void inputMethodEvent(QInputMethodEvent *event); |
|
47 |
|
48 private: |
|
49 // Generate emailaddress list from the content of the lineedit. |
|
50 void generateEmailAddressList(); |
|
51 |
|
52 private slots: |
|
53 void handleTextChanged(const QString &text); |
|
54 |
|
55 private: |
|
56 // mEmailAddressList contains all emailaddress that appear in the lineedit and |
|
57 // all emailaddress corresponding to the contact's name added from Contacts, |
|
58 // including invalid emailaddress user typed or invalid emailaddress added from Contacts. |
|
59 // Emailaddress validation check is conducted in nmeditorview. |
|
60 QList<NmAddress> mEmailAddressList; |
|
61 |
|
62 QList<NmAddress> mRecipientsAddedFromContacts; |
|
63 |
|
64 // Flag "need to generate mEmailAddressList" is used whenever editing made after |
|
65 // the emailaddress validation check failed. |
|
66 bool mNeedToGenerateEmailAddressList; |
|
67 }; |
|
68 |
|
69 #endif // NMRECIPIENTLINEEDIT_H_ |