qthighway/examples/hbserviceclient/src/main.cpp
branchRCL_3
changeset 10 cd2778e5acfe
parent 9 5d007b20cfd0
child 11 19a54be74e5e
equal deleted inserted replaced
9:5d007b20cfd0 10:cd2778e5acfe
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 *
       
     5 * This program is free software: you can redistribute it and/or modify
       
     6 * it under the terms of the GNU Lesser General Public License as published by
       
     7 * the Free Software Foundation, version 2.1 of the License.
       
     8 * 
       
     9 * This program is distributed in the hope that it will be useful,
       
    10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 * GNU Lesser General Public License for more details.
       
    13 *
       
    14 * You should have received a copy of the GNU Lesser General Public License
       
    15 * along with this program.  If not, 
       
    16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
       
    17 *
       
    18 * Description:                                                         
       
    19 *
       
    20 */
       
    21 
       
    22 #include "xqservicelog.h"
       
    23 #include <hbapplication.h>
       
    24 #include "hbserviceclientmainwindow.h"
       
    25 
       
    26 int main(int argc, char **argv)
       
    27 {
       
    28     // qInstallMsgHandler(XQSERVICEMESSAGEHANDLER);
       
    29     XQSERVICE_DEBUG_PRINT("HbServiceClient::main");
       
    30     HbApplication app( argc, argv ); 
       
    31 
       
    32     
       
    33     HbServiceClientMainWindow mainWindow;
       
    34 
       
    35     // Let's figure out why application was started?
       
    36     if(app.activateReason()== Hb::ActivationReasonActivity )
       
    37     {
       
    38         QString id = app.activateId();
       
    39         QVariant data = app.activateData();
       
    40         XQSERVICE_DEBUG_PRINT("HbServiceClient::main Hb::ActivationReasonActivity=%s,data=%s",
       
    41                              qPrintable(id), qPrintable(data.toString()));
       
    42         QVariantHash params = app.activateParams();
       
    43         QHashIterator<QString, QVariant> i(params);
       
    44         while (i.hasNext())
       
    45         {
       
    46             i.next();
       
    47             XQSERVICE_DEBUG_PRINT("HbServiceClient::param key=%s,value=%s",
       
    48                                   qPrintable(i.key()), qPrintable(i.value().toString()));
       
    49         }        
       
    50     }
       
    51     else if (app.activateReason() == Hb::ActivationReasonNormal)
       
    52     {
       
    53         XQSERVICE_DEBUG_PRINT("HbServiceClient::main Hb::ActivationReasonNormal");
       
    54     }
       
    55     else if(app.activateReason() == Hb::ActivationReasonService)
       
    56     {
       
    57         // This applicatiob does not support services
       
    58         XQSERVICE_DEBUG_PRINT("HbServiceClient::main Hb::ActivationReasonService");
       
    59     }
       
    60     else
       
    61     {
       
    62         // This applicatiob does not support services
       
    63         XQSERVICE_DEBUG_PRINT("HbServiceClient::main UNKNOWN reason");
       
    64     }
       
    65         
       
    66     
       
    67     mainWindow.show();
       
    68 
       
    69     return app.exec();     
       
    70 }
       
    71