• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.1 API Reference
  • KDE Home
  • Contact Us
 

KNewStuff

  • knewstuff
  • knewstuff3
  • upload
atticahelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 Frederik Gladhorn <gladhorn@kde.org>
3 
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.
8 
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.
13 
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/>.
16 */
17 
18 #ifndef KNEWSTUFF3_ATTICAHELPER_H
19 #define KNEWSTUFF3_ATTICAHELPER_H
20 
21 #include <QtCore/QStringList>
22 
23 #include <attica/providermanager.h>
24 #include <attica/provider.h>
25 
26 #include <attica/category.h>
27 #include <attica/content.h>
28 #include <attica/license.h>
29 
30 class KJob;
31 namespace KIO {
32  class Job;
33  class TransferJob;
34 }
35 
36 namespace KNS3
37 {
38 
39 class AtticaHelper : public QObject
40 {
41 Q_OBJECT
42 public:
43  explicit AtticaHelper(QObject *parent = 0);
44  void init();
45 
46  void setCurrentProvider(const QString& provider);
47 
48  Attica::Provider provider();
49 
50  void checkLogin(const QString& name, const QString& password);
51  bool loadCredentials(QString& name, QString& password);
52  bool saveCredentials(const QString& name, const QString& password);
53  void loadCategories(const QStringList& configuredCategories);
54  void loadContentByCurrentUser();
55  void loadLicenses();
56  void loadDetailsLink(const QString& contentId);
57  void loadContent(const QString& contentId);
58  void loadCurrency();
59  void loadPreviews(const QString& contentId);
60 
61 Q_SIGNALS:
62  void loginChecked(bool);
63  void providersLoaded(const QStringList&);
64  void categoriesLoaded(Attica::Category::List);
65  void contentByCurrentUserLoaded(const Attica::Content::List&);
66  void licensesLoaded(const Attica::License::List&);
67  void detailsLinkLoaded(const QUrl&);
68  void contentLoaded(const Attica::Content&);
69  void currencyLoaded(const QString&);
70  void previewLoaded(int index, const QImage& image);
71 
72 private Q_SLOTS:
73  void checkLoginFinished(Attica::BaseJob* baseJob);
74  void defaultProvidersLoaded();
75  void categoriesLoaded(Attica::BaseJob* baseJob);
76  void contentByCurrentUserLoaded(Attica::BaseJob* baseJob);
77  void licensesLoaded(Attica::BaseJob* baseJob);
78  void detailsLinkLoaded(Attica::BaseJob* baseJob);
79  void contentLoaded(Attica::BaseJob* baseJob);
80  void currencyLoaded(Attica::BaseJob* baseJob);
81 
82  void slotPreviewData(KIO::Job* job, const QByteArray& buf);
83  void slotPreviewDownload(KJob *job);
84 
85 
86 private:
87  Attica::ProviderManager providerManager;
88  Attica::Provider currentProvider;
89  Attica::Category::List m_validCategories;
90 
91  QString m_username;
92  QStringList m_configuredCategories;
93  Attica::Content::List m_userCreatedContent;
94 
95  QByteArray m_previewBuffer[3];
96  KIO::TransferJob* m_previewJob[3];
97 
98  Q_DISABLE_COPY(AtticaHelper)
99 };
100 }
101 
102 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Wed Mar 20 2013 07:21:17 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.10.1 API Reference

Skip menu "kdelibs-4.10.1 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal