homescreenapp/hsdomainmodel/src/hsgui.cpp
changeset 55 03646e8da489
parent 51 4785f57bf3d4
child 60 30f14686fb04
equal deleted inserted replaced
51:4785f57bf3d4 55:03646e8da489
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <HbInstance>
    18 #include <HbInstance>
    19 #include <HbView>
    19 #include <HbView>
       
    20 
    20 #include "hsgui.h"
    21 #include "hsgui.h"
    21 
    22 
    22 /*!
    23 /*!
    23     \class HsGui
    24     \class HsGui
    24     \ingroup group_hsutils
    25     \ingroup group_hsutils
    25     \brief Represents a view in the framework.
    26     \brief Represents a view in the framework.
    26     HsGui includes common UI components for Home screen.
    27     HsGui includes common UI components for Home screen.
    27 */
    28 */
    28 
    29 
    29 /*!
    30 /*!
    30     Constructor
    31     Returns the idle view. 
    31 */
       
    32 HsGui::HsGui()	
       
    33 {    
       
    34 }
       
    35 
       
    36 /*!
       
    37     Destructor.
       
    38 */
       
    39 HsGui::~HsGui()
       
    40 {
       
    41 }
       
    42 
       
    43 /*!
       
    44     Returns idle view. 
       
    45 */
    32 */
    46 HbView *HsGui::idleView()
    33 HbView *HsGui::idleView()
    47 {
    34 {
    48 	return mIdleView.data();    
    35     return mIdleView;    
    49 }
    36 }
    50 
    37 
    51 /*!
    38 /*!
    52     Returns the current idle view instance. Callers of this 
    39     Returns the current idle view instance. Callers of this 
    53     function take ownership of the instance. The current 
    40     function take ownership of the instance. The current 
    54     view instance will be reset to null.    
    41     view instance will be reset to null.    
    55 */
    42 */
    56 HbView *HsGui::takeIdleView()
    43 HbView *HsGui::takeIdleView()
    57 {	
    44 {	
    58     HbView *view = mIdleView;
    45     HbView *idleView = mIdleView;
    59     mIdleView = 0;
    46     mIdleView = 0;
    60     return view;
    47     return idleView;
    61 }
    48 }
    62 
    49 
    63 /*!
    50 /*!
    64     Sets the idle view instance. The existing instance
    51     Sets the idle view instance. The existing instance
    65     will be deleted.
    52     will be deleted.
    66 */
    53 */
    67 void HsGui::setIdleView(HbView *idleView)
    54 void HsGui::setIdleView(HbView *idleView)
    68 {
    55 {
    69     if (mIdleView != idleView) {
    56     if (mIdleView != idleView) {
    70         HbView *oldView = mIdleView;
    57         delete mIdleView;
    71         mIdleView = idleView;
    58         mIdleView = idleView;
    72         delete oldView;
       
    73     }
    59     }
    74 }
    60 }
    75 
    61 
    76 /*!
    62 /*!
    77     Return main window.
    63     Returns the main window.
    78 */
    64 */
    79 HbMainWindow *HsGui::mainWindow()
    65 HbMainWindow *HsGui::mainWindow()
    80 {
    66 {
    81     return hbInstance->allMainWindows().first();
    67     return hbInstance->allMainWindows().first();
    82 }
    68 }
    83 
    69 
    84 /*!
    70 /*!
    85     Points to the view instance.
    71     Points to the idle view instance.
    86 */
    72 */
    87 QPointer<HbView> HsGui::mIdleView(0);
    73 QPointer<HbView> HsGui::mIdleView(0);