KNewStuff
uploaddialog.h
Go to the documentation of this file.
00001 /* 00002 knewstuff3/ui/uploaddialog.h. 00003 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 00004 Copyright (C) 2007 Josef Spillner <spillner@kde.org> 00005 Copyright (C) 2009 Jeremy Whiting <jpwhiting@kde.org> 00006 Copyright (C) 2009-2010 Frederik Gladhorn <gladhorn@kde.org> 00007 00008 This library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Lesser General Public 00010 License as published by the Free Software Foundation; either 00011 version 2.1 of the License, or (at your option) any later version. 00012 00013 This library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public 00019 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00020 */ 00021 #ifndef KNEWSTUFF3_UI_UPLOADDIALOG_H 00022 #define KNEWSTUFF3_UI_UPLOADDIALOG_H 00023 00024 #include <kdialog.h> 00025 #include <kurl.h> 00026 00027 #include <knewstuff3/knewstuff_export.h> 00028 00029 namespace Attica { 00030 class BaseJob; 00031 class Provider; 00032 } 00033 00034 // KDE5: this class should inherit from the wizard class - KAssistantDialog 00035 00036 namespace KNS3 00037 { 00048 class KNEWSTUFF_EXPORT UploadDialog : public KDialog 00049 { 00050 Q_OBJECT 00051 public: 00057 explicit UploadDialog(QWidget *parent = 0); 00058 00064 explicit UploadDialog(const QString& configFile, QWidget *parent = 0); 00065 00069 ~UploadDialog(); 00070 00077 void setUploadFile(const KUrl& payloadFile); 00078 00086 void setUploadName(const QString& name); 00087 00093 void setVersion(const QString& version); 00094 00100 void setDescription(const QString& description); 00101 00107 void setChangelog(const QString& changelog); 00108 00109 /* * 00110 Set the suggested license displayed in the upload dialog. 00111 The user can still change this. 00112 @param version version 00113 */ 00114 // enum License {}; // see fd.o api spec 00115 // void setLicense(License license); 00116 00124 void setPreviewImageFile(uint number, const KUrl& file); 00125 00131 void setPriceEnabled(bool enabled); 00132 00138 void setPrice(double price); 00139 00145 void setPriceReason(const QString& reason); 00146 00154 void selectCategory(const QString& category); 00155 00156 public Q_SLOTS: 00157 virtual void accept(); 00158 00159 private: 00160 bool init(const QString &configfile); 00161 00162 class Private; 00163 Private *const d; 00164 00165 Q_PRIVATE_SLOT( d, void _k_nextPage() ) 00166 Q_PRIVATE_SLOT( d, void _k_backPage() ) 00167 Q_PRIVATE_SLOT( d, void _k_updatePage() ) 00168 00169 Q_PRIVATE_SLOT( d, void _k_providerChanged(QString) ) 00170 Q_PRIVATE_SLOT( d, void _k_checkCredentialsFinished(bool) ) 00171 Q_PRIVATE_SLOT( d, void _k_contentByCurrentUserLoaded(Attica::Content::List) ) 00172 Q_PRIVATE_SLOT( d, void _k_providersLoaded(QStringList) ) 00173 Q_PRIVATE_SLOT( d, void _k_categoriesLoaded(Attica::Category::List) ) 00174 Q_PRIVATE_SLOT( d, void _k_licensesLoaded(Attica::License::List) ) 00175 Q_PRIVATE_SLOT( d, void _k_currencyLoaded(QString) ) 00176 Q_PRIVATE_SLOT( d, void _k_previewLoaded(int, QImage) ) 00177 00178 Q_PRIVATE_SLOT( d, void _k_changePreview1() ) 00179 Q_PRIVATE_SLOT( d, void _k_changePreview2() ) 00180 Q_PRIVATE_SLOT( d, void _k_changePreview3() ) 00181 Q_PRIVATE_SLOT( d, void _k_priceToggled(bool) ) 00182 Q_PRIVATE_SLOT( d, void _k_updateContentsToggled(bool update) ) 00183 00184 Q_PRIVATE_SLOT( d, void _k_startUpload() ) 00185 Q_PRIVATE_SLOT( d, void _k_contentAdded(Attica::BaseJob*) ) 00186 Q_PRIVATE_SLOT( d, void _k_fileUploadFinished(Attica::BaseJob*) ) 00187 Q_PRIVATE_SLOT( d, void _k_preview1UploadFinished(Attica::BaseJob*) ) 00188 Q_PRIVATE_SLOT( d, void _k_preview2UploadFinished(Attica::BaseJob*) ) 00189 Q_PRIVATE_SLOT( d, void _k_preview3UploadFinished(Attica::BaseJob*) ) 00190 00191 Q_PRIVATE_SLOT( d, void _k_updatedContentFetched(Attica::Content) ) 00192 Q_PRIVATE_SLOT( d, void _k_detailsLinkLoaded(QUrl) ) 00193 00194 Q_DISABLE_COPY( UploadDialog ) 00195 }; 00196 00197 } 00198 00199 #endif
KDE 4.6 API Reference