File indexing completed on 2024-05-05 04:48:23

0001 /****************************************************************************************
0002  * Copyright (c) 2009 Maximilian Kossick <maximilian.kossick@googlemail.com>            *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016  
0017 #ifndef COLLECTIONDBUSHANDLER_H
0018 #define COLLECTIONDBUSHANDLER_H
0019 
0020 #include <QDBusArgument>
0021 #include <QDBusContext>
0022 #include <QList>
0023 #include <QMap>
0024 #include <QMetaType>
0025 #include <QObject>
0026 #include <QString>
0027 #include <QVariant>
0028 
0029 typedef QList<QVariantMap> VariantMapList;
0030 
0031 class CollectionDBusHandler : public QObject, protected QDBusContext
0032 {
0033     Q_OBJECT
0034     Q_CLASSINFO( "Collection D-Bus Interface", "org.kde.amarok.Collection" )
0035     
0036     public:
0037         explicit CollectionDBusHandler( QObject *parent );
0038         
0039     public Q_SLOTS:
0040         /*
0041          * Takes a query in XML form and executes it. Will return an empty map if the query XML is invalid
0042          *
0043          * This method return the metadata in a format that is not compatible to MPRIS. It is therefore superceded
0044          * by MprisQuery and will be removed for Amarok 2.3
0045          */
0046     VariantMapList Query( const QString &xmlQuery );
0047 
0048         /*
0049          * Takes a query in XML form and executes it. Will return an empty map if the query XML is invalid
0050          * Returns the metadata in a MPRIS compatible format
0051          *
0052          */
0053     VariantMapList MprisQuery( const QString &xmlQuery );
0054         
0055 };
0056 
0057 Q_DECLARE_METATYPE( VariantMapList )
0058 
0059 #endif