satui/satapp/src/satappmainhandler.cpp
changeset 12 ae8abd0db65c
child 15 d7fc66ccd6fb
equal deleted inserted replaced
0:ff3b6d0fd310 12:ae8abd0db65c
       
     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:
       
    15 *
       
    16 *
       
    17 */
       
    18 #include "satappmainhandler.h"
       
    19 #include "satappuiprovider.h"
       
    20 #include "satappeventprovider.h"
       
    21 #include "satappcommandhandler.h"
       
    22 #include "satappcommonconstant.h"
       
    23 #include "tflogger.h"
       
    24 
       
    25 // ======== MEMBER FUNCTIONS ==================================================
       
    26 
       
    27 // ----------------------------------------------------------------------------
       
    28 // SatAppMainHandler::SatAppMainHandler
       
    29 // (Construtor).
       
    30 // ----------------------------------------------------------------------------
       
    31 //
       
    32 SatAppMainHandler::SatAppMainHandler(HbMainWindow &window, 
       
    33     QObject */*parent*/):mEvent(0), mUi(0), mCommand(0)
       
    34 {
       
    35     TFLOGSTRING("SATAPP: SatAppMainHandler::SatAppMainHandler call")
       
    36     
       
    37     mEvent = new SatAppEventProvider(this);
       
    38     mUi = new SatAppUiProvider(window, *mEvent, this);
       
    39     mCommand = new SatAppCommandHandler(*mUi, this);
       
    40     
       
    41     initConnections();
       
    42     TFLOGSTRING("SATAPP: SatAppMainHandler::SatAppMainHandler exit")
       
    43     }
       
    44 
       
    45 // ----------------------------------------------------------------------------
       
    46 // SatAppMainHandler::~SatAppMainHandler
       
    47 // (Destructor).
       
    48 // ----------------------------------------------------------------------------
       
    49 //
       
    50 SatAppMainHandler::~SatAppMainHandler()
       
    51 {
       
    52     TFLOGSTRING("SATAPP: SatAppMainHandler::~SatAppMainHandler call-exit")
       
    53 }
       
    54 
       
    55 
       
    56 void SatAppMainHandler::initConnections()
       
    57 {
       
    58     TFLOGSTRING("SATAPP: SatAppMainHandler::initConnections call")
       
    59     bool ret = false; 
       
    60     // For SetUpMenu
       
    61     ret = connect(mEvent, SIGNAL(setUpMenuEvent(TSatUiResponse &,
       
    62         QString, QStringList, /*const HbIcon& ,*/ bool, bool)),
       
    63         mCommand, SLOT(setUpMenu(TSatUiResponse &,
       
    64         QString, QStringList, /*const HbIcon& ,*/ bool, bool)),
       
    65         Qt::DirectConnection);
       
    66     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \
       
    67         SetUpMenu=%d", ret)
       
    68     
       
    69     // For SelectItem
       
    70     ret = connect(mEvent, SIGNAL(selectItemEvent(TSatUiResponse&,
       
    71         QString, QStringList, /*const HbIcon& ,*/
       
    72         int, unsigned char&, bool, bool)),
       
    73         mCommand, SLOT(selectItem(TSatUiResponse&,
       
    74         QString,QStringList, /*const HbIcon& ,*/
       
    75         int, unsigned char&, bool, bool)),
       
    76         Qt::DirectConnection);
       
    77     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \
       
    78         SelectItem=%d", ret)
       
    79     
       
    80     // for display text
       
    81     ret = connect(mEvent, SIGNAL(displayTextEvent(TSatUiResponse &,
       
    82         QString, QString, /*const HbIcon & ,*/ bool &, bool, int, bool)),
       
    83         mCommand, SLOT(displayText(TSatUiResponse&,
       
    84         QString, QString, /*const HbIcon & ,*/ bool &, bool, int, bool)),
       
    85         Qt::DirectConnection);
       
    86     
       
    87     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \
       
    88         DisplayText=%d", ret)
       
    89     
       
    90     ret = connect(mEvent, SIGNAL(clearScreenEvent()),
       
    91         mUi, SLOT(clearScreen()),
       
    92         Qt::DirectConnection);
       
    93     
       
    94     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \
       
    95         ClearScreen=%d", ret)
       
    96     
       
    97     ret = connect(mEvent, SIGNAL(closeUiEvent()),
       
    98         mUi, SLOT(closeUi()),
       
    99         Qt::DirectConnection);
       
   100     
       
   101     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \
       
   102         CloseUi=%d", ret)
       
   103 
       
   104     // For GetInkey
       
   105     ret = connect(mEvent, SIGNAL(getInkeyEvent(TSatUiResponse &,
       
   106         QString, TSatCharacterSet, QString &,
       
   107         //const QPixmap* aIconBitmapGetInput,
       
   108         bool,unsigned int &)),
       
   109         mCommand, SLOT(getInkey(TSatUiResponse &, QString,
       
   110         TSatCharacterSet, QString &,
       
   111         //const QPixmap* aIconBitmapGetInput,
       
   112         bool, unsigned int &)),
       
   113         Qt::DirectConnection);
       
   114     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \
       
   115         GetInkey=%d", ret)
       
   116 
       
   117     ret = connect(mEvent, SIGNAL(getYesNoEvent(TSatUiResponse &,
       
   118         QString, TSatCharacterSet, unsigned int &, //TSatIconId,
       
   119         bool, unsigned int &, bool)),
       
   120         mCommand, SLOT(getYesNo(TSatUiResponse &, QString,
       
   121         TSatCharacterSet, unsigned int &, //TSatIconId,
       
   122         bool, unsigned int &, bool)),
       
   123         Qt::DirectConnection);
       
   124     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \
       
   125         GetYesNo=%d", ret)
       
   126     
       
   127     // For GetInput
       
   128     ret = connect(mEvent, SIGNAL(getInputEvent(TSatUiResponse &, QString,
       
   129         TSatCharacterSet, QString &, int, int, bool, bool, unsigned int &)),
       
   130         mCommand, SLOT(getInput(TSatUiResponse &, QString, TSatCharacterSet,
       
   131         QString &, int, int, bool, bool, unsigned int &)),
       
   132         Qt::DirectConnection);
       
   133     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: GetInput=%d", ret)
       
   134     
       
   135     // For send confirm
       
   136     ret = connect(mEvent, SIGNAL(confirmSendEvent(TSatUiResponse &, QString,
       
   137         bool &, int)),
       
   138         mCommand, SLOT(confirmSend(TSatUiResponse&, QString, bool &, int)),
       
   139         Qt::DirectConnection);
       
   140     TFLOGSTRING2("SATAPP: SatAppSendSms::initConnections: confirmSend=%d", ret)
       
   141 
       
   142     ret = connect(mEvent, SIGNAL(showSmsWaitNoteEvent(QString,
       
   143             /*const CFbsBitmap* aIconBitmapSendSM,*/ bool)),
       
   144             mCommand, SLOT(showSmsWaitNote(QString,
       
   145             /*const CFbsBitmap* aIconBitmapSendSM,*/bool)),
       
   146             Qt::DirectConnection);
       
   147 
       
   148     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \
       
   149         showSmsWaitNote=%d", ret)
       
   150     //For Send DTMF
       
   151     ret = connect(mEvent, SIGNAL(showDtmfWaitNoteEvent(
       
   152         TSatUiResponse &, QString/*,
       
   153         const CFbsBitmap* aIconBitmapSendDTMF, bool*/)),
       
   154         mCommand, SLOT(showDtmfWaitNote(TSatUiResponse &, QString
       
   155                 /*const CFbsBitmap* aIconBitmapSendDTMF,bool*/)),
       
   156         Qt::DirectConnection);
       
   157     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: showDtmfsWaitNote=%d", ret)
       
   158     //For DTMF cancel
       
   159     ret = connect(mUi, SIGNAL(userCancelDtmfResponse()),
       
   160                 mEvent, SLOT(userCancelDtmfResponse()),
       
   161         Qt::DirectConnection);
       
   162     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: userCancelDtmfResponse=%d", ret)
       
   163     
       
   164     //Stop wait note
       
   165     ret = connect(mEvent, SIGNAL(stopShowWaitNoteEvent()),
       
   166         mCommand, SLOT(stopShowWaitNote()),
       
   167         Qt::DirectConnection);
       
   168     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \
       
   169         stopShowWaitNote=%d", ret)
       
   170     // For SetUpCall
       
   171     ret = connect(mEvent, SIGNAL(showSetUpCallConfirmEvent(
       
   172         QString, QString, bool &)),
       
   173         mCommand, SLOT(confirmSetUpCall(
       
   174         QString, QString, bool &)),
       
   175         Qt::DirectConnection);
       
   176     TFLOGSTRING2("SATAPP: SatAppMainHandler::initConnections: \
       
   177         showSetUpCallConfirm=%d", ret)
       
   178     
       
   179     TFLOGSTRING("SATAPP: SatAppMainHandler::initConnections exit")
       
   180 }
       
   181 
       
   182 //End of file