mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/hbstubs/hbmessagebox.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     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: Orbit stubs for Live Comms UI unit tests
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HBMESSAGEBOX_H
       
    19 #define HBMESSAGEBOX_H
       
    20 
       
    21 #include <hbglobal.h>
       
    22 #include <hbdialog.h>
       
    23 #include <hbicon.h>
       
    24 
       
    25 class HbMessageBoxPrivate;
       
    26 class HbStyleOptionMessageBox;
       
    27 
       
    28 class HB_WIDGETS_EXPORT HbMessageBox : public HbDialog
       
    29 {
       
    30 
       
    31 public:
       
    32     enum MessageBoxType {
       
    33         MessageTypeInformation,
       
    34         MessageTypeQuestion,
       
    35         MessageTypeWarning
       
    36     };
       
    37     explicit HbMessageBox(MessageBoxType type=MessageTypeInformation,QGraphicsItem *parent = 0);
       
    38     explicit HbMessageBox(const QString &text,MessageBoxType type =MessageTypeInformation, QGraphicsItem *parent = 0);
       
    39     virtual ~HbMessageBox();
       
    40 
       
    41     void setText(const QString &text);
       
    42     QString text() const;
       
    43 
       
    44     void setIcon(const HbIcon &icon);
       
    45     HbIcon icon() const;
       
    46 
       
    47     void setIconAlignment(Qt::Alignment align);
       
    48     Qt::Alignment iconAlignment() const;
       
    49 
       
    50     enum { Type = Hb::ItemType_MessageBox };
       
    51     int type() const { return Type; }
       
    52 
       
    53 public:
       
    54     static bool launchQuestionMessageBox(const QString &questionText,
       
    55                                          const QString &primaryButtonText = tr("Yes"),
       
    56                                          const QString &secondaryButtonText = tr("No"),
       
    57                                          QGraphicsWidget *headWidget = 0,
       
    58                                          QGraphicsScene *scene = 0,
       
    59                                          QGraphicsItem *parent = 0 );
       
    60 
       
    61     static void launchInformationMessageBox(const QString &informationText,
       
    62                                             QGraphicsWidget *headWidget = 0,
       
    63                                             QGraphicsScene *scene = 0,
       
    64                                             QGraphicsItem *parent = 0 );
       
    65 
       
    66     static void launchWarningMessageBox(const QString &warningText,
       
    67                                         QGraphicsWidget *headWidget = 0,
       
    68                                         QGraphicsScene *scene = 0,
       
    69                                         QGraphicsItem *parent = 0 );
       
    70 
       
    71 public slots:
       
    72     void updatePrimitives();
       
    73 
       
    74 protected:
       
    75     HbMessageBox(HbMessageBoxPrivate &dd, QGraphicsItem *parent);
       
    76     void initStyleOption(HbStyleOptionMessageBox *option) const;
       
    77     void keyPressEvent(QKeyEvent *event);
       
    78 };
       
    79 
       
    80 #endif // HB_MESSAGEBOX_H
       
    81