Port KProgressBar's to QProgressBar's.
[kdenetwork.git] / dcoprss / query.h
blob8af3ab3a0ae2c239bda9cca72eb2a7bc269b4fe5
1 /* $Id$ */
2 #ifndef _QUERY_SERVICE
3 #define _QUERY_SERVICE
5 /***************************************************************************
6 query.h - A query interface to select RSS feeds.
7 -------------------
8 begin : Saturday 15 February 2003
9 copyright : (C) 2003 by Ian Reinhart Geiser
10 email : geiseri@kde.org
11 ***************************************************************************/
13 /***************************************************************************
14 * *
15 * This program is free software; you can redistribute it and/or modify *
16 * it under the terms of the GNU General Public License as published by *
17 * the Free Software Foundation; either version 2 of the License, or *
18 * (at your option) any later version. *
19 * *
20 ***************************************************************************/
22 #include "rssnewsfeed.h"
23 #include "xmlrpciface.h"
25 #include <dcopobject.h>
27 #include <qmap.h>
28 #include <qobject.h>
29 #include <q3valuelist.h>
30 #include <qvariant.h>
31 #include <QList>
33 class RSSService;
35 /**
36 * Helper class which just calls the slot given it's QObject/const char*
37 * representation.
39 class SlotCaller : public QObject
41 Q_OBJECT
42 public:
43 static void call( QObject *object, const char *slot,
44 const KXMLRPC::Query::Result &value );
46 signals:
47 void signal( const KXMLRPC::Query::Result &value );
49 private:
50 SlotCaller() { }
53 class QueryService : public QObject, public DCOPObject
55 K_DCOP
56 Q_OBJECT
57 public:
58 QueryService( RSSService *service );
60 k_dcop_signals:
61 void feedIds( QList<int> ids );
62 void feedInfo(QMap<QString, QString> links);
63 void feedInfo(QList<RSSNewsFeed> feeds);
64 void gotCategories( const QStringList &categories );
65 void gotFeedsInCategory( const QList<int> &ids );
67 k_dcop:
68 /**
69 * Lists the active feeds in use...
70 **/
71 QStringList listActive(); // just for testing...
73 /**
74 * Query the www.syndic8.com XML-RPC interface for the
75 * string. The RSS ids are treturned in a integer list.
76 **/
77 void findFeeds( const QString& query );
79 /**
80 * Query the www.syndic8.com XML-RPC interface for the
81 * string and matches it against the SiteURL feed of
82 * each feed in the feed list. The RSS ids are treturned
83 * in a integer list.
84 **/
85 void findSites( const QString& query );
87 /**
88 * Query the www.syndic8.com XML-RPC interface for the
89 * requested RSS feed(s). Returned is a QMap with the format
90 * of Name (Site URL), RSS URL
91 **/
92 void getFeedInfo( const QVariant& ids );
94 /**
95 * Returns the list of subcategories in the specified category.
96 * If no "Top" is specified, the root categories are returned.
98 void getCategories( const QString &category );
101 * Queries the database for the list of needsfeed ID's which are
102 * associated with the given category.
104 void getFeedsInCategory( const QString &category );
107 private slots:
108 void slotFoundFeeds( const KXMLRPC::Query::Result &result );
109 void slotGotFeedInfo( const KXMLRPC::Query::Result &result );
110 void slotGotCategories( const KXMLRPC::Query::Result &result );
111 void slotGotFeedsInCategory( const KXMLRPC::Query::Result &result );
113 private:
114 void cachedCall( const QString &method, const QList<QVariant> &args,
115 const char *slot );
116 void updateCache( const KXMLRPC::Query::Result &result );
118 RSSService *m_service;
119 KXMLRPC::Server *m_xmlrpcServer;
121 #endif