videoplayerapp/videoplayerengine/tsrc/testvideoplayerengine/stub/src/hbinstance.cpp
changeset 62 0e1e938beb1a
parent 52 e3cecb93e76a
equal deleted inserted replaced
59:a76e86df7ccd 62:0e1e938beb1a
    13 *
    13 *
    14 * Description:  Stub-implementation of HbInstance
    14 * Description:  Stub-implementation of HbInstance
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version:  da1mmcf#7 %
    18 // Version : %version:  da1mmcf#8 %
    19 
    19 
    20 #include <hbmainwindow.h>
       
    21 
    20 
    22 #include "stub/inc/hbinstance.h"
    21 #include "stub/inc/hbinstance.h"
    23 #include "mpxvideo_debug.h"
    22 #include "mpxvideo_debug.h"
    24 
    23 
    25 bool initialised = false;
    24 bool initialised = false;
    26 HbInstance* mInstance = 0;
    25 HbInstance* mInstance = 0;
    27 QList<HbInstance *> mInstances;
    26 QList<HbMainWindow *> mWindows;
    28 
    27 
    29 // -------------------------------------------------------------------------------------------------
    28 // -------------------------------------------------------------------------------------------------
    30 // HbInstance::HbInstance()
    29 // HbInstance::HbInstance()
    31 // -------------------------------------------------------------------------------------------------
    30 // -------------------------------------------------------------------------------------------------
    32 //
    31 //
    33 HbInstance::HbInstance()
    32 HbInstance::HbInstance()
    34 {
    33 {
    35     MPX_DEBUG(_L("HbInstance::HbInstance()"));
    34     MPX_DEBUG(_L("HbInstance::HbInstance()"));
       
    35     
       
    36     HbMainWindow* window = new HbMainWindow();  
       
    37     mWindows.append(window);        
    36 }
    38 }
    37 
    39 
    38 // -------------------------------------------------------------------------------------------------
    40 // -------------------------------------------------------------------------------------------------
    39 // HbInstance::~HbInstance()
    41 // HbInstance::~HbInstance()
    40 // -------------------------------------------------------------------------------------------------
    42 // -------------------------------------------------------------------------------------------------
    52 {
    54 {
    53     MPX_ENTER_EXIT(_L("TestVideoServices::instance()"));
    55     MPX_ENTER_EXIT(_L("TestVideoServices::instance()"));
    54     
    56     
    55     if ( ! initialised )
    57     if ( ! initialised )
    56     {
    58     {
    57     	mInstance = new HbInstance();  
    59     	mInstance = new HbInstance();
    58     	initialised = true;
       
    59     	mInstances.append(mInstance);
       
    60     }
    60     }
    61 	
    61 	
    62     return mInstance;
    62     return mInstance;
    63 }
    63 }
    64 
    64 
    65 // -------------------------------------------------------------------------------------------------
    65 // -------------------------------------------------------------------------------------------------
    66 // HbInstance::primaryWindow()
       
    67 // -------------------------------------------------------------------------------------------------
       
    68 //
       
    69 HbInstance* HbInstance::primaryWindow() const
       
    70 {
       
    71     MPX_DEBUG(_L("HbInstance::primaryWindow()"));
       
    72 	return mInstance;
       
    73 }
       
    74 
       
    75 // -------------------------------------------------------------------------------------------------
       
    76 // HbInstance::allMainWindows()
    66 // HbInstance::allMainWindows()
    77 // -------------------------------------------------------------------------------------------------
    67 // -------------------------------------------------------------------------------------------------
    78 //
    68 //
    79 QList<HbInstance *> HbInstance::allMainWindows() const
    69 QList<HbMainWindow *> HbInstance::allMainWindows() const
    80 {
    70 {
    81     MPX_DEBUG(_L("HbInstance::allMainWindows()"));
    71     MPX_DEBUG(_L("HbInstance::allMainWindows()"));
    82 	return mInstances;
    72 
       
    73 	return mWindows;
    83 }
    74 }
    84 
    75 
    85 // -------------------------------------------------------------------------------------------------
    76 // -------------------------------------------------------------------------------------------------
    86 // HbInstance::removeView()
    77 // HbInstance::removeView()
    87 // -------------------------------------------------------------------------------------------------
    78 // -------------------------------------------------------------------------------------------------