emailuis/nmailui/inc/nmviewerview.h
changeset 44 c2d07d913565
parent 43 99bcbff212ad
child 47 f83bd4ae1fe3
child 54 997a02608b3a
equal deleted inserted replaced
43:99bcbff212ad 44:c2d07d913565
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description:
    14  * Description:
    15 *
    15  *
    16 */
    16  */
    17 
    17 
    18 #ifndef NMVIEWERVIEW_H_
    18 #ifndef NMVIEWERVIEW_H_
    19 #define NMVIEWERVIEW_H_
    19 #define NMVIEWERVIEW_H_
    20 
    20 
    21 #include <QPointer>
    21 #include <QPointer>
    27 class QGraphicsLinearLayout;
    27 class QGraphicsLinearLayout;
    28 class QWebPage;
    28 class QWebPage;
    29 
    29 
    30 class HbWidget;
    30 class HbWidget;
    31 class HbMainWindow;
    31 class HbMainWindow;
       
    32 class HbScrollArea;
    32 
    33 
    33 class NmApplication;
    34 class NmApplication;
    34 class NmUiEngine;
    35 class NmUiEngine;
    35 class NmUiStartParam;
    36 class NmUiStartParam;
    36 class NmMailViewerWK;
    37 class NmMailViewerWK;
    37 class NmMessage;
    38 class NmMessage;
    38 class NmBaseViewScrollArea;
       
    39 class NmViewerViewNetManager;
    39 class NmViewerViewNetManager;
    40 class NmViewerHeader;
    40 class NmViewerHeader;
    41 class NmMailViewerWK;
    41 class NmMailViewerWK;
    42 class NmUiDocumentLoader;
    42 class NmUiDocumentLoader;
    43 class NmOperation;
    43 class NmOperation;
    44 class HbProgressDialog;
    44 class HbProgressDialog;
    45 class NmAttachmentListWidget;
    45 class NmAttachmentListWidget;
    46 class NmAttachmentManager;
    46 class NmAttachmentManager;
       
    47 class HbMessageBox;
    47 
    48 
    48 class NmViewerView : public NmBaseView, public NmActionObserver, public NmAttachmentFetchObserver
    49 class NmViewerView : public NmBaseView, public NmActionObserver, public NmAttachmentFetchObserver
    49 {
    50 {
    50     Q_OBJECT
    51     Q_OBJECT
    51 public:
    52 public:
    71 public slots:
    72 public slots:
    72     void orientationChanged(Qt::Orientation orientation);
    73     void orientationChanged(Qt::Orientation orientation);
    73     void adjustViewDimensions();
    74     void adjustViewDimensions();
    74     void linkClicked(const QUrl& link);
    75     void linkClicked(const QUrl& link);
    75     void contentScrollPositionChanged(const QPointF &newPosition);
    76     void contentScrollPositionChanged(const QPointF &newPosition);
    76     void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event);
       
    77     void handleMousePressEvent(QGraphicsSceneMouseEvent *event);
       
    78     void fetchMessage();
    77     void fetchMessage();
    79     void openAttachment(int index);
    78     void openAttachment(int index);
    80 	void createOptionsMenu();
    79 	void createOptionsMenu();
    81 
    80 
    82 private slots:
    81 private slots:
   106     void createToolBar();
   105     void createToolBar();
   107     void setAttachmentList();
   106     void setAttachmentList();
   108     void createAndShowWaitDialog();
   107     void createAndShowWaitDialog();
   109     void setWebViewWidth(int width);
   108     void setWebViewWidth(int width);
   110     void setWebViewHeighth(int height);
   109     void setWebViewHeighth(int height);
   111     void handleMouseEvent(QGraphicsSceneMouseEvent *event, bool pressed);
       
   112 
   110 
   113 private:
   111 private:
   114     NmApplication &mApplication;
   112     NmApplication &mApplication;
   115     NmUiEngine &mUiEngine;
   113     NmUiEngine &mUiEngine;
   116     HbMainWindow *mMainWindow;               // Not owned
   114     HbMainWindow *mMainWindow;                       // Not owned
   117     NmAttachmentManager  &mAttaManager;
   115     NmAttachmentManager  &mAttaManager;
   118     bool mToolbarEnabled;					 // is toolbar or options menu in use
   116     bool mToolbarEnabled;					         // is toolbar or options menu in use
   119     NmMessage* mMessage;                     // Owned
   117     NmMessage* mMessage;                             // Owned
   120     NmBaseViewScrollArea *mScrollArea;       // Not owned
   118     HbScrollArea *mScrollArea;                       // Not owned
   121     HbWidget *mViewerContent;                // Not owned
   119     HbWidget *mViewerContent;                        // Not owned
   122     NmMailViewerWK *mWebView;                // Not owned
   120     NmMailViewerWK *mWebView;                        // Not owned
   123     NmViewerHeader *mHeaderWidget;           // Not owned
   121     NmViewerHeader *mHeaderWidget;                   // Not owned
   124     NmAttachmentListWidget *mAttaListWidget;  // Not owned
   122     NmAttachmentListWidget *mAttaListWidget;         // Not owned
   125     QPointF mHeaderStartScenePos;
   123     QPointF mHeaderStartScenePos;
   126     QGraphicsLinearLayout *mViewerContentLayout; // Not owned
   124     QPointer<NmOperation> mMessageFetchingOperation; // Not owned 
   127     QPointer<NmOperation> mMessageFetchingOperation;   // Not owned 
       
   128     QPointF mLatestScrollPos;
   125     QPointF mLatestScrollPos;
   129     bool mDisplayingPlainText;
   126     bool mDisplayingPlainText;
   130     QObjectList mWidgetList;
   127     QObjectList mWidgetList;
   131     NmUiDocumentLoader *mDocumentLoader;
   128     NmUiDocumentLoader *mDocumentLoader;
   132     HbWidget *mScrollAreaContents;
   129     HbWidget *mScrollAreaContents;
   133     HbWidget *mViewerHeaderContainer;
   130     HbWidget *mViewerHeaderContainer;
   134     QSize mScreenSize;
   131     QSize mScreenSize;
   135     HbProgressDialog *mWaitDialog;            // owned
   132     HbProgressDialog *mWaitDialog;                   // Owned
   136     bool webFrameloadingCompleted;
   133     bool webFrameloadingCompleted;
   137     QSize mLatestLoadingSize;
   134     QSize mLatestLoadingSize;
   138     QList<NmId> mAttaIdList;
   135     QList<NmId> mAttaIdList;
   139     int mAttaIndexUnderFetch;
   136     int mAttaIndexUnderFetch;
   140     NmAttachmentListWidget *mAttaWidget;      // Not owned
   137     NmAttachmentListWidget *mAttaWidget;             // Not owned
   141     bool mViewReady;
   138     bool mViewReady;
   142     bool mWaitNoteCancelled;
   139     bool mWaitNoteCancelled;
       
   140     HbMessageBox *mErrorNote;                       // Owned
   143 };
   141 };
   144 
   142 
   145 #endif /* NMVIEWERVIEW_H_ */
   143 #endif /* NMVIEWERVIEW_H_ */