LeechCraft Azoth 0.6.70-14794-g33744ae6ce
Modular multiprotocol IM plugin for LeechCraft
Loading...
Searching...
No Matches
ihaveservicediscovery.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#ifndef PLUGINS_AZOTH_INTERFACES_IHAVESERVICEDISCOVERY_H
10#define PLUGINS_AZOTH_INTERFACES_IHAVESERVICEDISCOVERY_H
11#include <QMetaType>
12
13class QAbstractItemModel;
14class QModelIndex;
15class QString;
16
17namespace LC
18{
19namespace Azoth
20{
37 {
38 public:
39 virtual ~ISDSession () {}
40
52 virtual void SetQuery (const QString& query) = 0;
53
64 virtual QString GetQuery () const = 0;
65
84 virtual QAbstractItemModel* GetRepresentationModel () const = 0;
85
107 virtual QList<QPair<QByteArray, QString>> GetActionsFor (const QModelIndex& index) = 0;
108
123 virtual void ExecuteAction (const QModelIndex& index, const QByteArray& id) = 0;
124 };
125
158 {
159 public:
161
175 virtual QObject* CreateSDSession () = 0;
176
188 virtual QString GetDefaultQuery () const = 0;
189
203 virtual void gotSDSession (QObject *session) = 0;
204 };
205}
206}
207
208Q_DECLARE_INTERFACE (LC::Azoth::ISDSession,
209 "org.Deviant.LeechCraft.Azoth.ISDSession/1.0")
210Q_DECLARE_INTERFACE (LC::Azoth::IHaveServiceDiscovery,
211 "org.Deviant.LeechCraft.Azoth.IHaveServiceDiscovery/1.0")
212
213#endif
Interface for accounts supporting service discovery.
virtual QObject * CreateSDSession()=0
Creates a new service discovery session.
virtual void gotSDSession(QObject *session)=0
Notifies about a new service discovery session.
virtual QString GetDefaultQuery() const =0
Returns the default query for this account.
Interface for service discovery sessions.
virtual QAbstractItemModel * GetRepresentationModel() const =0
Returns the model representing discovery results.
virtual QString GetQuery() const =0
Returns the query of this SD session.
virtual QList< QPair< QByteArray, QString > > GetActionsFor(const QModelIndex &index)=0
Returns the list of actions for the given index.
virtual void SetQuery(const QString &query)=0
Sets the service discovery query.
virtual void ExecuteAction(const QModelIndex &index, const QByteArray &id)=0
Executes the action with the given id.