messagingapp/msgui/unifiedviewer/inc/unicontentswidget.h
changeset 31 ebfee66fde93
child 47 5b14749788d7
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:  This widget is place holder for message headers and body
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef UNI_CONTENTS_WIDGET_H
       
    19 #define UNI_CONTENTS_WIDGET_H
       
    20 
       
    21 #include <hbwidget.h>
       
    22 #include <qobject.h>
       
    23 #include "convergedmessage.h"
       
    24 
       
    25 class QGraphicsLinearLayout;
       
    26 class QGraphicsGridLayout;
       
    27 class UniViewerFeeder;
       
    28 class ConvergedMessage;
       
    29 class UniViewSlideWidget;
       
    30 
       
    31 /**
       
    32  * This widget is place holder for message headers and body
       
    33  */
       
    34 class UniContentsWidget : public HbWidget
       
    35 {
       
    36 Q_OBJECT
       
    37 
       
    38 public:
       
    39     /**
       
    40      * Constructor
       
    41      */
       
    42     UniContentsWidget(UniViewerFeeder* feeder, QGraphicsItem * parent = 0);
       
    43 
       
    44     /**
       
    45      * Destructor
       
    46      */
       
    47     ~UniContentsWidget();
       
    48 
       
    49     /**
       
    50      * Clears the content on the widget
       
    51      */
       
    52     void clearContent();
       
    53 
       
    54     /**
       
    55      * Populates the content on the widget
       
    56      */
       
    57     void populateContent();
       
    58 
       
    59     /**
       
    60      * Remove item from layout
       
    61      */
       
    62     void removeItemFromLayout(UniViewSlideWidget* item);
       
    63 
       
    64 public slots:
       
    65 
       
    66     /*
       
    67      * Creates and populates the next slide
       
    68      */
       
    69     void populateNextSlide();
       
    70 
       
    71 private:
       
    72 
       
    73     /*
       
    74      * Adds item to layout.
       
    75      * @param item item to be added.
       
    76      */
       
    77     void addItemToLayout(UniViewSlideWidget* item);
       
    78     
       
    79     
       
    80 signals:
       
    81         /**
       
    82          * this signal is emitted when sendMessage is emitted. from UniViewerTextItem.
       
    83          */
       
    84     void sendMessage(const QString& phoneNumber,const QString& alias = QString());
       
    85 
       
    86 private:
       
    87 
       
    88     /**
       
    89      * QGraphicsLinearLayout object
       
    90      * Owned
       
    91      */
       
    92     QGraphicsLinearLayout* mMainLayout;
       
    93 
       
    94     /**
       
    95      * UniViewerFeeder object
       
    96      * Owned
       
    97      */
       
    98     UniViewerFeeder* mViewFeeder;
       
    99 
       
   100     /**
       
   101      * Total number of slides
       
   102      */
       
   103     int mTotalSlides;
       
   104 
       
   105     /**
       
   106      * Current slide number
       
   107      */
       
   108     int mCurrentSlide;
       
   109 
       
   110     /**
       
   111      * Slide array.
       
   112      */
       
   113     QList<UniViewSlideWidget*> mSlides;
       
   114 
       
   115     /**
       
   116      * Total slides that can be created
       
   117      */
       
   118     int mSlideWindow;
       
   119 
       
   120     /**
       
   121      * Total slides to be created in the construction
       
   122      */
       
   123     int mInitialLoadCount;
       
   124 
       
   125     /**
       
   126      * Total slides of the current message already loaded
       
   127      */
       
   128     int mTotalSlidesLoaded;
       
   129 
       
   130     /**
       
   131      * Maintains the total slides added to the layout
       
   132      */
       
   133     int mRowCount;
       
   134 
       
   135     /**
       
   136      * Message type of the message being viewed
       
   137      */
       
   138     ConvergedMessage::MessageType mMessageType;
       
   139 };
       
   140 
       
   141 #endif // UNI_CONTENTS_WIDGET_H
       
   142 // EOF