messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h
changeset 23 238255e8b033
child 25 84d9eb65b26f
equal deleted inserted replaced
5:4697dfb2d7ad 23:238255e8b033
       
     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 <hbwidget.h>
       
    21 
       
    22 #include "convergedmessage.h"
       
    23 
       
    24 class HbTextItem;
       
    25 class HbLineEdit;
       
    26 class HbIconItem;
       
    27 class UniEditorGenUtils;
       
    28 
       
    29 class MsgUnifiedEditorSubject : public HbWidget
       
    30     {
       
    31     Q_OBJECT
       
    32 
       
    33 public:
       
    34 
       
    35     /**
       
    36      * Constructor
       
    37      */
       
    38     MsgUnifiedEditorSubject(const QString& pluginPath, QGraphicsItem *parent = 0);
       
    39 
       
    40     /**
       
    41      * Destructor
       
    42      */
       
    43     ~MsgUnifiedEditorSubject();
       
    44 
       
    45     /**
       
    46      * to set priority.
       
    47      * @param priority MsgPriority {High,Normal,Low}
       
    48      */
       
    49     void setPriority(ConvergedMessage::Priority priority);
       
    50     
       
    51     /**
       
    52      * returns content of subject field.
       
    53      */
       
    54     QString text();
       
    55 
       
    56     /**
       
    57      * return the priority of this message
       
    58      */
       
    59     ConvergedMessage::Priority priority();
       
    60     
       
    61     /**
       
    62      * get size of content in bytes
       
    63      */
       
    64     int subjectSize();
       
    65 
       
    66     /**
       
    67      * set the text on the subject field
       
    68      * @param text
       
    69      */
       
    70     void setText(const QString& text);
       
    71 
       
    72 signals:
       
    73     /**
       
    74      * Emitted when MMS content is added or removed
       
    75      */
       
    76     void mmContentAdded(bool isAdded);
       
    77     
       
    78     /**
       
    79      * Emitted when subject size changes
       
    80      */
       
    81     void sizeChanged(int aSize);
       
    82     
       
    83 private slots:
       
    84     /**
       
    85      * called when textChanged signal is emitted by the line edit
       
    86      */
       
    87     void onTextChanged(const QString&);
       
    88     
       
    89     /**
       
    90      * Called when textChanged signal is emitted by the line edit
       
    91      * Checks for empty text content 
       
    92      */
       
    93     void onTextRemoved(const QString& text);
       
    94     
       
    95 private:
       
    96     /**
       
    97      * Check if email over sms is supported. If yes, subject is a valid sms field
       
    98      * @return true, if email over sms is supported.
       
    99      */
       
   100     bool subjectOkInSms();
       
   101 
       
   102 private:
       
   103     
       
   104     /**
       
   105      * plug in path.
       
   106      */
       
   107     QString mPluginPath;
       
   108     
       
   109     /**
       
   110      * label to show sub: string.
       
   111      */
       
   112     HbTextItem *mSubjectLabel;
       
   113     
       
   114     /**
       
   115      * line edit to input subject.
       
   116      */
       
   117     HbLineEdit* mSubjectEdit;
       
   118     
       
   119     /**
       
   120      * icon item to display priority.
       
   121      */
       
   122     HbIconItem* mPriorityIcon;
       
   123 
       
   124     /**
       
   125      * priority of the message
       
   126      */
       
   127     ConvergedMessage::Priority mPriority;
       
   128     
       
   129     /**
       
   130      * general utilities
       
   131      */
       
   132     UniEditorGenUtils* mGenUtils;
       
   133     };
       
   134 
       
   135 #endif //UNIFIED_EDITOR_SUBJECT_H