KNewStuff
uploaddialog_p.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2010 Frederik Gladhorn <gladhorn@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Lesser General Public 00006 License as published by the Free Software Foundation; either 00007 version 2.1 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Lesser General Public License for more details. 00013 00014 You should have received a copy of the GNU Lesser General Public 00015 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef KNEWSTUFF3_UI_UPLOADDIALOG_P_H 00019 #define KNEWSTUFF3_UI_UPLOADDIALOG_P_H 00020 00021 #include "upload/atticahelper.h" 00022 #include "ui_uploaddialog.h" 00023 00024 #include <attica/providermanager.h> 00025 #include <attica/provider.h> 00026 #include <attica/category.h> 00027 #include <attica/content.h> 00028 #include <attica/listjob.h> 00029 #include <attica/license.h> 00030 #include <attica/postjob.h> 00031 00032 00033 #define FinishButton KDialog::User1 00034 #define NextButton KDialog::User2 00035 #define BackButton KDialog::User3 00036 00037 class KPixmapSequenceWidget; 00038 00039 namespace KNS3 { 00040 class UploadDialog::Private 00041 { 00042 public: 00043 Private(UploadDialog* q) 00044 : q(q) 00045 , currentPage(UserPasswordPage) 00046 , finished(false) 00047 , finishedPreview1(false) 00048 , finishedPreview2(false) 00049 , finishedPreview3(false) 00050 , finishedContents(false) 00051 { 00052 } 00053 00054 UploadDialog* q; 00055 00056 enum WizardPage { 00057 UserPasswordPage, 00058 FileNewUpdatePage, 00059 Details1Page, 00060 Details2Page, 00061 UploadFinalPage 00062 }; 00063 WizardPage currentPage; 00064 00065 Attica::Provider currentProvider() { 00066 return atticaHelper->provider(); 00067 } 00068 00069 Ui::UploadDialog ui; 00070 KPixmapSequenceWidget* busyWidget; 00071 00072 AtticaHelper* atticaHelper; 00073 00074 KUrl uploadFile; 00075 KUrl previewFile1; 00076 KUrl previewFile2; 00077 KUrl previewFile3; 00078 QStringList categoryNames; 00079 Attica::Category::List categories; 00080 QString contentId; 00081 bool finished; 00082 bool finishedPreview1; 00083 bool finishedPreview2; 00084 bool finishedPreview3; 00085 bool finishedContents; 00086 00087 void init(); 00088 void setBusy(const QString& message); 00089 void setIdle(const QString& message); 00090 00091 // change to page, set the focus also calls updatePage() 00092 void _k_showPage(int page); 00093 00094 // check after user input - for example enable the next button 00095 void _k_updatePage(); 00096 00097 // next wizard page (next button clicked) 00098 void _k_nextPage(); 00099 // go back one page 00100 void _k_backPage(); 00101 00102 // after all has been done and said, do the uploading 00103 void _k_startUpload(); 00104 00105 void _k_providersLoaded(const QStringList& providerNames); 00106 void _k_providerChanged(const QString& providerName); 00107 00108 // validation of login is done, go to next page if successfull, otherwise ask again 00109 void _k_checkCredentialsFinished(bool); 00110 void _k_categoriesLoaded(const Attica::Category::List& loadedCategories); 00111 void _k_licensesLoaded(const Attica::License::List& licenses); 00112 void _k_currencyLoaded(const QString& currency); 00113 void _k_contentByCurrentUserLoaded(const Attica::Content::List& contentList); 00114 void _k_updatedContentFetched(const Attica::Content& content); 00115 void _k_previewLoaded(int index, const QImage& image); 00116 00117 void _k_changePreview1(); 00118 void _k_changePreview2(); 00119 void _k_changePreview3(); 00120 void _k_preview1UploadFinished(Attica::BaseJob*); 00121 void _k_preview2UploadFinished(Attica::BaseJob*); 00122 void _k_preview3UploadFinished(Attica::BaseJob*); 00123 00124 void _k_contentAdded(Attica::BaseJob*); 00125 void _k_fileUploadFinished(Attica::BaseJob*); 00126 00127 void uploadFileFinished(); 00128 void doUpload(const QString& index, const KUrl& filePath); 00129 00130 void _k_priceToggled(bool); 00131 void _k_updateContentsToggled(bool update); 00132 void _k_detailsLinkLoaded(const QUrl& url); 00133 00134 void getAccountBalance(); 00135 void _k_accountBalanceFetched(Attica::BaseJob* baseJob); 00136 }; 00137 } 00138 00139 #endif
KDE 4.6 API Reference