Tags manager's interface.
More...
#include "itagsmanager.h"
|
virtual | ~ITagsManager () |
|
virtual tag_id | GetID (const QString &tag)=0 |
| Returns the ID of the given tag. More...
|
|
QList< tag_id > | GetIDs (const QStringList &tags) |
| Returns the IDs of the given tags. More...
|
|
virtual QString | GetTag (tag_id id) const =0 |
| Returns the tag with the given id. More...
|
|
QStringList | GetTags (const QList< tag_id > &ids) const |
| Returns the tags with the given ids. More...
|
|
virtual QStringList | GetAllTags () const =0 |
| Returns all tags existing in LeechCraft now. More...
|
|
virtual QStringList | Split (const QString &string) const =0 |
| Splits the given string with tags to the list of the tags. More...
|
|
virtual QList< tag_id > | SplitToIDs (const QString &string)=0 |
| Splits the given string with tags and returns tags IDs. More...
|
|
virtual QString | Join (const QStringList &tags) const =0 |
| Joins the given tags into one string that's suitable to display to the user. More...
|
|
virtual QString | JoinIDs (const QStringList &tagIDs) const =0 |
| Joins the given tag IDs into one human-readable string. More...
|
|
virtual QAbstractItemModel * | GetModel ()=0 |
| Returns the completion model for this tags manager. More...
|
|
virtual QObject * | GetQObject ()=0 |
| Returns the tags manager as a QObject to get access to all the meta-stuff. More...
|
|
Tags manager's interface.
This interface is for communication with the tags manager.
Object returned by the GetQObject() function emits these signals:
- tagsUpdated(const QStringList& tags) when the tags are updated.
Definition at line 43 of file itagsmanager.h.
◆ tag_id
◆ ~ITagsManager()
virtual ITagsManager::~ITagsManager |
( |
| ) |
|
|
inlinevirtual |
◆ GetAllTags()
virtual QStringList ITagsManager::GetAllTags |
( |
| ) |
const |
|
pure virtual |
Returns all tags existing in LeechCraft now.
- Returns
- List of all tags.
◆ GetID()
virtual tag_id ITagsManager::GetID |
( |
const QString & |
tag | ) |
|
|
pure virtual |
Returns the ID of the given tag.
If there is no such tag, it's added to the tag collection and the id of the new tag is returned.
- Parameters
-
[in] | tag | The tag that should be identified. |
- Returns
- The ID of the tag.
- See also
- GetTag()
-
GetIDs()
◆ GetIDs()
QList<tag_id> ITagsManager::GetIDs |
( |
const QStringList & |
tags | ) |
|
|
inline |
Returns the IDs of the given tags.
This convenience function invokes GetID() for each tag in tags and returns the list of the corresponding tag IDs.
- Parameters
-
[in] | tags | The tags that should be identified. |
- Returns
- The IDs of the tags.
- See also
- GetID()
Definition at line 73 of file itagsmanager.h.
◆ GetModel()
virtual QAbstractItemModel* ITagsManager::GetModel |
( |
| ) |
|
|
pure virtual |
Returns the completion model for this tags manager.
The returned completion model can be used in a QCompleter class. It uses the tags from this tags manager to provide completions as the user types.
- Returns
- The completion model suitable for usage in a QCompleter.
◆ GetQObject()
virtual QObject* ITagsManager::GetQObject |
( |
| ) |
|
|
pure virtual |
Returns the tags manager as a QObject to get access to all the meta-stuff.
- Returns
- This object as a QObject.
◆ GetTag()
virtual QString ITagsManager::GetTag |
( |
tag_id |
id | ) |
const |
|
pure virtual |
Returns the tag with the given id.
If there is no such tag, a null QString is returned. A sensible plugin would delete the given id from the list of assigned tags for all the items with this id.
- Parameters
-
- Returns
- The tag.
- See also
- GetID()
-
GetTags()
Referenced by LC::Util::FlatToFoldersProxyModel::data().
◆ GetTags()
QStringList ITagsManager::GetTags |
( |
const QList< tag_id > & |
ids | ) |
const |
|
inline |
Returns the tags with the given ids.
This convenience function invokes GetTag() for each tag ID in ids and returns the list of the corresponding tags.
- Parameters
-
[in] | ids | The ids of the tags. |
- Returns
- The tags corresponding to the ids.
- See also
- GetTag()
Definition at line 105 of file itagsmanager.h.
◆ Join()
virtual QString ITagsManager::Join |
( |
const QStringList & |
tags | ) |
const |
|
pure virtual |
Joins the given tags into one string that's suitable to display to the user.
- Parameters
-
- Returns
- The joined string with tags.
◆ JoinIDs()
virtual QString ITagsManager::JoinIDs |
( |
const QStringList & |
tagIDs | ) |
const |
|
pure virtual |
Joins the given tag IDs into one human-readable string.
This function is essentially a combination of GetTag() and Join(). First, it converts all given tagIDs into tag names using GetTag() and then joins them using Join(). This function is provided for convenience.
- Parameters
-
[in] | tagIDs | List of tag IDs. |
- Returns
- The joined string with tags.
◆ Split()
virtual QStringList ITagsManager::Split |
( |
const QString & |
string | ) |
const |
|
pure virtual |
Splits the given string with tags to the list of the tags.
- Parameters
-
[in] | string | String with tags. |
- Returns
- The list of the tags.
◆ SplitToIDs()
virtual QList<tag_id> ITagsManager::SplitToIDs |
( |
const QString & |
string | ) |
|
|
pure virtual |
Splits the given string with tags and returns tags IDs.
This function is essentially a combination of Split() and GetID(). First, the given string is split into human-readable tags, and then for each tag its ID is obtained.
- Parameters
-
[in] | string | String with tags. |
- Returns
- The list of the tags IDs.
The documentation for this class was generated from the following file:
- /home/abuild/rpmbuild/BUILD/leechcraft-0.6.70-13729-g7046a9d2a7/src/interfaces/core/itagsmanager.h