systemsettings/accindicatorplugin/accindicatorsettings/src/main.cpp
branchRCL_3
changeset 20 c2c61fdca848
parent 19 924385140d98
child 21 9af619316cbf
equal deleted inserted replaced
19:924385140d98 20:c2c61fdca848
     1 /*
       
     2  * Copyright (c) 2010 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: Process launched by the accessory indicator plugin to 
       
    15  * show the view and user can change the settings. 
       
    16  *
       
    17  */
       
    18 
       
    19 #include <hbapplication.h>
       
    20 
       
    21 #include "headsetttyview.h"
       
    22 #include "tvoutview.h"
       
    23 
       
    24 int main(int argc, char *argv[])
       
    25     {
       
    26     HbApplication app(argc, argv);
       
    27     int retVal;
       
    28     // Get the params from the process.
       
    29     QStringList args(app.arguments());
       
    30     int accessoryMode = QString(args.at(1)).toInt(); // HeadSet,TTY,TV-OUT
       
    31     int accessoryType = QString(args.at(2)).toULong();// Wired or Wireless
       
    32     
       
    33     HbMainWindow *window = new HbMainWindow();
       
    34     
       
    35     // If accessory mode is Tv-Out load tvout.docml or else load headset.docml
       
    36     QObject *view;
       
    37     if( accessoryMode == EAccModeTVOut )
       
    38         {
       
    39         view = new TvOutView(window,accessoryType);
       
    40         }
       
    41     else
       
    42         {
       
    43         view = new HeadsetTtyView(window,accessoryType);
       
    44         }
       
    45     
       
    46     window->show();
       
    47     retVal = app.exec();
       
    48     delete window;
       
    49     delete view;
       
    50     return retVal;
       
    51     }