emailuis/nmailui/inc/nmeditorview.h
changeset 54 997a02608b3a
parent 53 bf7eb7911fc5
child 59 16ed8d08d0b1
equal deleted inserted replaced
53:bf7eb7911fc5 54:997a02608b3a
    23 #include "nmbaseview.h"
    23 #include "nmbaseview.h"
    24 #include "nmactionobserver.h"
    24 #include "nmactionobserver.h"
    25 #include "nmactionresponse.h"
    25 #include "nmactionresponse.h"
    26 #include "nmattachmentfetchobserver.h"
    26 #include "nmattachmentfetchobserver.h"
    27 
    27 
    28 class QGraphicsLinearLayout;
       
    29 class HbTextEdit;
    28 class HbTextEdit;
    30 class HbDocumentLoader;
    29 class HbDocumentLoader;
    31 class HbProgressDialog;
    30 class HbProgressDialog;
    32 class HbWidget;
    31 class HbWidget;
    33 class NmBaseViewScrollArea;
    32 class NmBaseViewScrollArea;
    43 class NmMessageCreationOperation;
    42 class NmMessageCreationOperation;
    44 class NmAddAttachmentsOperation;
    43 class NmAddAttachmentsOperation;
    45 class NmAttachmentPicker;
    44 class NmAttachmentPicker;
    46 class HbMessageBox;
    45 class HbMessageBox;
    47 class NmAttachmentManager;
    46 class NmAttachmentManager;
    48 
    47 class HbVkbHost;
    49 
    48 
    50 class NmEditorView : public NmBaseView,
    49 class NmEditorView : public NmBaseView,
    51                      public NmActionObserver,
    50                      public NmActionObserver,
    52                      public NmAttachmentFetchObserver
    51                      public NmAttachmentFetchObserver
    53 {
    52 {
    54     Q_OBJECT
    53     Q_OBJECT
    55 
    54 
    56 public:
    55 public:
    57 
       
    58     NmEditorView(NmApplication &application,
    56     NmEditorView(NmApplication &application,
    59                  NmUiStartParam* startParam,
    57                  NmUiStartParam *startParam,
    60                  NmUiEngine &uiEngine,
    58                  NmUiEngine &uiEngine,
    61                  NmAttachmentManager &attaManager,
    59                  NmAttachmentManager &attaManager,
    62                  QGraphicsItem *parent = 0);
    60                  QGraphicsItem *parent = 0);
    63     ~NmEditorView();
    61     ~NmEditorView();
    64 
    62 
    65 
    63 
    66 public:
    64 public:
    67 
       
    68     void reloadViewContents(NmUiStartParam* startParam);
    65     void reloadViewContents(NmUiStartParam* startParam);
    69     NmUiViewId nmailViewId() const;
    66     NmUiViewId nmailViewId() const;
    70     HbWidget* scrollAreaContents();
    67     HbWidget* scrollAreaContents();
    71     void okToExitView();
    68     void okToExitView();
    72     void aboutToExitView();
    69     void aboutToExitView();
    73     void viewReady();
    70     void viewReady();
    74 
    71     void handleActionCommand(NmActionResponse &menuResponse);
       
    72     void progressChanged(int value);
       
    73     void fetchCompleted(int result);
       
    74     
    75 public slots:
    75 public slots:
    76 
       
    77     void orientationChanged(Qt::Orientation orientation);
    76     void orientationChanged(Qt::Orientation orientation);
    78     void createOptionsMenu();
    77     void createOptionsMenu();
    79     void setButtonsDimming(bool enabled);
    78     void setButtonsDimming(bool enabled);
    80     void attachmentLongPressed(NmId attachmentPartId, QPointF point);
    79     void attachmentLongPressed(NmId attachmentPartId, QPointF point);
    81     void invalidAddressQuery(HbAction* action);
    80     void invalidAddressQuery(HbAction* action);
    82     void okToExitQuery(HbAction* action);
    81     void okToExitQuery(HbAction* action);
    83 
    82     void sendProgressDialogCancelled();
    84 public: // From NmActionObserver
    83     
    85 
    84 protected:
    86     void handleActionCommand(NmActionResponse &menuResponse);
    85     void resizeEvent(QGraphicsSceneResizeEvent *event);
    87 
       
    88 public: // From NmAttachmentFetchObserver
       
    89     void progressChanged(int value);
       
    90     void fetchCompleted(int result);
       
    91 
    86 
    92 private slots:
    87 private slots:
    93 
       
    94     void messageCreated(int result);
    88     void messageCreated(int result);
    95     void adjustViewDimensions();
       
    96     void oneAttachmentAdded(const QString &fileName,
    89     void oneAttachmentAdded(const QString &fileName,
    97                             const NmId &msgPartId,
    90                             const NmId &msgPartId,
    98                             int result);
    91                             int result);
    99 
       
   100     void allAttachmentsAdded(int result);
    92     void allAttachmentsAdded(int result);
   101     void attachmentRemoved(int result);
    93     void attachmentRemoved(int result);
   102     void removeAttachmentTriggered();
    94     void removeAttachmentTriggered();
   103     void handleSendOperationCompleted();
    95     void handleSendOperationCompleted();
   104     void openAttachmentTriggered( NmId attachmentId );  
    96     void openAttachmentTriggered( NmId attachmentId );  
   105     void onAttachmentReqCompleted(const QVariant &value);
    97     void onAttachmentReqCompleted(const QVariant &value);
   106     void onAttachmentsFetchError(int errorCode, const QString& errorMessage);
    98     void onAttachmentsFetchError(int errorCode, const QString& errorMessage);
   107     void switchCcBccFieldVisibility();
    99     void switchCcBccFieldVisibility();
   108 	void fetchProgressDialogCancelled();
   100 	void fetchProgressDialogCancelled();
       
   101 	void vkbOpened();
       
   102 	void vkbClosed();
   109 
   103 
   110 private:
   104 private:
   111 
       
   112     void loadViewLayout();
   105     void loadViewLayout();
   113     void setMailboxName();
   106     void setMailboxName();
   114     void fetchProgressDialogShow();
   107     void fetchProgressDialogShow();
   115     void fetchMessageIfNeeded(NmUiStartParam &startParam);
   108     void fetchMessageIfNeeded(NmUiStartParam &startParam);
   116     void startMessageCreation(NmUiStartParam &startParam);
   109     void startMessageCreation(NmUiStartParam &startParam);
   124     void addAttachments(const QStringList &fileNames);
   117     void addAttachments(const QStringList &fileNames);
   125     void setPriority(NmActionResponseCommand priority);
   118     void setPriority(NmActionResponseCommand priority);
   126     QString addressListToString(const QList<NmAddress*> &list) const;
   119     QString addressListToString(const QList<NmAddress*> &list) const;
   127     QString addressListToString(const QList<NmAddress> &list) const;
   120     QString addressListToString(const QList<NmAddress> &list) const;
   128     void enableToolBarAttach(bool enable);
   121     void enableToolBarAttach(bool enable);
       
   122     void showChrome(bool show);
   129 
   123 
   130 public slots:
   124 signals:
   131 
   125     void sizeChanged();
   132     void sendProgressDialogCancelled();
   126     
   133 
       
   134 private: // Data
   127 private: // Data
   135 
       
   136     NmApplication &mApplication;
   128     NmApplication &mApplication;
   137     NmUiEngine &mUiEngine;
   129     NmUiEngine &mUiEngine;
   138     NmAttachmentManager  &mAttaManager;
   130     NmAttachmentManager  &mAttaManager;
   139     HbDocumentLoader *mDocumentLoader;  // Owned
   131     HbDocumentLoader *mDocumentLoader;  // Owned
   140     QObjectList mWidgetList;            // Owned
   132     QObjectList mWidgetList;            // Owned
   141     NmBaseViewScrollArea *mScrollArea;  // Not owned
       
   142     HbWidget *mScrollAreaContents;      // Not owned
       
   143     NmEditorTextEdit *mEditWidget;      // Not owned
       
   144     NmEditorHeader *mHeaderWidget;      // Not owned
   133     NmEditorHeader *mHeaderWidget;      // Not owned
   145     NmMessage *mMessage;                // Owned
   134     NmMessage *mMessage;                // Owned
   146     QGraphicsLinearLayout *mLayout;
   135     NmEditorContent *mContent;          // Not owned
   147     NmEditorContent *mContentWidget;    // Owned
       
   148     HbMenu *mPrioritySubMenu;           // Owned
   136     HbMenu *mPrioritySubMenu;           // Owned
   149     HbMenu *mAttachmentListContextMenu; // Owned
   137     HbMenu *mAttachmentListContextMenu; // Owned
   150     NmId mSelectedAttachment;
   138     NmId mSelectedAttachment;
   151 
   139     HbVkbHost *mVkbHost;                // Not owned
   152     QPointer<NmMessageCreationOperation> mMessageCreationOperation;  // Not owned
   140     QPointer<NmMessageCreationOperation> mMessageCreationOperation;  // Not owned
   153     QPointer<NmAddAttachmentsOperation> mAddAttachmentOperation;     // Not owned 
   141     QPointer<NmAddAttachmentsOperation> mAddAttachmentOperation;     // Not owned 
   154     QPointer<NmOperation> mRemoveAttachmentOperation;                // Not owned 
   142     QPointer<NmOperation> mRemoveAttachmentOperation;                // Not owned 
   155 
       
   156     HbProgressDialog *mWaitDialog;         // Owned.    
   143     HbProgressDialog *mWaitDialog;         // Owned.    
   157     HbMessageBox* mQueryDialog;            // Owned
   144     HbMessageBox* mQueryDialog;            // Owned
   158     NmAttachmentPicker* mAttachmentPicker; // Owned    
   145     NmAttachmentPicker* mAttachmentPicker; // Owned    
   159     bool mCcBccFieldVisible;
   146     bool mCcBccFieldVisible;
   160     QPointer<HbProgressDialog> mServiceSendingDialog; // Owned.
   147     QPointer<HbProgressDialog> mServiceSendingDialog; // Owned.