videocollection/tsrc/stubs/src/hbmessagebox.cpp
branchRCL_3
changeset 56 839377eedc2b
equal deleted inserted replaced
54:315810614048 56:839377eedc2b
       
     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: stub hbmessagebox
       
    15 * 
       
    16 */
       
    17 
       
    18 #include <qstring.h>
       
    19 
       
    20 #include "hbmessagebox.h"
       
    21 #include "hbmessageboxdata.h"
       
    22 #include "testobjectstore.h"
       
    23 
       
    24 bool HbMessageBoxData::mQuestionReturnValue = false;
       
    25 QString HbMessageBoxData::mLatestTxt = "";
       
    26 int HbMessageBoxData::mWarningCallCount = 0;
       
    27 int HbMessageBoxData::mInformationCallCount = 0;
       
    28 int HbMessageBoxData::mType = -1;
       
    29 int HbMessageBoxData::mAttribute = -1;
       
    30 int HbMessageBoxData::mOpenCallCount = 0;
       
    31 int HbMessageBoxData::mShowCallCount = 0;
       
    32 
       
    33 HbMessageBox::HbMessageBox(MessageBoxType type, QGraphicsItem *parent)
       
    34 {
       
    35     Q_UNUSED(parent);
       
    36     HbMessageBoxData::mType = type;
       
    37 
       
    38     HbAction *action = new HbAction();
       
    39     mActions.append(action);
       
    40     action = new HbAction();
       
    41     mActions.append(action);
       
    42     
       
    43     TestObjectStore::instance().addObject(this);
       
    44 }
       
    45         
       
    46 HbMessageBox::HbMessageBox(const QString &text, MessageBoxType type, QGraphicsItem *parent)
       
    47 {
       
    48     Q_UNUSED(parent);
       
    49     HbMessageBoxData::mLatestTxt = text;
       
    50     HbMessageBoxData::mType = type;
       
    51     
       
    52     HbAction *action = new HbAction();
       
    53     mActions.append(action);
       
    54     action = new HbAction();
       
    55     mActions.append(action);
       
    56     
       
    57     TestObjectStore::instance().addObject(this);
       
    58 }
       
    59 
       
    60 HbMessageBox::~HbMessageBox()
       
    61 {
       
    62     while(!mActions.isEmpty())
       
    63     {
       
    64         delete mActions.takeFirst();
       
    65     }
       
    66 }
       
    67 
       
    68 void HbMessageBox::show()
       
    69 {
       
    70     HbMessageBoxData::mShowCallCount++;
       
    71 }
       
    72 
       
    73 void HbMessageBox::open( QObject* receiver, const char* member )
       
    74 {
       
    75     Q_UNUSED(receiver);
       
    76     Q_UNUSED(member);
       
    77     HbMessageBoxData::mOpenCallCount++;
       
    78 }
       
    79 
       
    80 void HbMessageBox::emitDialogFinished( QObject* receiver, const char* member, int actionNum )
       
    81 {
       
    82     if(connect(this, SIGNAL(finished(int)), receiver, member))
       
    83     {
       
    84         emit finished(actionNum);
       
    85         disconnect(this, SIGNAL(finished(int)), receiver, member);
       
    86     }
       
    87 }
       
    88 
       
    89 void HbMessageBox::setStandardButtons(StandardButtons buttons)
       
    90 {
       
    91     Q_UNUSED(buttons);
       
    92 	//NOP
       
    93 }
       
    94 
       
    95 void HbMessageBox::information(const QString &informationText,
       
    96     QGraphicsWidget *headWidget,
       
    97     QGraphicsScene *scene,
       
    98     QGraphicsItem *parent)
       
    99 {
       
   100     Q_UNUSED(headWidget);
       
   101     Q_UNUSED(scene);
       
   102     Q_UNUSED(parent);
       
   103 
       
   104     HbMessageBoxData::mLatestTxt = informationText;
       
   105     HbMessageBoxData::mInformationCallCount++;
       
   106 }
       
   107 
       
   108 void HbMessageBox::warning(const QString &warningText,
       
   109     QGraphicsWidget *headWidget,
       
   110     QGraphicsScene *scene,
       
   111     QGraphicsItem *parent)
       
   112 {
       
   113     Q_UNUSED(headWidget);
       
   114     Q_UNUSED(scene);
       
   115     Q_UNUSED(parent);
       
   116 
       
   117     HbMessageBoxData::mLatestTxt = warningText;
       
   118     HbMessageBoxData::mWarningCallCount++;
       
   119 }
       
   120 
       
   121 void HbMessageBox::setAttribute(int attribute)
       
   122 {
       
   123     HbMessageBoxData::mAttribute = attribute;
       
   124 }
       
   125 
       
   126 // end of file