LeechCraft  0.6.70-10870-g558588d6ec
Modular cross-platform feature rich live environment.
ITagsManager Class Referenceabstract

Tags manager's interface. More...

#include "itagsmanager.h"

Public Types

typedef QString tag_id
 

Public Member Functions

virtual ~ITagsManager ()
 
virtual tag_id GetID (const QString &tag)=0
 Returns the ID of the given tag. More...
 
QList< tag_idGetIDs (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)
 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 QStringList 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...
 

Detailed Description

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.

Member Typedef Documentation

◆ tag_id

typedef QString ITagsManager::tag_id

Definition at line 46 of file itagsmanager.h.

Constructor & Destructor Documentation

◆ ~ITagsManager()

virtual ITagsManager::~ITagsManager ( )
inlinevirtual

Definition at line 48 of file itagsmanager.h.

Member Function Documentation

◆ 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]tagThe 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]tagsThe 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
[in]idThe id of the tag.
Returns
The tag.
See also
GetID()
GetTags()

Referenced by LeechCraft::Util::FlatToFoldersProxyModel::data().

+ Here is the caller graph for this function:

◆ GetTags()

QStringList ITagsManager::GetTags ( const QList< tag_id > &  ids)
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]idsThe 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
[in]tagsList of tags.
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]tagIDsList 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]stringString with tags.
Returns
The list of the tags.

◆ SplitToIDs()

virtual QStringList 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]stringString with tags.
Returns
The list of the tags IDs.

The documentation for this class was generated from the following file: