messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h
changeset 31 ebfee66fde93
child 34 84197e66a4bd
equal deleted inserted replaced
30:6a20128ce557 31:ebfee66fde93
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: Main view of unified viewer
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef UNIFIED_VIEWER_H
       
    19 #define UNIFIED_VIEWER_H
       
    20 
       
    21 #ifdef BUILD_UNI_VIEWER_DLL
       
    22 #define UNI_VIEWER_DLL Q_DECL_EXPORT
       
    23 #else
       
    24 #define UNI_VIEWER_DLL Q_DECL_IMPORT
       
    25 #endif
       
    26 
       
    27 #include "msgbaseview.h"
       
    28 
       
    29 #include "convergedmessage.h"
       
    30 
       
    31 class UniViewerFeeder;
       
    32 class ConvergedMessage;
       
    33 class HbScrollArea;
       
    34 class UniScrollArea;
       
    35 class UniContentsWidget;
       
    36 class MessageDeleteAction;
       
    37 class HbAction;
       
    38 /**
       
    39  * Main view of unified viewer.
       
    40  */
       
    41 class UNI_VIEWER_DLL UnifiedViewer : public MsgBaseView
       
    42 {
       
    43 Q_OBJECT
       
    44 
       
    45 public:
       
    46     /**
       
    47      * Constructor
       
    48      */
       
    49     UnifiedViewer(const qint32 messageId, QGraphicsItem *parent = 0);
       
    50 
       
    51     /**
       
    52      * Destructor
       
    53      */
       
    54     ~UnifiedViewer();
       
    55 
       
    56     /**
       
    57      * Populates the content on the widget
       
    58      */
       
    59     void populateContent(const qint32 messageId, bool update, int msgCount);
       
    60 
       
    61 protected:
       
    62 
       
    63     /**
       
    64      * reimplemented from base class to provide proper geometry for scrolling.
       
    65      * @see HbWidget
       
    66      */
       
    67     void resizeEvent(QGraphicsSceneResizeEvent * event);
       
    68 
       
    69 private:
       
    70 
       
    71     /**
       
    72      * Creates tool bar actions
       
    73      * @see HbView
       
    74      */
       
    75     void createToolBar();
       
    76 
       
    77     /**
       
    78      * Validates if message can be forwarded
       
    79      * @return true if message can be forwarded
       
    80      *         false if message cant be forwarded
       
    81      */
       
    82     bool validateMsgForForward();
       
    83 
       
    84 public slots:
       
    85 
       
    86     /**
       
    87      * Clears the content on the widget
       
    88      */
       
    89     void clearContent();
       
    90 
       
    91     // Used for internal testing will be removed
       
    92     void handleFwdAction();
       
    93     
       
    94     /**
       
    95      * Handle delete 
       
    96      */     
       
    97     void handleDeleteAction();
       
    98     
       
    99 private slots:
       
   100     /**
       
   101      * This slot is called when sendMessage signal is emitted for a highlighted
       
   102      * phone number, from body widget.
       
   103      */
       
   104     void sendMessage(const QString& phoneNumber, const QString& alias = QString());
       
   105 
       
   106     /**
       
   107      * This slot is called when delete message dialog is launched.
       
   108      * @param action selected action (yes or no).
       
   109      */
       
   110     void onDialogDeleteMsg(HbAction* action);
       
   111     
       
   112 private:
       
   113 
       
   114     /**
       
   115      * Feeder object
       
   116      * Owned
       
   117      */
       
   118     UniViewerFeeder *mViewFeeder;
       
   119 
       
   120     /**
       
   121      * HbScrollArea object
       
   122      * Owned
       
   123      */
       
   124     UniScrollArea* mScrollArea;
       
   125 
       
   126     /**
       
   127      * UniContentsWidget object
       
   128      * Owned
       
   129      */
       
   130     UniContentsWidget* mContentsWidget;
       
   131 
       
   132     /**
       
   133      * Contact id
       
   134      */
       
   135     qint32 mContactId;
       
   136 
       
   137     /**
       
   138      * Message id
       
   139      */
       
   140     qint32 mMessageId;
       
   141 	
       
   142     /**
       
   143      * Message count
       
   144      */
       
   145     int mMsgCount;
       
   146 };
       
   147 
       
   148 #endif
       
   149 // EOF