LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
Toggle main menu visibility
Loading...
Searching...
No Matches
itagsmanager.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 INTERFACES_CORE_ITAGSMANAGER_H
10
#define INTERFACES_CORE_ITAGSMANAGER_H
11
#include <QStringList>
12
13
class
QAbstractItemModel;
14
22
class
Q_DECL_EXPORT
ITagsManager
23
{
24
public
:
25
typedef
QString
tag_id
;
26
27
virtual
~ITagsManager
() {}
28
40
virtual
tag_id
GetID
(
const
QString& tag) = 0;
41
52
QList<tag_id>
GetIDs
(
const
QStringList& tags)
53
{
54
QList<tag_id>
result;
55
for
(
const
auto
& tag : tags)
56
result <<
GetID
(tag);
57
return
result;
58
}
59
72
virtual
QString
GetTag
(
tag_id
id
)
const
= 0;
73
84
QStringList
GetTags
(
const
QList<tag_id>
& ids)
const
85
{
86
QStringList result;
87
for
(
const
auto
&
id
: ids)
88
result <<
GetTag
(
id
);
89
return
result;
90
}
91
96
virtual
QStringList
GetAllTags
()
const
= 0;
97
103
virtual
QStringList
Split
(
const
QString&
string
)
const
= 0;
104
114
virtual
QList<tag_id>
SplitToIDs
(
const
QString&
string
) = 0;
115
122
virtual
QString
Join
(
const
QStringList& tags)
const
= 0;
123
134
virtual
QString
JoinIDs
(
const
QStringList& tagIDs)
const
= 0;
135
144
virtual
QAbstractItemModel*
GetModel
() = 0;
145
151
virtual
QObject*
GetQObject
() = 0;
152
};
153
154
Q_DECLARE_INTERFACE (
ITagsManager
,
"org.Deviant.LeechCraft.ITagsManager/1.0"
)
155
156
#endif
ITagsManager
Tags manager's interface.
Definition
itagsmanager.h:23
ITagsManager::~ITagsManager
virtual ~ITagsManager()
Definition
itagsmanager.h:27
ITagsManager::GetAllTags
virtual QStringList GetAllTags() const =0
Returns all tags existing in LeechCraft now.
ITagsManager::GetTags
QStringList GetTags(const QList< tag_id > &ids) const
Returns the tags with the given ids.
Definition
itagsmanager.h:84
ITagsManager::GetIDs
QList< tag_id > GetIDs(const QStringList &tags)
Returns the IDs of the given tags.
Definition
itagsmanager.h:52
ITagsManager::SplitToIDs
virtual QList< tag_id > SplitToIDs(const QString &string)=0
Splits the given string with tags and returns tags IDs.
ITagsManager::GetModel
virtual QAbstractItemModel * GetModel()=0
Returns the completion model for this tags manager.
ITagsManager::GetQObject
virtual QObject * GetQObject()=0
Returns the tags manager as a QObject to get access to all the meta-stuff.
ITagsManager::Join
virtual QString Join(const QStringList &tags) const =0
Joins the given tags into one string that's suitable to display to the user.
ITagsManager::Split
virtual QStringList Split(const QString &string) const =0
Splits the given string with tags to the list of the tags.
ITagsManager::GetTag
virtual QString GetTag(tag_id id) const =0
Returns the tag with the given id.
ITagsManager::tag_id
QString tag_id
Definition
itagsmanager.h:25
ITagsManager::GetID
virtual tag_id GetID(const QString &tag)=0
Returns the ID of the given tag.
ITagsManager::JoinIDs
virtual QString JoinIDs(const QStringList &tagIDs) const =0
Joins the given tag IDs into one human-readable string.
QList
Definition
ianrulesstorage.h:14
src
interfaces
core
itagsmanager.h
Generated by
1.17.0