messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h
changeset 34 84197e66a4bd
parent 31 ebfee66fde93
child 44 36f374c67aa8
equal deleted inserted replaced
31:ebfee66fde93 34:84197e66a4bd
    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 );
   100 
   106 
   101 public slots:
   107 public slots:
   102     /**
   108     /**
   103      * Called to insert image content in editor.
   109      * Called to insert image content in editor.
   104      * @param medialist list of absolute paths of media.
   110      * @param medialist list of absolute paths of media.
   105      */
   111      * @param draftMessage specifies draft message
   106     void setImage(QString& imagefile);
   112      */
       
   113     void setImage(QString& imagefile, bool draftMessage = false);
   107 
   114 
   108     /**
   115     /**
   109      * Called to insert audio content in editor.
   116      * Called to insert audio content in editor.
   110      * @param medialist list of absolute paths of media.
   117      * @param medialist list of absolute paths of media.
   111      */
   118      */
   125 
   132 
   126     /**
   133     /**
   127      * Emitted when msg-body content changes
   134      * Emitted when msg-body content changes
   128      */
   135      */
   129     void contentChanged();
   136     void contentChanged();
   130 
   137 	
   131 public: // from MUniEditorProcessImageOperationObserver
   138     /**
   132     
   139      * Emitted when image is being processed.
   133     /*
   140      * @param enable, true to enable/ false to disable.
   134      * @see MUniEditorProcessImageOperationObserver
   141      */
   135      */
   142    void enableSendButton(bool enable) const;
   136     void EditorOperationEvent( TUniEditorProcessImageOperationEvent aEvent,
   143 
   137         TFileName aFileName );
   144 
   138 
   145 
   139 protected: // from HbWidget
   146 protected: // from HbWidget
   140     
   147     
   141     /**
   148     /**
   142      * Reimplemented from base class to give proper size.
   149      * Reimplemented from base class to give proper size.
   143      * @see HbWidget
   150      * @see HbWidget
   144      */
   151      */
   145     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
   152     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
   146 
   153 
   147 private slots:
   154 private slots:
   148     /**
       
   149      * called on long press on the media objects
       
   150      */
       
   151     void longPressed(QPointF position);
       
   152 
   155 
   153     /**
   156     /**
   154      * called from the media object's item specific menu
   157      * called from the media object's item specific menu
   155      */
   158      */
   156     void removeMedia();
   159     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     
   160     
   168     /**
   161     /**
   169      * handle text changes in body field
   162      * handle text changes in body field
   170      */
   163      */
   171     void onTextChanged();
   164     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 
   165 
   183 private:
   166 private:
   184 
   167 
   185     /**
   168     /**
   186      * Get to find body already contains an image
   169      * Get to find body already contains an image
   190 
   173 
   191     /**
   174     /**
   192      * Set that body now contains an audio
   175      * Set that body now contains an audio
   193      */
   176      */
   194 	void setAudio(bool audio = false);
   177 	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 
   178 
   202     /**
   179     /**
   203      * size of the msg
   180      * size of the msg
   204      */
   181      */
   205     int messageSize();    
   182     int messageSize();    
   236      * editor to in put text.
   213      * editor to in put text.
   237      */
   214      */
   238     HbTextEdit* mTextEdit;
   215     HbTextEdit* mTextEdit;
   239 
   216 
   240     /**
   217     /**
   241      * frame for editor.
       
   242      */
       
   243     HbFrameItem* mEditorFrame;
       
   244 
       
   245     /**
       
   246      * icon item to preview images.
   218      * icon item to preview images.
   247      */
   219      */
   248     HbIconItem* mIconItem;
   220     MsgUnifiedEditorPixmapWidget* mPixmapItem;
   249 
   221 
   250     /**
   222     /**
   251      * inline audio item
   223      * inline audio item
   252      */
   224      */
   253     HbPushButton* mAudioItem;
   225     MsgUniFiedEditorAudioWidget* mAudioItem;
   254 
   226 
   255 	/**
   227 	/**
   256 	 * Image file contained inside body
   228 	 * Image file contained inside body
   257 	 */
   229 	 */
   258     QString mImageFile;
   230     QString mImageFile;
   269 
   241 
   270 	/**
   242 	/**
   271 	 * Video file contained inside body
   243 	 * Video file contained inside body
   272 	 */
   244 	 */
   273     QString mVideoFile;
   245     QString mVideoFile;
   274 
       
   275     /**
       
   276      * To setup longpress gesture on media objects
       
   277      */
       
   278     //HbGestureSceneFilter* mGestureFilter;
       
   279 	
   246 	
   280     /**
   247     /**
   281      * MMs conformance check utility class
   248      * MMs conformance check utility class
   282      */
   249      */
   283     MmsConformanceCheck* mMmsConformanceCheck;
   250     MmsConformanceCheck* mMmsConformanceCheck;
   357     
   324     
   358     /**
   325     /**
   359      * Content widget for processing animation.
   326      * Content widget for processing animation.
   360      */
   327      */
   361     HbWidget* mProcessingWidget;
   328     HbWidget* mProcessingWidget;
       
   329 
       
   330     /**
       
   331      * boolean specifying a draft message
       
   332      */
       
   333     bool mDraftMessage ;
   362 };
   334 };
   363 
   335 
   364 #endif //UNIFIED_EDITOR_BODY_H
   336 #endif //MSG_UNIFIED_EDITOR_BODY_H