• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 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
30class KJob;
31namespace KIO {
32 class Job;
33 class TransferJob;
34}
35
36namespace KNS3
37{
38
39class AtticaHelper : public QObject
40{
41Q_OBJECT
42public:
43 explicit AtticaHelper(QObject *parent = 0);
44 void init();
45
46 void setCurrentProvider(const QString& provider);
47 void addProviderFile(const QUrl& file);
48
49 Attica::Provider provider();
50
51 void checkLogin(const QString& name, const QString& password);
52 bool loadCredentials(QString& name, QString& password);
53 bool saveCredentials(const QString& name, const QString& password);
54 void loadCategories(const QStringList& configuredCategories);
55 void loadContentByCurrentUser();
56 void loadLicenses();
57 void loadDetailsLink(const QString& contentId);
58 void loadContent(const QString& contentId);
59 void loadCurrency();
60 void loadPreviews(const QString& contentId);
61
62Q_SIGNALS:
63 void loginChecked(bool);
64 void providersLoaded(const QStringList&);
65 void categoriesLoaded(Attica::Category::List);
66 void contentByCurrentUserLoaded(const Attica::Content::List&);
67 void licensesLoaded(const Attica::License::List&);
68 void detailsLinkLoaded(const QUrl&);
69 void contentLoaded(const Attica::Content&);
70 void currencyLoaded(const QString&);
71 void previewLoaded(int index, const QImage& image);
72
73private Q_SLOTS:
74 void checkLoginFinished(Attica::BaseJob* baseJob);
75 void defaultProvidersLoaded();
76 void categoriesLoaded(Attica::BaseJob* baseJob);
77 void contentByCurrentUserLoaded(Attica::BaseJob* baseJob);
78 void licensesLoaded(Attica::BaseJob* baseJob);
79 void detailsLinkLoaded(Attica::BaseJob* baseJob);
80 void contentLoaded(Attica::BaseJob* baseJob);
81 void currencyLoaded(Attica::BaseJob* baseJob);
82
83 void slotPreviewData(KIO::Job* job, const QByteArray& buf);
84 void slotPreviewDownload(KJob *job);
85
86
87private:
88 Attica::ProviderManager providerManager;
89 Attica::Provider currentProvider;
90 Attica::Category::List m_validCategories;
91
92 QString m_username;
93 QStringList m_configuredCategories;
94 Attica::Content::List m_userCreatedContent;
95
96 QByteArray m_previewBuffer[3];
97 KIO::TransferJob* m_previewJob[3];
98
99 Q_DISABLE_COPY(AtticaHelper)
100};
101}
102
103#endif
KIO::Job
KIO::TransferJob
KJob
KNS3::AtticaHelper
Definition: atticahelper.h:40
KNS3::AtticaHelper::detailsLinkLoaded
void detailsLinkLoaded(const QUrl &)
KNS3::AtticaHelper::loadContentByCurrentUser
void loadContentByCurrentUser()
Definition: atticahelper.cpp:135
KNS3::AtticaHelper::contentLoaded
void contentLoaded(const Attica::Content &)
KNS3::AtticaHelper::loadDetailsLink
void loadDetailsLink(const QString &contentId)
Definition: atticahelper.cpp:164
KNS3::AtticaHelper::loadCredentials
bool loadCredentials(QString &name, QString &password)
Definition: atticahelper.cpp:91
KNS3::AtticaHelper::categoriesLoaded
void categoriesLoaded(Attica::Category::List)
KNS3::AtticaHelper::loadCategories
void loadCategories(const QStringList &configuredCategories)
Definition: atticahelper.cpp:107
KNS3::AtticaHelper::currencyLoaded
void currencyLoaded(const QString &)
KNS3::AtticaHelper::loadContent
void loadContent(const QString &contentId)
Definition: atticahelper.cpp:179
KNS3::AtticaHelper::setCurrentProvider
void setCurrentProvider(const QString &provider)
Definition: atticahelper.cpp:64
KNS3::AtticaHelper::previewLoaded
void previewLoaded(int index, const QImage &image)
KNS3::AtticaHelper::provider
Attica::Provider provider()
Definition: atticahelper.cpp:74
KNS3::AtticaHelper::init
void init()
Definition: atticahelper.cpp:36
KNS3::AtticaHelper::licensesLoaded
void licensesLoaded(const Attica::License::List &)
KNS3::AtticaHelper::loadPreviews
void loadPreviews(const QString &contentId)
KNS3::AtticaHelper::providersLoaded
void providersLoaded(const QStringList &)
KNS3::AtticaHelper::loginChecked
void loginChecked(bool)
KNS3::AtticaHelper::loadLicenses
void loadLicenses()
Definition: atticahelper.cpp:150
KNS3::AtticaHelper::contentByCurrentUserLoaded
void contentByCurrentUserLoaded(const Attica::Content::List &)
KNS3::AtticaHelper::saveCredentials
bool saveCredentials(const QString &name, const QString &password)
Definition: atticahelper.cpp:102
KNS3::AtticaHelper::checkLogin
void checkLogin(const QString &name, const QString &password)
Definition: atticahelper.cpp:79
KNS3::AtticaHelper::loadCurrency
void loadCurrency()
Definition: atticahelper.cpp:187
KNS3::AtticaHelper::addProviderFile
void addProviderFile(const QUrl &file)
Definition: atticahelper.cpp:42
QObject
QUrl
KIO
KNS3
Definition: atticaprovider.cpp:36
name
const char * name(StandardAction id)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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.14.38 API Reference

Skip menu "kdelibs-4.14.38 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