filemanager/tsrc/unit/ut_fmoprationserviceapi/src/testviewmanager.cpp
changeset 47 12b82dc0e8db
equal deleted inserted replaced
40:4167eb56f30d 47:12b82dc0e8db
       
     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:
       
    15 *     The source file of filemanager view manager
       
    16 *
       
    17 */
       
    18 
       
    19 #include "testviewmanager.h"
       
    20 #include "fmoperationservice.h"
       
    21 #include "fmoperationbase.h"
       
    22 
       
    23 #include <hbview.h>
       
    24 #include <hbmainwindow.h>
       
    25 #include <hbapplication.h>
       
    26 #include <hbactivitymanager.h>
       
    27 
       
    28 #include <QFileInfo>
       
    29 
       
    30 TestViewManager *TestViewManager::mTestViewManager = 0;
       
    31 
       
    32 TestViewManager::TestViewManager( HbMainWindow* mainWindow ) : mOperationService( 0 )
       
    33 {
       
    34     mMainWindow = mainWindow;
       
    35 }
       
    36 
       
    37 TestViewManager::~TestViewManager(void)
       
    38 {
       
    39     delete mOperationService;
       
    40     delete mMainWindow;
       
    41 }
       
    42 
       
    43 TestViewManager *TestViewManager::CreateTestViewManager( HbMainWindow* mainWindow )
       
    44 {
       
    45     if( !mTestViewManager ){
       
    46     mTestViewManager = new TestViewManager( mainWindow );
       
    47     }
       
    48 
       
    49     return mTestViewManager;
       
    50 }
       
    51 
       
    52 TestViewManager *TestViewManager::viewManager()
       
    53 {
       
    54     return mTestViewManager;
       
    55 }
       
    56 
       
    57 FmOperationService *TestViewManager::operationService()
       
    58 {
       
    59     if ( !mOperationService ) {
       
    60         mOperationService = new FmOperationService( this );
       
    61         mOperationService->setObjectName( "operationServicefortest" );
       
    62     }    
       
    63     return mOperationService;
       
    64 }
       
    65 
       
    66 void TestViewManager::RemoveViewManager()
       
    67 {
       
    68     delete mTestViewManager;
       
    69     mTestViewManager = 0;
       
    70 }
       
    71