messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h
changeset 23 238255e8b033
child 25 84d9eb65b26f
equal deleted inserted replaced
5:4697dfb2d7ad 23:238255e8b033
       
     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 QGraphicsLinearLayout;
       
    32 class UniViewerFeeder;
       
    33 class ConvergedMessage;
       
    34 class HbScrollArea;
       
    35 class UniScrollArea;
       
    36 class UniContentsWidget;
       
    37 class MessageDeleteAction;
       
    38 
       
    39 /**
       
    40  * Main view of unified viewer.
       
    41  */
       
    42 class UNI_VIEWER_DLL UnifiedViewer : public MsgBaseView
       
    43 {
       
    44 Q_OBJECT
       
    45 
       
    46 public:
       
    47     /**
       
    48      * Constructor
       
    49      */
       
    50     UnifiedViewer(const qint32 messageId, QGraphicsItem *parent = 0);
       
    51 
       
    52     /**
       
    53      * Destructor
       
    54      */
       
    55     ~UnifiedViewer();
       
    56 
       
    57     /**
       
    58      * Populates the content on the widget
       
    59      */
       
    60     void populateContent(const qint32 messageId, bool update, int msgCount);
       
    61 
       
    62 protected:
       
    63 
       
    64     /**
       
    65      * reimplemented from base class to provide proper geometry for scrolling.
       
    66      * @see HbWidget
       
    67      */
       
    68     void resizeEvent(QGraphicsSceneResizeEvent * event);
       
    69 
       
    70 private:
       
    71 
       
    72     /**
       
    73      * Creates tool bar actions
       
    74      * @see HbView
       
    75      */
       
    76     void createToolBar();
       
    77 
       
    78 public slots:
       
    79 
       
    80     /**
       
    81      * Clears the content on the widget
       
    82      */
       
    83     void clearContent();
       
    84 
       
    85     // Used for internal testing will be removed
       
    86     void handleFwdAction();
       
    87     
       
    88     /**
       
    89      * Handle delete 
       
    90      */     
       
    91     void handleDeleteAction();
       
    92     
       
    93 private slots:
       
    94     /**
       
    95      * This slot is called when sendMessage signal is emitted for a highlighted
       
    96      * phone number, from body widget.
       
    97      */
       
    98     void sendMessage(const QString& phoneNumber);
       
    99 
       
   100 private:
       
   101 
       
   102     /**
       
   103      * Main grid layout
       
   104      * Owned
       
   105      */
       
   106     QGraphicsLinearLayout* mMainLayout;
       
   107 
       
   108     /**
       
   109      * Feeder object
       
   110      * Owned
       
   111      */
       
   112     UniViewerFeeder *mViewFeeder;
       
   113 
       
   114     /**
       
   115      * HbScrollArea object
       
   116      * Owned
       
   117      */
       
   118     UniScrollArea* mScrollArea;
       
   119 
       
   120     /**
       
   121      * UniContentsWidget object
       
   122      * Owned
       
   123      */
       
   124     UniContentsWidget* mContentsWidget;
       
   125 
       
   126     /**
       
   127      * Contact id
       
   128      */
       
   129     qint32 mContactId;
       
   130 
       
   131     /**
       
   132      * Message id
       
   133      */
       
   134     qint32 mMessageId;
       
   135 	
       
   136     /**
       
   137      * Message count
       
   138      */
       
   139     int mMsgCount;
       
   140 };
       
   141 
       
   142 #endif
       
   143 // EOF