![]() |
LeechCraft 0.6.70-19424-g027e980fd1
Modular cross-platform feature rich live environment.
|
Tags manager's interface. More...
#include "itagsmanager.h"
Public Member Functions | |
| virtual | ~ITagsManager () |
| const LC::Util::Emitters::TagsManager & | GetEmitter () const |
| Returns the emitter of this manager's signals. | |
| virtual std::optional< LC::TagId > | GetID (const QString &tag)=0 |
| Returns the ID of the given tag. | |
| QList< LC::TagId > | GetIDs (const QStringList &tags) |
| Returns the IDs of the given tags. | |
| virtual QStringList | GetTags (const LC::TagId &id) const =0 |
| Returns the tags denoted by the given id. | |
| QStringList | GetTags (const QList< LC::TagId > &ids) const |
| Returns the tags denoted by the given ids. | |
| virtual QStringList | GetAllTags () const =0 |
| Returns all tags existing in LeechCraft now. | |
| virtual QStringList | Split (const QString &string) const =0 |
| Splits the given string with tags to the list of the tags. | |
| virtual QList< LC::TagId > | SplitToIDs (const QString &string)=0 |
| Splits the given string with tags and returns tags IDs. | |
| virtual QString | Join (const QStringList &tags) const =0 |
| Joins the given tags into one string that's suitable to display to the user. | |
| virtual QString | JoinIDs (const QList< LC::TagId > &tagIDs) const =0 |
| Joins the given tag IDs into one human-readable string. | |
| virtual QAbstractItemModel * | GetModel ()=0 |
| Returns the model listing the tag names. | |
Protected Attributes | |
| LC::Util::Emitters::TagsManager | Emitter_ |
Tags manager's interface.
This interface is for communication with the tags manager.
Tag names are trimmed and non-blank, and they don't contain the delimiter (per Util::GetTagsDelimiter()) the tags are split by. Tags are referred to by LC::TagIds, and an id may denote several tags (say, after a tag was split). Changes of the tags denoted by existing ids are announced by GetEmitter().
Definition at line 90 of file itagsmanager.h.
|
inlinevirtual |
Definition at line 95 of file itagsmanager.h.
|
pure virtual |
Returns all tags existing in LeechCraft now.
|
inline |
Returns the emitter of this manager's signals.
Definition at line 99 of file itagsmanager.h.
References Emitter_.
Referenced by LC::Util::TagsFoldersProxyModel::TagsFoldersProxyModel().
|
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.
If the tag is invalid, std::nullopt is returned.
| [in] | tag | The tag that should be identified. |
Referenced by GetIDs().
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. The tags rejected by GetID() are skipped.
| [in] | tags | The tags that should be identified. |
Definition at line 128 of file itagsmanager.h.
References GetID().
|
pure virtual |
Returns the model listing the tag names.
The model has one column and a row per distinct tag name, holding the name in both Qt::DisplayRole and Qt::EditRole, and follows the changes made through this manager. It is owned by the manager.
|
pure virtual |
Returns the tags denoted by the given id.
If there is no such tag, an empty list is returned. A sensible plugin would delete the given id from the list of assigned tags for all the items with this id.
| [in] | id | The id of the tags. |
Referenced by GetTags().
Returns the tags denoted by the given ids.
This convenience function invokes GetTags() for each tag ID in ids and returns the union of the results, each tag once, in the order of first occurrence.
| [in] | ids | The ids of the tags. |
Definition at line 163 of file itagsmanager.h.
References GetTags().
|
pure virtual |
Joins the given tags into one string that's suitable to display to the user.
| [in] | tags | List of tags. |
Joins the given tag IDs into one human-readable string.
This function is essentially a combination of GetTags() and Join(). First, it converts all given tagIDs into tag names using GetTags() and then joins them using Join(). This function is provided for convenience.
| [in] | tagIDs | List of tag IDs. |
|
pure virtual |
Splits the given string with tags to the list of the tags.
| [in] | string | String with tags. |
|
protected |
Definition at line 93 of file itagsmanager.h.
Referenced by GetEmitter().