homescreenapp/hsdomainmodel/src/hsgui.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 13:30:16 +0300
changeset 55 03646e8da489
parent 51 4785f57bf3d4
child 60 30f14686fb04
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

/*
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/

#include <HbInstance>
#include <HbView>

#include "hsgui.h"

/*!
    \class HsGui
    \ingroup group_hsutils
    \brief Represents a view in the framework.
    HsGui includes common UI components for Home screen.
*/

/*!
    Returns the idle view. 
*/
HbView *HsGui::idleView()
{
    return mIdleView;    
}

/*!
    Returns the current idle view instance. Callers of this 
    function take ownership of the instance. The current 
    view instance will be reset to null.    
*/
HbView *HsGui::takeIdleView()
{	
    HbView *idleView = mIdleView;
    mIdleView = 0;
    return idleView;
}

/*!
    Sets the idle view instance. The existing instance
    will be deleted.
*/
void HsGui::setIdleView(HbView *idleView)
{
    if (mIdleView != idleView) {
        delete mIdleView;
        mIdleView = idleView;
    }
}

/*!
    Returns the main window.
*/
HbMainWindow *HsGui::mainWindow()
{
    return hbInstance->allMainWindows().first();
}

/*!
    Points to the idle view instance.
*/
QPointer<HbView> HsGui::mIdleView(0);