src/hbwidgets/devicedialogs/hbdeviceprogressdialog.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 HbWidgets 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 HBDEVICEPROGRESSDIALOG_H
       
    27 #define HBDEVICEPROGRESSDIALOG_H
       
    28 
       
    29 #include <QObject>
       
    30 #include <hbglobal.h>
       
    31 #include <hbprogressdialog.h>
       
    32 
       
    33 class HbDeviceProgressDialogPrivate;
       
    34 
       
    35 class HB_WIDGETS_EXPORT HbDeviceProgressDialog : public QObject
       
    36 {
       
    37     Q_OBJECT
       
    38 
       
    39     Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
       
    40     Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
       
    41     Q_PROPERTY(int value READ progressValue WRITE setProgressValue)
       
    42     Q_PROPERTY(bool autoClose READ autoClose WRITE setAutoClose)
       
    43     Q_PROPERTY(HbProgressDialog::ProgressDialogType progressType
       
    44         READ progressType WRITE setProgressType)
       
    45     Q_PROPERTY(QString text READ text WRITE setText)
       
    46     Q_PROPERTY(Qt::Alignment textAlignment READ textAlignment WRITE setTextAlignment)
       
    47     Q_PROPERTY(bool textWrapping READ textWrapping WRITE setTextWrapping) // deprecated
       
    48     Q_PROPERTY(QString iconName READ iconName WRITE setIconName)
       
    49     Q_PROPERTY(Qt::Alignment iconAlignment READ iconAlignment WRITE setIconAlignment)
       
    50     Q_PROPERTY(QString animationDefinition READ animationDefinition WRITE setAnimationDefinition)
       
    51 
       
    52 public:
       
    53     enum ActionRole {
       
    54         InvalidRole = -1,
       
    55         CancelButtonRole
       
    56     };
       
    57 
       
    58     explicit HbDeviceProgressDialog(HbProgressDialog::ProgressDialogType type, QObject *parent = 0);
       
    59     explicit HbDeviceProgressDialog(QObject *parent = 0);
       
    60     virtual ~HbDeviceProgressDialog();
       
    61 
       
    62     void show();
       
    63     void update();
       
    64     void cancel(); // deprecated
       
    65     void close();
       
    66     const QAction *triggeredAction() const;
       
    67 
       
    68     void setMaximum(int max);
       
    69     int maximum() const;
       
    70     void setMinimum(int min);
       
    71     int minimum() const;
       
    72     void setRange(int min, int max);
       
    73 
       
    74     void setProgressValue(int progressValue);
       
    75     int progressValue() const;
       
    76 
       
    77     void setAutoClose(bool autoClose);
       
    78     bool autoClose() const;
       
    79 
       
    80     void setProgressType(HbProgressDialog::ProgressDialogType type);
       
    81     HbProgressDialog::ProgressDialogType progressType() const;
       
    82 
       
    83     void setText(const QString &text);
       
    84     QString text() const;
       
    85 
       
    86     void setTextAlignment(Qt::Alignment align);
       
    87     Qt::Alignment textAlignment() const;
       
    88 
       
    89     void setTextWrapping(bool wrap); // deprecated
       
    90     bool textWrapping() const; // deprecated
       
    91 
       
    92     void setIconName(const QString &iconName);
       
    93     QString iconName() const;
       
    94 
       
    95     void setIconAlignment(Qt::Alignment align);
       
    96     Qt::Alignment iconAlignment() const;
       
    97 
       
    98     void setAnimationDefinition(QString &animationDefinition);
       
    99     QString animationDefinition() const;
       
   100 
       
   101     void setAction(QAction *action, ActionRole role = CancelButtonRole);
       
   102     QAction *action(ActionRole role = CancelButtonRole) const;
       
   103 
       
   104 signals:
       
   105     void cancelled();
       
   106     void aboutToClose();
       
   107 
       
   108 private:
       
   109     HbDeviceProgressDialogPrivate * const d;
       
   110     friend class HbDeviceProgressDialogPrivate;
       
   111 
       
   112     Q_DISABLE_COPY(HbDeviceProgressDialog)
       
   113 };
       
   114 
       
   115 #endif // HBDEVICEPROGRESSDIALOG_H