From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- dcoprss/query.h | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 dcoprss/query.h (limited to 'dcoprss/query.h') diff --git a/dcoprss/query.h b/dcoprss/query.h new file mode 100644 index 00000000..d87e0505 --- /dev/null +++ b/dcoprss/query.h @@ -0,0 +1,120 @@ +/* $Id$ */ +#ifndef _QUERY_SERVICE +#define _QUERY_SERVICE + +/*************************************************************************** + query.h - A query interface to select RSS feeds. + ------------------- + begin : Saturday 15 February 2003 + copyright : (C) 2003 by Ian Reinhart Geiser + email : geiseri@kde.org + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "rssnewsfeed.h" +#include "xmlrpciface.h" + +#include + +#include +#include +#include +#include + +class RSSService; + +/** + * Helper class which just calls the slot given it's QObject/const char* + * representation. + */ +class SlotCaller : public QObject +{ + Q_OBJECT + public: + static void call( QObject *object, const char *slot, + const KXMLRPC::Query::Result &value ); + + signals: + void signal( const KXMLRPC::Query::Result &value ); + + private: + SlotCaller() { } +}; + +class QueryService : public QObject, public DCOPObject +{ + K_DCOP + Q_OBJECT + public: + QueryService( RSSService *service ); + + k_dcop_signals: + void feedIds( QValueList ids ); + void feedInfo(QMap links); + void feedInfo(QValueList feeds); + void gotCategories( const QStringList &categories ); + void gotFeedsInCategory( const QValueList &ids ); + + k_dcop: + /** + * Lists the active feeds in use... + **/ + QStringList listActive(); // just for testing... + + /** + * Query the www.syndic8.com XML-RPC interface for the + * string. The RSS ids are treturned in a integer list. + **/ + void findFeeds( const QString& query ); + + /** + * Query the www.syndic8.com XML-RPC interface for the + * string and matches it against the SiteURL feed of + * each feed in the feed list. The RSS ids are treturned + * in a integer list. + **/ + void findSites( const QString& query ); + + /** + * Query the www.syndic8.com XML-RPC interface for the + * requested RSS feed(s). Returned is a QMap with the format + * of Name (Site URL), RSS URL + **/ + void getFeedInfo( const QVariant& ids ); + + /** + * Returns the list of subcategories in the specified category. + * If no "Top" is specified, the root categories are returned. + */ + void getCategories( const QString &category ); + + /** + * Queries the database for the list of needsfeed ID's which are + * associated with the given category. + */ + void getFeedsInCategory( const QString &category ); + + + private slots: + void slotFoundFeeds( const KXMLRPC::Query::Result &result ); + void slotGotFeedInfo( const KXMLRPC::Query::Result &result ); + void slotGotCategories( const KXMLRPC::Query::Result &result ); + void slotGotFeedsInCategory( const KXMLRPC::Query::Result &result ); + + private: + void cachedCall( const QString &method, const QValueList &args, + const char *slot ); + void updateCache( const KXMLRPC::Query::Result &result ); + + RSSService *m_service; + KXMLRPC::Server *m_xmlrpcServer; +}; +#endif -- cgit v1.2.1