2
Copyright (C) 2010 Frederik Gladhorn <gladhorn@kde.org>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Lesser General Public
6
License as published by the Free Software Foundation; either
7
version 2.1 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Lesser General Public License for more details.
14
You should have received a copy of the GNU Lesser General Public
15
License along with this library. If not, see <http://www.gnu.org/licenses/>.
18
#ifndef KNEWSTUFF3_UI_UPLOADDIALOG_P_H
19
#define KNEWSTUFF3_UI_UPLOADDIALOG_P_H
21
#include "upload/atticahelper_p.h"
22
#include "ui_uploaddialog.h"
24
#include <attica/providermanager.h>
25
#include <attica/provider.h>
26
#include <attica/category.h>
27
#include <attica/content.h>
28
#include <attica/listjob.h>
29
#include <attica/license.h>
30
#include <attica/postjob.h>
34
class QDialogButtonBox;
36
class KPixmapSequenceWidget;
40
class UploadDialog::Private
43
Private(UploadDialog *q)
45
, currentPage(UserPasswordPage)
47
, finishedPreview1(false)
48
, finishedPreview2(false)
49
, finishedPreview3(false)
50
, finishedContents(false)
63
WizardPage currentPage;
65
Attica::Provider currentProvider()
67
return atticaHelper->provider();
71
QDialogButtonBox *buttonBox;
72
QPushButton *finishButton;
73
QPushButton *nextButton;
74
QPushButton *backButton;
75
KPixmapSequenceWidget *busyWidget;
77
AtticaHelper *atticaHelper;
83
QStringList categoryNames;
84
Attica::Category::List categories;
87
bool finishedPreview1;
88
bool finishedPreview2;
89
bool finishedPreview3;
90
bool finishedContents;
92
bool init(const QString &configfile);
93
void setBusy(const QString &message);
94
void setIdle(const QString &message);
96
// change to page, set the focus also calls updatePage()
97
void _k_showPage(int page);
99
// check after user input - for example enable the next button
100
void _k_updatePage();
102
// next wizard page (next button clicked)
107
// after all has been done and said, do the uploading
108
void _k_startUpload();
110
void _k_providersLoaded(const QStringList &providerNames);
111
void _k_providerChanged(const QString &providerName);
113
// validation of login is done, go to next page if successful, otherwise ask again
114
void _k_checkCredentialsFinished(bool);
115
void _k_categoriesLoaded(const Attica::Category::List &loadedCategories);
116
void _k_licensesLoaded(const Attica::License::List &licenses);
117
void _k_currencyLoaded(const QString ¤cy);
118
void _k_contentByCurrentUserLoaded(const Attica::Content::List &contentList);
119
void _k_updatedContentFetched(const Attica::Content &content);
120
void _k_previewLoaded(int index, const QImage &image);
122
void _k_changePreview1();
123
void _k_changePreview2();
124
void _k_changePreview3();
125
void _k_preview1UploadFinished(Attica::BaseJob *);
126
void _k_preview2UploadFinished(Attica::BaseJob *);
127
void _k_preview3UploadFinished(Attica::BaseJob *);
129
void _k_contentAdded(Attica::BaseJob *);
130
void _k_fileUploadFinished(Attica::BaseJob *);
132
void uploadFileFinished();
133
void doUpload(const QString &index, const QUrl &filePath);
135
void _k_priceToggled(bool);
136
void _k_updateContentsToggled(bool update);
137
void _k_detailsLinkLoaded(const QUrl &url);
139
void getAccountBalance();
140
void _k_accountBalanceFetched(Attica::BaseJob *baseJob);
142
void _k_openRegisterAccountWebpage(QString);
144
QStringList _supportedMimeTypes() const;