videocollection/tsrc/stubs/src/hbmessagebox.cpp
author hgs
Mon, 20 Sep 2010 18:25:37 +0300
changeset 63 4707a0db12f6
parent 44 518105d52e45
permissions -rw-r--r--
201037
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description: stub hbmessagebox
hgs
parents:
diff changeset
    15
* 
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#include <qstring.h>
hgs
parents:
diff changeset
    19
hgs
parents:
diff changeset
    20
#include "hbmessagebox.h"
hgs
parents:
diff changeset
    21
#include "hbmessageboxdata.h"
38
hgs
parents: 34
diff changeset
    22
#include "testobjectstore.h"
34
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
bool HbMessageBoxData::mQuestionReturnValue = false;
hgs
parents:
diff changeset
    25
QString HbMessageBoxData::mLatestTxt = "";
hgs
parents:
diff changeset
    26
int HbMessageBoxData::mWarningCallCount = 0;
hgs
parents:
diff changeset
    27
int HbMessageBoxData::mInformationCallCount = 0;
38
hgs
parents: 34
diff changeset
    28
int HbMessageBoxData::mType = -1;
hgs
parents: 34
diff changeset
    29
int HbMessageBoxData::mAttribute = -1;
hgs
parents: 34
diff changeset
    30
int HbMessageBoxData::mOpenCallCount = 0;
hgs
parents: 34
diff changeset
    31
int HbMessageBoxData::mShowCallCount = 0;
34
hgs
parents:
diff changeset
    32
63
hgs
parents: 44
diff changeset
    33
HbMessageBox::HbMessageBox(MessageBoxType type, QGraphicsItem *parent) :
hgs
parents: 44
diff changeset
    34
 HbDialog(parent)       
38
hgs
parents: 34
diff changeset
    35
{
hgs
parents: 34
diff changeset
    36
    HbMessageBoxData::mType = type;
hgs
parents: 34
diff changeset
    37
hgs
parents: 34
diff changeset
    38
    HbAction *action = new HbAction();
hgs
parents: 34
diff changeset
    39
    mActions.append(action);
hgs
parents: 34
diff changeset
    40
    action = new HbAction();
hgs
parents: 34
diff changeset
    41
    mActions.append(action);
hgs
parents: 34
diff changeset
    42
    
hgs
parents: 34
diff changeset
    43
    TestObjectStore::instance().addObject(this);
hgs
parents: 34
diff changeset
    44
}
hgs
parents: 34
diff changeset
    45
        
hgs
parents: 34
diff changeset
    46
HbMessageBox::HbMessageBox(const QString &text, MessageBoxType type, QGraphicsItem *parent)
34
hgs
parents:
diff changeset
    47
{
hgs
parents:
diff changeset
    48
    Q_UNUSED(parent);
38
hgs
parents: 34
diff changeset
    49
    HbMessageBoxData::mLatestTxt = text;
hgs
parents: 34
diff changeset
    50
    HbMessageBoxData::mType = type;
34
hgs
parents:
diff changeset
    51
    
38
hgs
parents: 34
diff changeset
    52
    HbAction *action = new HbAction();
hgs
parents: 34
diff changeset
    53
    mActions.append(action);
hgs
parents: 34
diff changeset
    54
    action = new HbAction();
hgs
parents: 34
diff changeset
    55
    mActions.append(action);
hgs
parents: 34
diff changeset
    56
    
hgs
parents: 34
diff changeset
    57
    TestObjectStore::instance().addObject(this);
hgs
parents: 34
diff changeset
    58
}
hgs
parents: 34
diff changeset
    59
hgs
parents: 34
diff changeset
    60
HbMessageBox::~HbMessageBox()
hgs
parents: 34
diff changeset
    61
{
hgs
parents: 34
diff changeset
    62
    while(!mActions.isEmpty())
hgs
parents: 34
diff changeset
    63
    {
hgs
parents: 34
diff changeset
    64
        delete mActions.takeFirst();
hgs
parents: 34
diff changeset
    65
    }
hgs
parents: 34
diff changeset
    66
}
hgs
parents: 34
diff changeset
    67
hgs
parents: 34
diff changeset
    68
void HbMessageBox::show()
hgs
parents: 34
diff changeset
    69
{
hgs
parents: 34
diff changeset
    70
    HbMessageBoxData::mShowCallCount++;
hgs
parents: 34
diff changeset
    71
}
hgs
parents: 34
diff changeset
    72
hgs
parents: 34
diff changeset
    73
void HbMessageBox::open( QObject* receiver, const char* member )
hgs
parents: 34
diff changeset
    74
{
hgs
parents: 34
diff changeset
    75
    Q_UNUSED(receiver);
hgs
parents: 34
diff changeset
    76
    Q_UNUSED(member);
hgs
parents: 34
diff changeset
    77
    HbMessageBoxData::mOpenCallCount++;
hgs
parents: 34
diff changeset
    78
}
hgs
parents: 34
diff changeset
    79
hgs
parents: 34
diff changeset
    80
void HbMessageBox::emitDialogFinished( QObject* receiver, const char* member, int actionNum )
hgs
parents: 34
diff changeset
    81
{
44
hgs
parents: 38
diff changeset
    82
    if(connect(this, SIGNAL(finished(int)), receiver, member))
38
hgs
parents: 34
diff changeset
    83
    {
44
hgs
parents: 38
diff changeset
    84
        emit finished(actionNum);
hgs
parents: 38
diff changeset
    85
        disconnect(this, SIGNAL(finished(int)), receiver, member);
38
hgs
parents: 34
diff changeset
    86
    }
34
hgs
parents:
diff changeset
    87
}
hgs
parents:
diff changeset
    88
44
hgs
parents: 38
diff changeset
    89
void HbMessageBox::setStandardButtons(StandardButtons buttons)
hgs
parents: 38
diff changeset
    90
{
hgs
parents: 38
diff changeset
    91
    Q_UNUSED(buttons);
hgs
parents: 38
diff changeset
    92
	//NOP
hgs
parents: 38
diff changeset
    93
}
hgs
parents: 38
diff changeset
    94
34
hgs
parents:
diff changeset
    95
void HbMessageBox::information(const QString &informationText,
hgs
parents:
diff changeset
    96
    QGraphicsWidget *headWidget,
hgs
parents:
diff changeset
    97
    QGraphicsScene *scene,
hgs
parents:
diff changeset
    98
    QGraphicsItem *parent)
hgs
parents:
diff changeset
    99
{
hgs
parents:
diff changeset
   100
    Q_UNUSED(headWidget);
hgs
parents:
diff changeset
   101
    Q_UNUSED(scene);
hgs
parents:
diff changeset
   102
    Q_UNUSED(parent);
hgs
parents:
diff changeset
   103
hgs
parents:
diff changeset
   104
    HbMessageBoxData::mLatestTxt = informationText;
hgs
parents:
diff changeset
   105
    HbMessageBoxData::mInformationCallCount++;
hgs
parents:
diff changeset
   106
}
hgs
parents:
diff changeset
   107
hgs
parents:
diff changeset
   108
void HbMessageBox::warning(const QString &warningText,
hgs
parents:
diff changeset
   109
    QGraphicsWidget *headWidget,
hgs
parents:
diff changeset
   110
    QGraphicsScene *scene,
hgs
parents:
diff changeset
   111
    QGraphicsItem *parent)
hgs
parents:
diff changeset
   112
{
hgs
parents:
diff changeset
   113
    Q_UNUSED(headWidget);
hgs
parents:
diff changeset
   114
    Q_UNUSED(scene);
hgs
parents:
diff changeset
   115
    Q_UNUSED(parent);
hgs
parents:
diff changeset
   116
hgs
parents:
diff changeset
   117
    HbMessageBoxData::mLatestTxt = warningText;
hgs
parents:
diff changeset
   118
    HbMessageBoxData::mWarningCallCount++;
hgs
parents:
diff changeset
   119
}
hgs
parents:
diff changeset
   120
38
hgs
parents: 34
diff changeset
   121
void HbMessageBox::setAttribute(int attribute)
hgs
parents: 34
diff changeset
   122
{
hgs
parents: 34
diff changeset
   123
    HbMessageBoxData::mAttribute = attribute;
hgs
parents: 34
diff changeset
   124
}
hgs
parents: 34
diff changeset
   125
34
hgs
parents:
diff changeset
   126
// end of file