mmsharing/livecommsui/lcui/tsrc/mustester/app/lcapplication.cpp
branchRCL_3
changeset 23 bc78a40cd63c
parent 22 73a1feb507fb
child 24 6c57ef9392d2
equal deleted inserted replaced
22:73a1feb507fb 23:bc78a40cd63c
     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 *
       
    16 */
       
    17 //USER
       
    18 #include "lcapplication.h"
       
    19 #include "mustestdirector.h"
       
    20 #include <musmanagercommon.h>
       
    21 
       
    22 //SYSTEM
       
    23 #include <QDebug.h>
       
    24 #include <Qstring>
       
    25 
       
    26 LcHbApplication* LcHbApplication::self = 0;
       
    27 
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // LcHbApplication::LcHbApplication
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 LcHbApplication::LcHbApplication(int &argc, char *argv[], QString useCase) :
       
    34     HbApplication(argc, argv)
       
    35 {    
       
    36 	  qDebug() << "LcHbApplication::LcHbApplication() ->";
       
    37     self = this;
       
    38     iTestDirector =  CMusTestDirector::NewL();
       
    39     setUseCase( useCase );    
       
    40     qDebug() << "LcHbApplication::LcHbApplication() -<";
       
    41 }
       
    42 
       
    43 // -----------------------------------------------------------------------------
       
    44 // LcHbApplication::~LcHbApplication
       
    45 // -----------------------------------------------------------------------------
       
    46 //
       
    47 LcHbApplication::~LcHbApplication()
       
    48 {
       
    49     self = 0;
       
    50 }
       
    51 
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // LcHbApplication::quit
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 void LcHbApplication::quit()
       
    58 {
       
    59     qDebug() << "LcHbApplication::quit()";
       
    60     if (self) {
       
    61         emit self->handleQuit();
       
    62     }
       
    63 }
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // LcHbApplication::quit
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 void LcHbApplication::setUseCase( QString useCase )
       
    70 {
       
    71     qDebug() << "LcHbApplication::setUseCase()";
       
    72     if( useCase == "0") // live
       
    73     {
       
    74     	  qDebug() << "LcHbApplication::LiveUseCase()";
       
    75         iTestDirector->ConfigureLiveSharing();
       
    76     }
       
    77     else if( useCase == "1") // clip
       
    78     {
       
    79         if (self) emit self->handleQuit();
       
    80     }
       
    81     else if( useCase == "2") // stil
       
    82     {
       
    83         if (self) emit self->handleQuit();
       
    84     }
       
    85     else if( useCase == "3") // EMusReceive
       
    86     {
       
    87         qDebug() << "LcHbApplication::ReceiveUseCase()";
       
    88         iTestDirector->ConfigureReceiveSharing();
       
    89     }
       
    90     else if( useCase == "4") // EMusContinue
       
    91     {
       
    92         if (self) emit self->handleQuit();
       
    93     }
       
    94     else if( useCase == "5") // EMusTwoWayVideo
       
    95     {
       
    96         if (self) emit self->handleQuit();
       
    97     }
       
    98     else if( useCase == "6") // EMusReceiveTwoWayVideo
       
    99     {
       
   100         if (self) emit self->handleQuit();
       
   101     }
       
   102     else
       
   103     {
       
   104         if (self) emit self->handleQuit();
       
   105     }
       
   106 }