emailuis/nmailuiwidgets/inc/nmrecipientlineedit.h
changeset 18 578830873419
child 20 ecc8def7944a
equal deleted inserted replaced
4:e7aa27f58ae1 18:578830873419
       
     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 insertSelectedContacts(const QVariant &selectedContacts);
       
    42 #endif
       
    43     void insertText(const QString &text);
       
    44 
       
    45 protected:	// from HbLineEdit
       
    46     void keyPressEvent(QKeyEvent *event);
       
    47     void inputMethodEvent(QInputMethodEvent *event);
       
    48 
       
    49 private:
       
    50     // Generate emailaddress list from the content of the lineedit.
       
    51     void generateEmailAddressList();
       
    52 	
       
    53 private slots:    
       
    54     void handleTextChanged(const QString &text);
       
    55 
       
    56 private:
       
    57     // mEmailAddressList contains all emailaddress that appear in the lineedit and 
       
    58     // all emailaddress corresponding to the name inserted from PhoneBook,
       
    59     // including invalid emailaddress user typed or invalid emailaddress picked from PhoneBook.
       
    60     // Emailaddress validation check is conducted in nmeditorview.
       
    61     QList<NmAddress> mEmailAddressList; 
       
    62 	
       
    63     QList<NmAddress> mContactsSelectedFromPhoneBook;
       
    64 	
       
    65     // Flag "need to generate mEmailAddressList" is used whenever editing made after 
       
    66     // the emailaddress validation check failed.
       
    67     bool mNeedToGenerateEmailAddressList;
       
    68 };
       
    69 
       
    70 #endif   // NMRECIPIENTLINEEDIT_H_