emailuis/nmailui/inc/nmviewerview.h
changeset 20 ecc8def7944a
parent 18 578830873419
child 23 2dc6caa42ec3
equal deleted inserted replaced
18:578830873419 20:ecc8def7944a
    38 class NmViewerHeader;
    38 class NmViewerHeader;
    39 class NmMailViewerWK;
    39 class NmMailViewerWK;
    40 class NmUiDocumentLoader;
    40 class NmUiDocumentLoader;
    41 class NmOperation;
    41 class NmOperation;
    42 class HbProgressDialog;
    42 class HbProgressDialog;
       
    43 class NmAttachmentListWidget;
    43 
    44 
    44 class NmViewerView : public NmBaseView, public NmActionObserver
    45 class NmViewerView : public NmBaseView, public NmActionObserver
    45 {
    46 {
    46     Q_OBJECT
    47     Q_OBJECT
    47 public:
    48 public:
    48     NmViewerView(
    49     explicit NmViewerView(
    49             NmApplication &application,
    50 				NmApplication &application,
    50             NmUiStartParam* startParam,
    51 				NmUiStartParam* startParam,
    51             NmUiEngine &uiEngine,
    52 				NmUiEngine &uiEngine,
    52             HbMainWindow *mainWindow,
    53 				HbMainWindow *mainWindow,
    53             QGraphicsItem *parent = NULL);
    54 				bool toolbar = false,
       
    55 				QGraphicsItem *parent = NULL);
    54     ~NmViewerView();
    56     ~NmViewerView();
    55     void reloadViewContents(NmUiStartParam* startParam);
    57     void reloadViewContents(NmUiStartParam* startParam);
    56     NmUiViewId nmailViewId() const;
    58     NmUiViewId nmailViewId() const;
    57     NmMailViewerWK* webView();
    59     NmMailViewerWK* webView();
    58 
    60 
    59 public slots:
    61 public slots:
    60     void orientationChanged(Qt::Orientation orientation);
    62     void orientationChanged(Qt::Orientation orientation);
       
    63     void adjustViewDimensions();
    61     void linkClicked(const QUrl& link);
    64     void linkClicked(const QUrl& link);
    62     void contentScrollPositionChanged(const QPointF &newPosition);
    65     void contentScrollPositionChanged(const QPointF &newPosition);
    63     void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event);
    66     void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event);
    64     void handleMousePressEvent(QGraphicsSceneMouseEvent *event);
    67     void handleMousePressEvent(QGraphicsSceneMouseEvent *event);
    65     void fetchMessage();
    68     void fetchMessage();
       
    69     void openAttachment(int index);
       
    70     void changeProgress(int progressValue);
       
    71 	void externalDelete(const NmId &messageId);
       
    72 	void createOptionsMenu();
    66     
    73     
    67 private slots: 
    74 private slots: 
    68     void setMessageData();
    75     void setMessageData();
    69     void messageFetched(int result);
    76     void messageFetched(int result);
    70     void waitNoteCancelled();
    77     void waitNoteCancelled();
    71     void webFrameLoaded(bool loaded);
    78     void webFrameLoaded(bool loaded);
    72     void scaleWebViewWhenLoading(const QSize &size);
    79     void scaleWebViewWhenLoading(const QSize &size);
    73     void scaleWebViewWhenLoaded();
    80     void scaleWebViewWhenLoaded();
       
    81     void attachmentFetchCompleted(int result);
    74     
    82     
    75 public: // From NmActionObserver
    83 public: // From NmActionObserver
    76     void handleActionCommand(NmActionResponse &menuResponse);
    84     void handleActionCommand(NmActionResponse &menuResponse);
       
    85 
       
    86 signals:
       
    87     void progressValueChanged(int index, int value);
    77 
    88 
    78 private:
    89 private:
    79     void loadMessage();
    90     void loadMessage();
    80     void loadViewLayout();
    91     void loadViewLayout();
    81     QString formatMessage();
    92     QString formatMessage();
    82     bool eventOnTopOfHeaderArea(QGraphicsSceneMouseEvent *event);
    93     bool eventOnTopOfHeaderArea(QGraphicsSceneMouseEvent *event);
    83     QString escapeSpecialCharacters(const QString text);
       
    84     void changeMessageReadStatus(bool read);
    94     void changeMessageReadStatus(bool read);
    85     void setMailboxName();
    95     void setMailboxName();
    86     void createToolBar();
    96     void createToolBar();
       
    97     void setAttachmentList();
    87 
    98 
    88 private:
    99 private:
    89     NmApplication &mApplication;
   100     NmApplication &mApplication;
    90     NmUiEngine &mUiEngine;
   101     NmUiEngine &mUiEngine;
    91     HbMainWindow *mMainWindow;               // Not owned
   102     HbMainWindow *mMainWindow;               // Not owned
       
   103     bool mToolbar;							  // is toolbar or options menu in use
    92     NmMessage* mMessage;                     // Owned
   104     NmMessage* mMessage;                     // Owned
    93     NmBaseViewScrollArea *mScrollArea;     // Not owned
   105     NmBaseViewScrollArea *mScrollArea;     // Not owned
    94     HbWidget *mViewerContent;                // Not owned
   106     HbWidget *mViewerContent;                // Not owned
    95     NmMailViewerWK *mWebView;                // Not owned
   107     NmMailViewerWK *mWebView;                // Not owned
    96     NmViewerHeader *mHeaderWidget;           // Not owned
   108     NmViewerHeader *mHeaderWidget;           // Not owned
       
   109     NmAttachmentListWidget *mAttaListWidget;  // Not owned
    97     QPointF mHeaderStartScenePos;
   110     QPointF mHeaderStartScenePos;
    98     QGraphicsLinearLayout *mViewerContentLayout; // Not owned
   111     QGraphicsLinearLayout *mViewerContentLayout; // Not owned
    99     NmOperation *mMessageFetchingOperation;   // Not owned
   112     NmOperation *mMessageFetchingOperation;   // Not owned
   100     QPointF mLatestScrollPos;
   113     QPointF mLatestScrollPos;
   101     bool mDisplayingPlainText;
   114     bool mDisplayingPlainText;
   105     HbWidget *mViewerHeaderContainer;
   118     HbWidget *mViewerHeaderContainer;
   106     QSize mScreenSize;
   119     QSize mScreenSize;
   107     HbProgressDialog *mWaitDialog;            // owned
   120     HbProgressDialog *mWaitDialog;            // owned
   108     bool loadingCompleted;
   121     bool loadingCompleted;
   109     QSize mLatestLoadingSize;
   122     QSize mLatestLoadingSize;
       
   123     QList<NmId> mAttaIdList; 
       
   124     NmOperation *mFetchOperation;             // owned
       
   125     int mAttaIndexUnderFetch;
       
   126     NmAttachmentListWidget *mAttaWidget;      // Not owned
   110 };
   127 };
   111 
   128 
   112 #endif /* NMVIEWERVIEW_H_ */
   129 #endif /* NMVIEWERVIEW_H_ */