forked from felixmt/LO21
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TagManager.h
73 lines (60 loc) · 1.56 KB
/
TagManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* \file TagManager.h
* \author Félix, Victor
* \version 1.0
* \date 15 Juin 2013
* \brief Gestionnaire de tags, classe singleton
*/
#ifndef TAGMANAGER_H
#define TAGMANAGER_H
#include <QList>
#include "Tag.h"
/**
* \class TagManager TagManager.h
*/
class TagManager
{
static TagManager* instance;
TagManager();
TagManager& operator=(const TagManager&);
QList <Tag*> tabTags ;
public:
~TagManager();
/**
* \brief Fonction qui cree une instance de TagManager s'il n'en existe pas une (TagManager est une classe singleton)
*/
static TagManager& getInstance();
/**
* \brief Fonction qui supprime une instance de TagManager s'il en existe une.
*/
static void deleteInstance(){if(instance) instance->~TagManager(),instance=0;}
Tag* getTag(QString& name);
Tag* getTag(int pos);
/**
* \brief Fonction qui associe un tag a une note
* \param name nom du tag a associer
* \param n note a associer au tag
*/
void addAssociatedTag(QString& name,Note* n);
/**
* \brief Fonction qui dissocie un tag a une note
* \param name nom du tag a associer
* \param n note a associer au tag
*/
void deleteAssociatedTag(QString& name, Note* n);
/**
* \brief Fonction qui supprime un tag
* \param n tag a supprimer
*/
void deleteTag(Tag* n);
int getTagPos(Tag* t);
/**
* \brief Fonction qui ajoute un tag
* \param n tag a ajouter
*/
void addTag(Tag*t);
//void creatTag();
int getTabTagsSize(){ return tabTags.size(); }
Tag* getTagByPos(int i){ return tabTags[i]; }
};
#endif // TAGMANAGER_H