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