src/hbplugins/devicedialogs/deviceprogressdialogplugin/hbdeviceprogressdialogwidget_p.h
changeset 0 16d8024aca5e
child 2 06ff229162e9
equal deleted inserted replaced
-1:000000000000 0:16d8024aca5e
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (developer.feedback@nokia.com)
       
     6 **
       
     7 ** This file is part of the HbPlugins module of the UI Extensions for Mobile.
       
     8 **
       
     9 ** GNU Lesser General Public License Usage
       
    10 ** This file may be used under the terms of the GNU Lesser General Public
       
    11 ** License version 2.1 as published by the Free Software Foundation and
       
    12 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
       
    13 ** Please review the following information to ensure the GNU Lesser General
       
    14 ** Public License version 2.1 requirements will be met:
       
    15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    16 **
       
    17 ** In addition, as a special exception, Nokia gives you certain additional
       
    18 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    20 **
       
    21 ** If you have questions regarding the use of this file, please contact
       
    22 ** Nokia at developer.feedback@nokia.com.
       
    23 **
       
    24 ****************************************************************************/
       
    25 
       
    26 #ifndef HBDEVICEPROGRESSDIALOGWIDGET_P_H
       
    27 #define HBDEVICEPROGRESSDIALOGWIDGET_P_H
       
    28 
       
    29 #include <QObject>
       
    30 #include <QVariantMap>
       
    31 
       
    32 #include <hbdevicedialoginterface.h>
       
    33 #include <hbdevicedialog.h>
       
    34 #include <hbprogressdialog.h>
       
    35 
       
    36 class HbDialog;
       
    37 class HbAction;
       
    38 
       
    39 class HbDeviceProgressDialogWidget : public HbProgressDialog, public HbDeviceDialogInterface
       
    40 {
       
    41     Q_OBJECT
       
    42     Q_PROPERTY(QString iconName READ iconName WRITE setIconName)
       
    43     Q_PROPERTY(QString primaryActionText READ primaryActionText WRITE setPrimaryActionText)
       
    44     Q_PROPERTY(bool primaryActionNull READ primaryActionNull WRITE setPrimaryActionNull)
       
    45     Q_PROPERTY(QString animationDefinition READ animationDefinition WRITE setAnimationDefinition)
       
    46 
       
    47 public:
       
    48     HbDeviceProgressDialogWidget(HbProgressDialog::ProgressDialogType progressDialogType, const QVariantMap &parameters);
       
    49     ~HbDeviceProgressDialogWidget();
       
    50 
       
    51     bool setDeviceDialogParameters(const QVariantMap &parameters);
       
    52     int deviceDialogError() const;
       
    53     void closeDeviceDialog(bool byClient);
       
    54     HbDialog *deviceDialogWidget() const;
       
    55     static bool getDialogType(HbProgressDialog::ProgressDialogType &dialogType, QVariantMap &parameters);
       
    56 
       
    57 public slots:
       
    58     void primaryActionTriggered();
       
    59 
       
    60 private:
       
    61     bool constructDialog(const QVariantMap &parameters);
       
    62     bool checkProperties(const QVariantMap& parameters);
       
    63     void setProperties(const QVariantMap& parameters);
       
    64     void resetProperties();
       
    65     QString iconName() const;
       
    66     void setIconName(QString &iconName);
       
    67     QString primaryActionText() const;
       
    68     void setPrimaryActionText(QString &actionText);
       
    69     bool primaryActionNull() const;
       
    70     void setPrimaryActionNull(bool isNull);
       
    71     void hideEvent(QHideEvent *event);
       
    72     void showEvent(QShowEvent *event);
       
    73     void setAnimationDefinition(QString &animationDefinition);
       
    74     QString animationDefinition() const;
       
    75 
       
    76 signals:
       
    77     void deviceDialogClosed();
       
    78     void deviceDialogData(QVariantMap data);
       
    79 
       
    80 private:
       
    81     Q_DISABLE_COPY(HbDeviceProgressDialogWidget)
       
    82 
       
    83     int mLastError;
       
    84     QString mIconName;
       
    85     HbAction *mPrimaryAction;
       
    86     HbProgressDialog::ProgressDialogType mProgressDialogType;
       
    87     bool mShowEventReceived;
       
    88     QString mAnimationDefinition;
       
    89 };
       
    90 
       
    91 #endif // HBDEVICEPROGRESSDIALOGWIDGET_P_H