GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
QGoDBColorManager Class Reference

the QGoDBColorManager manages the interactions between the user and the database for the color DBTable (add a new one, delete...). More...

#include <Code/GUI/lib/DBManager/QGoDBColorManager.h>

Inheritance diagram for QGoDBColorManager:
Inheritance graph
[legend]
Collaboration diagram for QGoDBColorManager:
Collaboration graph
[legend]

Public Types

typedef
QGoDeleteFromListDialog::ItemColorComboboxData 
ItemColorComboboxData
 
- Public Types inherited from QGoDBNameDescEntityManager
typedef std::vector< std::pair
< std::string, std::string > > 
NamesDescrContainerType
 

Public Member Functions

ItemColorComboboxData AddANewColor (vtkMySQLDatabase *iDatabaseConnector)
 ask the user the color he wants, the name, description of the new color and saves it in the database. More...
 
virtual bool DeleteEntity (vtkMySQLDatabase *iDatabaseConnector)
 show the list of the existing entities so the user can choose the ones he wants to delete, then delete them from the database More...
 
std::list< ItemColorComboboxDataGetListExistingColors (vtkMySQLDatabase *iDatabaseConnector)
 get the list of the existing colors from the database More...
 
 QGoDBColorManager (QWidget *iParent=0)
 
 ~QGoDBColorManager ()
 
- Public Member Functions inherited from QGoDBNameDescEntityManager
std::string AddAnEntity (vtkMySQLDatabase *iDatabaseConnector)
 execute the dialog asking the user to enter a name and a description, validates the name, set the m_DatabaseConnector, save the entity in the DB and return the name of the new entity More...
 
NamesDescrContainerType GetListExistingEntities (vtkMySQLDatabase *iDatabaseConnector)
 return the list of all the existing entities stored in the database More...
 
std::string GetNameNewEntity ()
 return the name of the new entity added More...
 
int GetTheEntityID (std::string iName, vtkMySQLDatabase *iDatabaseConnector)
 get the ID of the entity based on the name More...
 
 QGoDBNameDescEntityManager (QWidget *iParent=0, std::string iEntityName="", int iImgSessionID=0)
 
 ~QGoDBNameDescEntityManager ()
 

Protected Slots

virtual void ValidateName (std::string iName, std::string iDescription)
 
- Protected Slots inherited from QGoDBNameDescEntityManager
void DeleteEntitiesFromList (std::vector< std::string > iVectorNamesEntitiesToDelete)
 Delete in the database the entities with the names contained in the vector. More...
 
virtual void ValidateName (std::string iName, std::string iDescription)=0
 Pure Virtual method : check that the name doesn't already exists in the database, if so, make the m_NameDescDialog asks the user to choose another one, if no, close the m_NameDescDialog and call SaveNewEntityInDB() More...
 

Protected Member Functions

virtual void SaveNewEntityInDB ()
 Pure Virtual method : save the new entity in the database, the m_DatabaseConnectorForNewEntity needs to be set before calling this method. Check that the entity doesn't already exists in the database, if so, give the user the name of the existing entity. More...
 
- Protected Member Functions inherited from QGoDBNameDescEntityManager
template<typename T >
bool CheckEntityAlreadyExists (T iNewEntity)
 check if the entity already exists in the database, if yes, give the name of the existing entity to the user, if no, record the name iName as the name of the new entity More...
 
std::vector< std::string > GetNameExistingEntities (vtkMySQLDatabase *iDatabaseConnector)
 return the names of all the entities stored in the database More...
 
template<typename T >
void ValidateNameTemplate (T &ioNewEntity, std::string iName, std::string iDescription)
 check if the name already exists for this entity in the database, if yes, let the user know, if not, call SaveNewEntityInDB More...
 

Protected Attributes

GoDBColorRow m_NewColor
 
ItemColorComboboxData m_NewColorData
 
- Protected Attributes inherited from QGoDBNameDescEntityManager
vtkMySQLDatabase * m_DatabaseConnector
 
std::string m_EntityName
 
int m_ImgSessionID
 
QGoNameDescriptionInputDialogm_NameDescDialog
 
std::string m_NameNewEntity
 

Detailed Description

the QGoDBColorManager manages the interactions between the user and the database for the color DBTable (add a new one, delete...).

Definition at line 48 of file QGoDBColorManager.h.

Member Typedef Documentation

Definition at line 53 of file QGoDBColorManager.h.

Constructor & Destructor Documentation

QGoDBColorManager::QGoDBColorManager ( QWidget *  iParent = 0)
explicit

Definition at line 39 of file QGoDBColorManager.cxx.

QGoDBColorManager::~QGoDBColorManager ( )

Definition at line 47 of file QGoDBColorManager.cxx.

Member Function Documentation

QGoDBColorManager::ItemColorComboboxData QGoDBColorManager::AddANewColor ( vtkMySQLDatabase *  iDatabaseConnector)

ask the user the color he wants, the name, description of the new color and saves it in the database.

Returns
ItemColorComboboxData with the data for the new color saved or with the name of the color empty if the user canceled the "add new"

Definition at line 56 of file QGoDBColorManager.cxx.

bool QGoDBColorManager::DeleteEntity ( vtkMySQLDatabase *  iDatabaseConnector)
virtual

show the list of the existing entities so the user can choose the ones he wants to delete, then delete them from the database

Parameters
[in]iDatabaseConnectorconnection to the database
Returns
true if the user chooses to delete an entity, false if he canceled the deleting

Reimplemented from QGoDBNameDescEntityManager.

Definition at line 98 of file QGoDBColorManager.cxx.

std::list< QGoDBColorManager::ItemColorComboboxData > QGoDBColorManager::GetListExistingColors ( vtkMySQLDatabase *  iDatabaseConnector)

get the list of the existing colors from the database

Returns
a list of pair with the name and the QColor of each color

Definition at line 119 of file QGoDBColorManager.cxx.

void QGoDBColorManager::SaveNewEntityInDB ( )
protectedvirtual

Pure Virtual method : save the new entity in the database, the m_DatabaseConnectorForNewEntity needs to be set before calling this method. Check that the entity doesn't already exists in the database, if so, give the user the name of the existing entity.

Implements QGoDBNameDescEntityManager.

Definition at line 73 of file QGoDBColorManager.cxx.

void QGoDBColorManager::ValidateName ( std::string  iName,
std::string  iDescription 
)
protectedvirtualslot

Definition at line 89 of file QGoDBColorManager.cxx.

Member Data Documentation

GoDBColorRow QGoDBColorManager::m_NewColor
protected

Definition at line 74 of file QGoDBColorManager.h.

ItemColorComboboxData QGoDBColorManager::m_NewColorData
protected

Definition at line 75 of file QGoDBColorManager.h.


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