messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h
changeset 76 60a8a215b0ec
parent 67 fc91263aee62
equal deleted inserted replaced
73:ecf6a73a9186 76:60a8a215b0ec
    20 
    20 
    21 #include <msgunieditorbasewidget.h>
    21 #include <msgunieditorbasewidget.h>
    22 #include <f32file.h>
    22 #include <f32file.h>
    23 #include "msgunieditorprocessimageoperation.h"
    23 #include "msgunieditorprocessimageoperation.h"
    24 
    24 
    25 class HbTextEdit;
       
    26 class HbTextItem;
       
    27 class HbFrameItem;
       
    28 class CMsgMediaResolver;
    25 class CMsgMediaResolver;
    29 class CMsgImageInfo;
    26 class CMsgImageInfo;
    30 class MmsConformanceCheck;
    27 class MmsConformanceCheck;
    31 class UniEditorPluginInterface;
       
    32 class UniEditorPluginLoader;
       
    33 class MsgUnifiedEditorPixmapWidget;
    28 class MsgUnifiedEditorPixmapWidget;
    34 class MsgUniFiedEditorAudioWidget;
    29 class MsgUniFiedEditorAudioWidget;
    35 
    30 
    36 
    31 
    37 class MsgUnifiedEditorBody : public MsgUnifiedEditorBaseWidget,
    32 class MsgUnifiedEditorBody : public MsgUnifiedEditorBaseWidget,
    54     ~MsgUnifiedEditorBody();
    49     ~MsgUnifiedEditorBody();
    55 
    50 
    56     /**
    51     /**
    57      * Seeker method to return back data to editor's view
    52      * Seeker method to return back data to editor's view
    58      */
    53      */
    59     QString text();
       
    60 
       
    61     /**
       
    62      * Seeker method to return back data to editor's view
       
    63      */
       
    64     const QStringList mediaContent();
    54     const QStringList mediaContent();
    65     
    55     
    66     /**
    56     /**
    67      * get size of body content for MMS size calculations
    57      * get size of body content for MMS size calculations
    68      * @return size of body content
    58      * @return size of body content
    69      */
    59      */
    70     int bodySize();
    60     int bodySize();
    71     
    61     
    72     /*
       
    73      * Returns value of mUnicode 
       
    74      * @return mUnicode   
       
    75      */
       
    76      bool isUnicode();
       
    77 
       
    78      /*
       
    79       * Disables char counter
       
    80       */
       
    81      void disableCharCounter();
       
    82 
       
    83      /*
       
    84       * Enables char counter
       
    85       */
       
    86      void enableCharCounter();
       
    87      
       
    88      /**
       
    89       * To set focus on editable field.
       
    90       */
       
    91      void setFocus();
       
    92 
       
    93      /**
    62      /**
    94       * Get to find body already contains an image
    63       * Get to find body already contains an image
    95       * @return bool
    64       * @return bool
    96       */
    65       */
    97      bool hasImage();
    66      bool hasImage();
   106      * from MUniEditorProcessImageOperationObserver  
    75      * from MUniEditorProcessImageOperationObserver  
   107      * @see MUniEditorProcessImageOperationObserver
    76      * @see MUniEditorProcessImageOperationObserver
   108      */ 
    77      */ 
   109     void EditorOperationEvent( TUniEditorProcessImageOperationEvent aEvent,
    78     void EditorOperationEvent( TUniEditorProcessImageOperationEvent aEvent,
   110                                TFileName& aFileName );
    79                                TFileName& aFileName );
   111     /**
       
   112 	 * Function which tells whether the image resize process is in progress
       
   113 	 */
       
   114     bool isImageResizing()
       
   115         {
       
   116         return mIsImageResizing;
       
   117         }
       
   118 
    80 
   119     /**
    81     /**
   120      * remove media content.called when file is not avaialable
    82      * remove media content.called when file is not avaialable
   121      * @param fileName file name
    83      * @param fileName file name
   122      */
    84      */
   126     /**
    88     /**
   127      * Called to insert image content in editor.
    89      * Called to insert image content in editor.
   128      * @param medialist list of absolute paths of media.
    90      * @param medialist list of absolute paths of media.
   129      * @param draftMessage specifies draft message
    91      * @param draftMessage specifies draft message
   130      */
    92      */
   131     void setImage(QString& imagefile, bool draftMessage = false);
    93     void setImage(const QString& imagefile, bool draftMessage = false);
   132 
    94 
   133     /**
    95     /**
   134      * Called to insert audio content in editor.
    96      * Called to insert audio content in editor.
   135      * @param medialist list of absolute paths of media.
    97      * @param medialist list of absolute paths of media.
   136      */
    98      */
   137     void setAudio(QString& audiofile);
    99     void setAudio(const QString& audiofile);
   138 
       
   139     /**
       
   140      * Called to insert body text in editor.
       
   141      * @param text body text.
       
   142      */
       
   143     void setText(QString& text);
       
   144 
       
   145 signals:
       
   146     /**
       
   147      * Emitted when send button from virtual ITUT is pressed.
       
   148      */
       
   149     void sendMessage();
       
   150 
       
   151     /**
       
   152      * Emitted when msg-body content changes
       
   153      */
       
   154     void contentChanged();
       
   155 	
       
   156     /**
       
   157      * Emitted when image is being processed.
       
   158      * @param enable, true to enable/ false to disable.
       
   159      */
       
   160    void enableSendButton(bool enable) const;
       
   161 
       
   162 
   100 
   163 
   101 
   164 protected: // from HbWidget
   102 protected: // from HbWidget
   165     
   103     
   166     /**
   104     /**
   167      * Reimplemented from base class to give proper size.
   105      * Reimplemented from base class to give proper size.
   168      * @see HbWidget
   106      * @see HbWidget
   169      */
   107      */
   170     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
   108     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
   171 
   109 
       
   110 signals:
       
   111     //emitted to enable or disable menu options.
       
   112     void enableMenuAction(int action, bool enable);
       
   113     
   172 private slots:
   114 private slots:
   173 
   115 
   174     /**
   116     /**
   175      * called from the media object's item specific menu
   117      * called from the media object's item specific menu
   176      */
   118      */
   177     void removeMedia();
   119     void removeMedia();
   178     
   120     
   179     /**
       
   180      * handle text changes in body field
       
   181      */
       
   182     void onTextChanged();
       
   183 
       
   184 private:
   121 private:
   185 
   122 
   186     /**
   123     /**
   187      * Get to find body already contains an image
   124      * Get to find body already contains an image
   188      * @return bool
   125      * @return bool
   191 
   128 
   192     /**
   129     /**
   193      * Set that body now contains an audio
   130      * Set that body now contains an audio
   194      */
   131      */
   195 	void setAudio(bool audio = false);
   132 	void setAudio(bool audio = false);
   196 
       
   197     /**
       
   198      * size of the msg
       
   199      */
       
   200     int messageSize();    
       
   201     
   133     
   202     /**
   134     /**
   203      * Handler for set image function 
   135      * Handler for set image function 
   204      */
   136      */
   205     void handleSetImage();    
   137     void handleSetImage();    
   224     /**
   156     /**
   225      * Info if message body has audio.
   157      * Info if message body has audio.
   226      * true if message body has audio else false.
   158      * true if message body has audio else false.
   227      */
   159      */
   228     bool mHasAudio;
   160     bool mHasAudio;
   229 
       
   230     /**
       
   231      * editor to in put text.
       
   232      */
       
   233     HbTextEdit* mTextEdit;
       
   234 
   161 
   235     /**
   162     /**
   236      * icon item to preview images.
   163      * icon item to preview images.
   237      */
   164      */
   238     MsgUnifiedEditorPixmapWidget* mPixmapItem;
   165     MsgUnifiedEditorPixmapWidget* mPixmapItem;
   274     
   201     
   275     /**
   202     /**
   276      * Size of audio in body
   203      * Size of audio in body
   277      */
   204      */
   278     int mAudioSize;
   205     int mAudioSize;
   279     
       
   280     /**
       
   281      * Size of video in body
       
   282      */
       
   283     int mVideoSize;
       
   284 
   206 
   285     /**
   207     /**
   286      * CUniEditorProcessImageOperation object
   208      * CUniEditorProcessImageOperation object
   287      */
   209      */
   288     CUniEditorProcessImageOperation *mProcessImageOperation;
   210     CUniEditorProcessImageOperation *mProcessImageOperation;
   296      * CMsgImageInfo object
   218      * CMsgImageInfo object
   297      */
   219      */
   298     CMsgImageInfo *mImageInfo;    
   220     CMsgImageInfo *mImageInfo;    
   299     
   221     
   300     /**
   222     /**
   301      * Instance of HbTextItem
       
   302      * Will be deleted automatically by parent.
       
   303      * Own.
       
   304      */
       
   305     HbTextItem *mCharCounter;
       
   306 
       
   307     /**
       
   308      * Instance of HbFrameItem
       
   309      * Will be deleted automatically by parent.
       
   310      * Own.
       
   311      */
       
   312     HbFrameItem* mBackgroundItem;
       
   313     
       
   314     /**
       
   315      * Holds the previous buffer inside msgeditor
       
   316      */
       
   317     QString mPrevBuffer;
       
   318 
       
   319     /**
       
   320      * Holds char type supported
       
   321      */
       
   322     int mCharSupportType;
       
   323 
       
   324     /**
       
   325      * Instance of UniEditorPluginInterface
       
   326      * Will be deleted automatically by parent.
       
   327      * Own.
       
   328      */
       
   329     UniEditorPluginInterface* mPluginInterface;
       
   330 
       
   331     /**
       
   332      * Instance of UniEditorPluginLoader
       
   333      * Will be deleted when UniEditorPluginInterface object is deleted
       
   334      * Not Own.
       
   335      */
       
   336     UniEditorPluginLoader* mPluginLoader;
       
   337 
       
   338     /*
       
   339      * Maintains information if any unicode character has been entered or not
       
   340      */
       
   341     bool mUnicode;
       
   342     
       
   343     /**
       
   344      * Content widget for processing animation.
   223      * Content widget for processing animation.
   345      */
   224      */
   346     HbWidget* mProcessingWidget;
   225     HbWidget* mProcessingWidget;
   347 
   226 
   348     /**
   227     /**
   349      * boolean specifying a draft message
   228      * boolean specifying a draft message
   350      */
   229      */
   351     bool mDraftMessage ;
   230     bool mDraftMessage ;
   352     
   231     
   353     /*
   232 #ifdef UNIEDITOR_UNIT_TEST
   354      * Flag to indicate the state of image resizing process. 
   233     friend class TestMsgUnifiedEditorBody;
   355 	 * true - resize in progress. false - resize is not underway.
   234 #endif
   356      */
   235     
   357     bool mIsImageResizing;
   236    
   358 };
   237 };
   359 
   238 
   360 #endif //MSG_UNIFIED_EDITOR_BODY_H
   239 #endif //MSG_UNIFIED_EDITOR_BODY_H