emailuis/nmailui/inc/nmutilities.h
changeset 54 997a02608b3a
parent 53 bf7eb7911fc5
child 68 83cc6bae1de8
equal deleted inserted replaced
53:bf7eb7911fc5 54:997a02608b3a
    21 #include <QObject>
    21 #include <QObject>
    22 
    22 
    23 class NmMessage;
    23 class NmMessage;
    24 class NmMessageEnvelope;
    24 class NmMessageEnvelope;
    25 class NmAddress;
    25 class NmAddress;
    26 class NmOperationCompletionEvent;
       
    27 class QFile;
       
    28 class XQSharableFile;
    26 class XQSharableFile;
    29 class NmOperationCompletionEvent;
       
    30 class HbMessageBox;
    27 class HbMessageBox;
    31 
    28 
    32 /*!
    29 /*!
    33 	UI utilities class
    30 	UI utilities class
    34 */
    31 */
    35 class NmUtilities : public QObject
    32 class NmUtilities : public QObject
    36 {
    33 {
    37     Q_OBJECT
    34     Q_OBJECT
    38 public:
    35 public:
    39     enum NmAddressValidationType {
    36     enum NmAddressValidationType {
    40         ValidAddress,
    37         NmValidAddress,
    41         InvalidAddress,
    38         NmInvalidAddress,
    42         Default
    39         NmDefault
    43     };
    40     };
    44     
       
    45     static void getRecipientsFromMessage( const NmMessage &message, 
    41     static void getRecipientsFromMessage( const NmMessage &message, 
    46         QList<NmAddress> &recipients,
    42         QList<NmAddress> &recipients,
    47         NmAddressValidationType type = Default );
    43         NmAddressValidationType type = NmDefault );
    48     
       
    49     static bool isValidEmailAddress( const QString &emailAddress );
    44     static bool isValidEmailAddress( const QString &emailAddress );
    50     
       
    51     static QString addressToDisplayName( const NmAddress &address );
    45     static QString addressToDisplayName( const NmAddress &address );
    52     
       
    53     static bool parseEmailAddress( const QString &emailAddress, NmAddress &address );
    46     static bool parseEmailAddress( const QString &emailAddress, NmAddress &address );
    54     
       
    55     static QString cleanupDisplayName( const QString &displayName );     
    47     static QString cleanupDisplayName( const QString &displayName );     
    56 
    48     static int openFile(XQSharableFile &file); 
    57     static int openFile(XQSharableFile &file);
       
    58     
       
    59     static QString truncate( const QString &string, int length );
    49     static QString truncate( const QString &string, int length );
    60 
       
    61     static QString attachmentSizeString(const int sizeInBytes);
    50     static QString attachmentSizeString(const int sizeInBytes);
    62 
       
    63     static void displayErrorNote(QString noteText); 
    51     static void displayErrorNote(QString noteText); 
    64 
    52     static HbMessageBox *displayQuestionNote(QString noteText,
    65     static HbMessageBox* displayQuestionNote(QString noteText,
    53                                              QObject *receiver = 0,
    66                                              QObject* receiver = 0,
    54                                              const char *member = 0);
    67                                              const char* member = 0);
    55    
    68     
    56     static HbMessageBox *displayWarningNote(QString noteText,
    69     static HbMessageBox* displayWarningNote(QString noteText,
    57                                             QObject *receiver = 0,
    70                                             QObject* receiver = 0,
    58                                             const char *member = 0);
    71                                             const char* member = 0);
       
    72 
       
    73     static QString createReplyHeader(const NmMessageEnvelope &env);
    59     static QString createReplyHeader(const NmMessageEnvelope &env);
    74 };
    60 };
    75 
    61 
    76 #endif /* NMUTILITIES_H_ */
    62 #endif /* NMUTILITIES_H_ */