messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h
branchGCC_SURGE
changeset 47 5b14749788d7
parent 27 e4592d119491
parent 44 36f374c67aa8
equal deleted inserted replaced
35:a32b19fb291e 47:5b14749788d7
    13  *
    13  *
    14  * Description:message body. to enter text and show media inserted.
    14  * Description:message body. to enter text and show media inserted.
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #ifndef UNIFIED_EDITOR_BODY_H
    18 #ifndef MSG_UNIFIED_EDITOR_BODY_H
    19 #define UNIFIED_EDITOR_BODY_H
    19 #define MSG_UNIFIED_EDITOR_BODY_H
    20 
    20 
    21 #include <msgunifiededitorbasewidget.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;
    25 class HbTextEdit;
    26 class HbTextItem;
    26 class HbTextItem;
    27 class HbFrameItem;
    27 class HbFrameItem;
    28 class HbIconItem;
       
    29 class HbPushButton;
       
    30 //class HbGestureSceneFilter;
       
    31 class CMsgMediaResolver;
    28 class CMsgMediaResolver;
    32 class CMsgImageInfo;
    29 class CMsgImageInfo;
    33 class MmsConformanceCheck;
    30 class MmsConformanceCheck;
    34 class UniEditorPluginInterface;
    31 class UniEditorPluginInterface;
    35 class UniEditorPluginLoader;
    32 class UniEditorPluginLoader;
       
    33 class MsgUnifiedEditorPixmapWidget;
       
    34 class MsgUniFiedEditorAudioWidget;
    36 
    35 
    37 
    36 
    38 class MsgUnifiedEditorBody : public MsgUnifiedEditorBaseWidget,
    37 class MsgUnifiedEditorBody : public MsgUnifiedEditorBaseWidget,
    39                              public MUniEditorProcessImageOperationObserver
    38                              public MUniEditorProcessImageOperationObserver
    40 {
    39 {
    95      /**
    94      /**
    96       * Get to find body already contains an audio
    95       * Get to find body already contains an audio
    97       * @return bool
    96       * @return bool
    98       */
    97       */
    99      bool hasAudio();
    98      bool hasAudio();
       
    99      
       
   100     /**
       
   101      * from MUniEditorProcessImageOperationObserver  
       
   102      * @see MUniEditorProcessImageOperationObserver
       
   103      */
       
   104     void EditorOperationEvent( TUniEditorProcessImageOperationEvent aEvent,
       
   105                                TFileName aFileName );
       
   106     /**
       
   107 	 * Function which tells whether the image resize process is in progress
       
   108 	 */
       
   109     bool isImageResizing()
       
   110         {
       
   111         return mIsImageResizing;
       
   112         }
   100 
   113 
   101 public slots:
   114 public slots:
   102     /**
   115     /**
   103      * Called to insert image content in editor.
   116      * Called to insert image content in editor.
   104      * @param medialist list of absolute paths of media.
   117      * @param medialist list of absolute paths of media.
   105      */
   118      * @param draftMessage specifies draft message
   106     void setImage(QString& imagefile);
   119      */
       
   120     void setImage(QString& imagefile, bool draftMessage = false);
   107 
   121 
   108     /**
   122     /**
   109      * Called to insert audio content in editor.
   123      * Called to insert audio content in editor.
   110      * @param medialist list of absolute paths of media.
   124      * @param medialist list of absolute paths of media.
   111      */
   125      */
   125 
   139 
   126     /**
   140     /**
   127      * Emitted when msg-body content changes
   141      * Emitted when msg-body content changes
   128      */
   142      */
   129     void contentChanged();
   143     void contentChanged();
   130 
   144 	
   131 public: // from MUniEditorProcessImageOperationObserver
   145     /**
   132     
   146      * Emitted when image is being processed.
   133     /*
   147      * @param enable, true to enable/ false to disable.
   134      * @see MUniEditorProcessImageOperationObserver
   148      */
   135      */
   149    void enableSendButton(bool enable) const;
   136     void EditorOperationEvent( TUniEditorProcessImageOperationEvent aEvent,
   150 
   137         TFileName aFileName );
   151 
   138 
   152 
   139 protected: // from HbWidget
   153 protected: // from HbWidget
   140     
   154     
   141     /**
   155     /**
   142      * Reimplemented from base class to give proper size.
   156      * Reimplemented from base class to give proper size.
   143      * @see HbWidget
   157      * @see HbWidget
   144      */
   158      */
   145     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
   159     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
   146 
   160 
   147 private slots:
   161 private slots:
   148     /**
       
   149      * called on long press on the media objects
       
   150      */
       
   151     void longPressed(QPointF position);
       
   152 
   162 
   153     /**
   163     /**
   154      * called from the media object's item specific menu
   164      * called from the media object's item specific menu
   155      */
   165      */
   156     void removeMedia();
   166     void removeMedia();
   157 
       
   158     /**
       
   159      * called from the media object's item specific menu
       
   160      */
       
   161     void openMedia();
       
   162 
       
   163     /**
       
   164      * called from the media object's item specific menu
       
   165      */
       
   166     void viewDetails();
       
   167     
   167     
   168     /**
   168     /**
   169      * handle text changes in body field
   169      * handle text changes in body field
   170      */
   170      */
   171     void onTextChanged();
   171     void onTextChanged();
   172 
       
   173     /**
       
   174      * Service launch complete.
       
   175      */
       
   176     void handleOk(const QVariant& result);
       
   177 
       
   178     /**
       
   179      * Service launch errors.
       
   180      */
       
   181     void handleError(int errorCode, const QString& errorMessage);
       
   182 
   172 
   183 private:
   173 private:
   184 
   174 
   185     /**
   175     /**
   186      * Get to find body already contains an image
   176      * Get to find body already contains an image
   190 
   180 
   191     /**
   181     /**
   192      * Set that body now contains an audio
   182      * Set that body now contains an audio
   193      */
   183      */
   194 	void setAudio(bool audio = false);
   184 	void setAudio(bool audio = false);
   195     
       
   196     /**
       
   197      * Get the region (image/audio/video) where longpress happened
       
   198      * @return region
       
   199      */
       
   200     QString getHitRegion(QPointF position);
       
   201 
   185 
   202     /**
   186     /**
   203      * size of the msg
   187      * size of the msg
   204      */
   188      */
   205     int messageSize();    
   189     int messageSize();    
   236      * editor to in put text.
   220      * editor to in put text.
   237      */
   221      */
   238     HbTextEdit* mTextEdit;
   222     HbTextEdit* mTextEdit;
   239 
   223 
   240     /**
   224     /**
   241      * frame for editor.
       
   242      */
       
   243     HbFrameItem* mEditorFrame;
       
   244 
       
   245     /**
       
   246      * icon item to preview images.
   225      * icon item to preview images.
   247      */
   226      */
   248     HbIconItem* mIconItem;
   227     MsgUnifiedEditorPixmapWidget* mPixmapItem;
   249 
   228 
   250     /**
   229     /**
   251      * inline audio item
   230      * inline audio item
   252      */
   231      */
   253     HbPushButton* mAudioItem;
   232     MsgUniFiedEditorAudioWidget* mAudioItem;
   254 
   233 
   255 	/**
   234 	/**
   256 	 * Image file contained inside body
   235 	 * Image file contained inside body
   257 	 */
   236 	 */
   258     QString mImageFile;
   237     QString mImageFile;
   269 
   248 
   270 	/**
   249 	/**
   271 	 * Video file contained inside body
   250 	 * Video file contained inside body
   272 	 */
   251 	 */
   273     QString mVideoFile;
   252     QString mVideoFile;
   274 
       
   275     /**
       
   276      * To setup longpress gesture on media objects
       
   277      */
       
   278     //HbGestureSceneFilter* mGestureFilter;
       
   279 	
   253 	
   280     /**
   254     /**
   281      * MMs conformance check utility class
   255      * MMs conformance check utility class
   282      */
   256      */
   283     MmsConformanceCheck* mMmsConformanceCheck;
   257     MmsConformanceCheck* mMmsConformanceCheck;
   357     
   331     
   358     /**
   332     /**
   359      * Content widget for processing animation.
   333      * Content widget for processing animation.
   360      */
   334      */
   361     HbWidget* mProcessingWidget;
   335     HbWidget* mProcessingWidget;
       
   336 
       
   337     /**
       
   338      * boolean specifying a draft message
       
   339      */
       
   340     bool mDraftMessage ;
       
   341     
       
   342     /*
       
   343      * Flag to indicate the state of image resizing process. 
       
   344 	 * true - resize in progress. false - resize is not underway.
       
   345      */
       
   346     bool mIsImageResizing;
   362 };
   347 };
   363 
   348 
   364 #endif //UNIFIED_EDITOR_BODY_H
   349 #endif //MSG_UNIFIED_EDITOR_BODY_H