LeechCraft  %{LEECHCRAFT_VERSION}
Modular cross-platform feature rich live environment.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
virtual QString GetTag (tag_id id) const =0
 Returns the tag with the given id. More...
 
virtual QStringList GetAllTags () const =0
 
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. 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

typedef QString ITagsManager::tag_id

Definition at line 46 of file itagsmanager.h.

Constructor & Destructor Documentation

virtual ITagsManager::~ITagsManager ( )
inlinevirtual

Definition at line 48 of file itagsmanager.h.

Member Function Documentation

virtual QStringList ITagsManager::GetAllTags ( ) const
pure virtual

Returns all tags existing in LeechCraft now.

Returns
List of all tags.
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
virtual QAbstractItemModel* ITagsManager::GetModel ( )
pure virtual

Returns the completion model for this.

virtual QObject* ITagsManager::GetQObject ( )
pure virtual

Returns the tags manager as a QObject to get access to all the meta-stuff.

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

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

+ Here is the caller graph for this function:

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.
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.
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.
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: