homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp
branchRCL_3
changeset 82 5f0182e07bfb
equal deleted inserted replaced
79:f00a6757af32 82:5f0182e07bfb
       
     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: Menu view.
       
    15  *
       
    16  */
       
    17 
       
    18 #include <HbMainWindow>
       
    19 #include <HbView>
       
    20 #include <HbInstance>
       
    21 #include "hsmainwindow.h"
       
    22 #include "hsmenuview.h"
       
    23 
       
    24 
       
    25 /*!
       
    26  Constructor
       
    27  */
       
    28 
       
    29 
       
    30 
       
    31 /*
       
    32  * A word about HsMainWindow class.
       
    33  * This is not an utility class. It was designed to isolate HbMainWindow connected code, so
       
    34  * it can be substitued in MT for application library. Unfortunately it seems to be the best
       
    35  * way to cope with HbMainWindow problem in MT.  
       
    36  */
       
    37 
       
    38 
       
    39 HsMainWindow::HsMainWindow() 
       
    40 {
       
    41 }
       
    42 
       
    43 /*!
       
    44  Destructor
       
    45  */
       
    46 HsMainWindow::~HsMainWindow()
       
    47 {
       
    48 }
       
    49 
       
    50 /*!
       
    51  Add the \menuView to first instance of HbMainWindow registered in HbInstance.
       
    52  \param view View to be added to HbMainWindow.
       
    53 */
       
    54 void HsMainWindow::setCurrentView(HbView *view)
       
    55 {
       
    56     HbMainWindow *const hbW(
       
    57         HbInstance::instance()->allMainWindows().value(0));
       
    58     
       
    59     if (!hbW->views().contains(view)) {
       
    60         hbW->addView(view);
       
    61     }
       
    62     bool animate  = !hbW->isObscured();       
       
    63     hbW->setCurrentView(view, animate);
       
    64 }