Subversion Repositories Scribus

Rev

Rev 4783 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
4028 cbradney 7
/***************************************************************************
8
*   Copyright (C) 2005 by Craig Bradney                                   *
9
*   cbradney@zip.com.au                                                   *
10
*                                                                         *
11
*   This program is free software; you can redistribute it and/or modify  *
12
*   it under the terms of the GNU General Public License as published by  *
13
*   the Free Software Foundation; either version 2 of the License, or     *
14
*   (at your option) any later version.                                   *
15
*                                                                         *
16
*   This program is distributed in the hope that it will be useful,       *
17
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
18
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
19
*   GNU General Public License for more details.                          *
20
*                                                                         *
21
*   You should have received a copy of the GNU General Public License     *
22
*   along with this program; if not, write to the                         *
23
*   Free Software Foundation, Inc.,                                       *
24
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
25
***************************************************************************/
26
 
27
#ifndef MULTIPROGRESSDIALOG_H
28
#define MULTIPROGRESSDIALOG_H
29
 
5215 mrdocs 30
#include "scribusapi.h"
4028 cbradney 31
#include "multiprogressdialogbase.h"
32
 
33
#include <qprogressbar.h>
34
#include <qpushbutton.h>
35
#include <qlabel.h>
36
#include <qlayout.h>
37
#include <qstringlist.h>
38
#include <qstring.h>
39
#include <qdialog.h>
40
#include <qmap.h>
41
 
5215 mrdocs 42
class SCRIBUS_API MultiProgressDialog : public MultiProgressDialogBase
4028 cbradney 43
{
44
        Q_OBJECT
45
 
46
        public:
47
                MultiProgressDialog(QWidget* parent=0, const char*name=0, bool modal=false, WFlags f=0);
4783 cbradney 48
                /**
49
                 * Create a multi progress bar dialog for long operations with multiple steps. The dialog includes
50
                 * one standard progress bar, typically for the overall progress and others may be added easily.
51
                 * @param titleText Title of the dialog
52
                 * @param cancelButtonText Text of the cancel button.. Cancel, Close, @sa CommontStrings::
53
                 * @param parent Parent widget for the dialog, commonly ScMW
54
                 * @param name
55
                 * @param modal
56
                 * @param f
57
                 * @return
58
                 */
4028 cbradney 59
                MultiProgressDialog(const QString& titleText, const QString & cancelButtonText, QWidget* parent=0, const char*name=0, bool modal=true, WFlags f=0);
60
                ~MultiProgressDialog();
61
 
4783 cbradney 62
                /**
63
                 * Remove all progress bars other than the main one
64
                 */
4028 cbradney 65
                void removeExtraProgressBars();
4783 cbradney 66
                /**
67
                 * Add a list of progress bars, where barsList contains a list of references and barTexts
68
                 * contains the labels for the bars.
69
                 * Eg:
70
                 * "MYBAR1" -> "My Bar 1:"
71
                 * "MYBAR2" -> "My Bar 2:"
72
                 * @param barsList
73
                 * @param barsTexts
74
                 * @return Success
75
                 */
4028 cbradney 76
                bool addExtraProgressBars(const QStringList &barsList, const QStringList &barsTexts);
4783 cbradney 77
                /**
78
                 * Set a new label for a user defined progress bar
79
                 * @param barName Progress bar name
80
                 * @param newLabel New label
81
                 * @return Success
82
                 */
4028 cbradney 83
                bool setLabel(const QString &barName, const QString & newLabel);
4783 cbradney 84
                /**
85
                 * Set the total steps for a user defined progress bar
86
                 * @param barName
87
                 * @param totalSteps
88
                 * @return Success
89
                 */
4028 cbradney 90
                bool setTotalSteps(const QString &barName, int totalSteps);
4783 cbradney 91
                /**
92
                 * Set the progress for a user defined progress bar
93
                 * @param barName
94
                 * @param progress
95
                 * @return
96
                 */
4028 cbradney 97
                bool setProgress(const QString &barName, int progress);
4783 cbradney 98
                /**
99
                 * Set the prgress and total steps for a user defined progress bar
100
                 * @param barName
101
                 * @param progress
102
                 * @param totalSteps
103
                 * @return
104
                 */
4028 cbradney 105
                bool setProgress(const QString &barName, int progress, int totalSteps);
4783 cbradney 106
                /**
107
                 * Set the overall total steps for the dialog
108
                 * @param totalSteps
109
                 */
4038 cbradney 110
                void setOverallTotalSteps(int totalSteps);
4783 cbradney 111
                /**
112
                 * Set the overall progress for the dialog
113
                 * @param progress
114
                 */
4038 cbradney 115
                void setOverallProgress(int progress);
4783 cbradney 116
                /**
117
                 * Set the overall progress and total steps for the dialog
118
                 * @param progress
119
                 * @param totalSteps
120
                 */
4038 cbradney 121
                void setOverallProgress(int progress, int totalSteps);
4783 cbradney 122
                /**
123
                 * Create a new progress bar in one step
124
                 * @param barName
125
                 * @param barText
126
                 * @param progress
127
                 * @param totalSteps
128
                 * @return
129
                 */
4028 cbradney 130
                bool setupBar(const QString &barName, const QString &barText, int progress, int totalSteps);
4783 cbradney 131
                /**
132
                 * Set the cancel button text
133
                 * @param cancelButtonText
134
                 */
4028 cbradney 135
                void setCancelButtonText(const QString & cancelButtonText);
136
 
137
        protected:
138
                QStringList progressBarTitles;
139
                QMap<QString, QProgressBar*> progressBars;
140
                QMap<QString, QLabel*> progressLabels;
141
};
142
 
143
#endif