messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h
changeset 31 ebfee66fde93
child 34 84197e66a4bd
equal deleted inserted replaced
30:6a20128ce557 31:ebfee66fde93
       
     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:
       
    15  */
       
    16 
       
    17 #ifndef UNIFIED_EDITOR_SUBJECT_H
       
    18 #define UNIFIED_EDITOR_SUBJECT_H
       
    19 
       
    20 #include <msgunifiededitorbasewidget.h>
       
    21 
       
    22 #include "convergedmessage.h"
       
    23 
       
    24 class HbIconItem;
       
    25 class UniEditorGenUtils;
       
    26 class MsgUnifiedEditorLineEdit;
       
    27 
       
    28 class MsgUnifiedEditorSubject : public MsgUnifiedEditorBaseWidget
       
    29     {
       
    30     Q_OBJECT
       
    31 
       
    32 public:
       
    33 
       
    34     /**
       
    35      * Constructor
       
    36      */
       
    37     MsgUnifiedEditorSubject(QGraphicsItem *parent = 0);
       
    38 
       
    39     /**
       
    40      * Destructor
       
    41      */
       
    42     ~MsgUnifiedEditorSubject();
       
    43 
       
    44     /**
       
    45      * to set priority.
       
    46      * @param priority MsgPriority {High,Normal,Low}
       
    47      */
       
    48     void setPriority(ConvergedMessage::Priority priority);
       
    49     
       
    50     /**
       
    51      * returns content of subject field.
       
    52      */
       
    53     QString text();
       
    54 
       
    55     /**
       
    56      * return the priority of this message
       
    57      */
       
    58     ConvergedMessage::Priority priority();
       
    59     
       
    60     /**
       
    61      * get size of content in bytes
       
    62      */
       
    63     int subjectSize();
       
    64 
       
    65     /**
       
    66      * set the text on the subject field
       
    67      * @param text
       
    68      */
       
    69     void setText(const QString& text);
       
    70     
       
    71     /**
       
    72      * To set focus on editable field.
       
    73      */
       
    74     void setFocus();
       
    75 
       
    76 signals:
       
    77     /**
       
    78      * Emitted when subject/priority content is added or removed
       
    79      */
       
    80     void contentChanged();
       
    81     
       
    82 private slots:
       
    83     /**
       
    84      * called when contentsChanged signal is emitted by the line edit
       
    85      */
       
    86     void onContentsChanged(const QString&);
       
    87     
       
    88 private:
       
    89     /**
       
    90      * Check if email over sms is supported. If yes, subject is a valid sms field
       
    91      * @return true, if email over sms is supported.
       
    92      */
       
    93     bool subjectOkInSms();
       
    94 
       
    95 private:
       
    96     
       
    97     /**
       
    98      * line edit to input subject.
       
    99      */
       
   100     MsgUnifiedEditorLineEdit* mSubjectEdit;
       
   101     
       
   102     /**
       
   103      * icon item to display priority.
       
   104      */
       
   105     HbIconItem* mPriorityIcon;
       
   106 
       
   107     /**
       
   108      * priority of the message
       
   109      */
       
   110     ConvergedMessage::Priority mPriority;
       
   111     
       
   112     /**
       
   113      * general utilities
       
   114      */
       
   115     UniEditorGenUtils* mGenUtils;
       
   116     
       
   117     /**
       
   118      * Holds the previous buffer inside subject field
       
   119      */
       
   120     QString mPrevBuffer;
       
   121     };
       
   122 
       
   123 #endif //UNIFIED_EDITOR_SUBJECT_H