videocollection/videocollectionview/inc/videohintwidget.h
branchRCL_3
changeset 56 839377eedc2b
equal deleted inserted replaced
54:315810614048 56:839377eedc2b
       
     1 /*
       
     2 * Copyright (c) 2008 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:   Videolist hint widget
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef VIDEOHINTWIDGET_H
       
    20 #define VIDEOHINTWIDGET_H
       
    21 
       
    22 #include <hbwidget.h>
       
    23 #include <hbicon.h>
       
    24 
       
    25 class HbPushButton;
       
    26 class HbLabel;
       
    27 class VideoCollectionUiLoader;
       
    28 class QGraphicsItem;
       
    29 
       
    30 /**
       
    31  * Widget for displaying no videos text and possible hint and button for user
       
    32  * find where to download new videos.
       
    33  */
       
    34 class VideoHintWidget : public HbWidget
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38 public:
       
    39     
       
    40     enum HintLevel {
       
    41         AllVideos,
       
    42         Collection
       
    43     };
       
    44 
       
    45     /**
       
    46      * Contructor.
       
    47      *
       
    48      * @param parent parent of this widget
       
    49      */
       
    50     VideoHintWidget(VideoCollectionUiLoader *uiLoader, QGraphicsItem *parent = 0);
       
    51 
       
    52     /**
       
    53      * Destructor.
       
    54      *
       
    55      */
       
    56     ~VideoHintWidget();
       
    57     
       
    58     /**
       
    59      * Method creates colleciton wrapper, grid and list views,
       
    60      * layout and activates correct view based on the current orientation
       
    61      *
       
    62      */
       
    63     void initialize();
       
    64     
       
    65     /**
       
    66      * Sets the level where the hint is correctly. Hint displays differently in
       
    67      * for example collection level, than in allVideos level.
       
    68      * 
       
    69      * @param level The current level.
       
    70      */
       
    71     void setLevel(HintLevel level);
       
    72     
       
    73     /**
       
    74      * Adjusts if the button is shown in landscape.
       
    75      */
       
    76     void setButtonShown(bool shown);
       
    77     
       
    78     /**
       
    79      * Method enables and displays this widget.
       
    80      */
       
    81     void activate();
       
    82 
       
    83     /**
       
    84      * Method disables and hides this widget.
       
    85      */
       
    86     void deactivate();
       
    87     
       
    88 private slots:
       
    89     
       
    90     /**
       
    91      * Method activates correct view based on the given orientation.
       
    92      */
       
    93     void orientationChangedSlot(Qt::Orientation orientation);
       
    94     
       
    95 private:
       
    96     
       
    97     /**
       
    98      * Shows/hides the correct UI components for current state.
       
    99      */
       
   100     void updateUiComponents();
       
   101 
       
   102 private:
       
   103     
       
   104     Q_DISABLE_COPY(VideoHintWidget)
       
   105     
       
   106     /**
       
   107      * Pointer to the XML UI (DocML) loader, not owned
       
   108      */
       
   109     VideoCollectionUiLoader     *mUiLoader;
       
   110 
       
   111     /**
       
   112      * Current hint level.
       
   113      */
       
   114     HintLevel mCurrentLevel;
       
   115     
       
   116     /**
       
   117      * If button is shown in landscape at all.
       
   118      */
       
   119     bool mButtonShown;
       
   120     
       
   121     /**
       
   122      * true if widget has been activated.
       
   123      */
       
   124     bool mActivated;
       
   125     
       
   126     /**
       
   127      * Localized text for the service button. 
       
   128      */
       
   129     QString mHintText;
       
   130 };
       
   131 
       
   132 #endif // VIDEOHINTWIDGET_H