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

the QGoDBBookmarkManager manages the interactions between the user and the database for the Bookmark DBTable. More...

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

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

Signals

void ListBookmarksChanged ()
 

Public Member Functions

void AddABookmark (int iCoordID, vtkMySQLDatabase *iDatabaseConnector)
 execute the dialog asking the user to enter a name and a description, validates the name, set the m_DatabaseConnectorForNewBkmrk and save the bookmark in the DB More...
 
void DeleteBookmark (vtkMySQLDatabase *iDatabaseConnector)
 delete the bookmarks from the database from a list the user selects and send a signal to tell that the list has changed More...
 
GoDBCoordinateRow GetCoordinatesForBookmark (vtkMySQLDatabase *iDatabaseConnector, std::string iName)
 return the coordinate for the bookmark with the name iName More...
 
 QGoDBBookmarkManager (QWidget *iParent=0, int iImgSessionID=0)
 
 ~QGoDBBookmarkManager ()
 
- 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...
 
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...
 
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

int GetCoordIDForBookmark (vtkMySQLDatabase *iDatabaseConnector, std::string iName)
 get the coordid for the bookmark with the name iName More...
 
void SaveNewEntityInDB ()
 
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 Attributes

int m_CoordIDForNewBookmark
 
GoDBBookmarkRow m_NewBookmark
 
- Protected Attributes inherited from QGoDBNameDescEntityManager
vtkMySQLDatabase * m_DatabaseConnector
 
std::string m_EntityName
 
int m_ImgSessionID
 
QGoNameDescriptionInputDialogm_NameDescDialog
 
std::string m_NameNewEntity
 

Additional Inherited Members

- Public Types inherited from QGoDBNameDescEntityManager
typedef std::vector< std::pair
< std::string, std::string > > 
NamesDescrContainerType
 
- 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...
 
virtual void SaveNewEntityInDB ()=0
 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...
 
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...
 

Detailed Description

the QGoDBBookmarkManager manages the interactions between the user and the database for the Bookmark DBTable.

Definition at line 50 of file QGoDBBookmarkManager.h.

Constructor & Destructor Documentation

QGoDBBookmarkManager::QGoDBBookmarkManager ( QWidget *  iParent = 0,
int  iImgSessionID = 0 
)
explicit

Definition at line 39 of file QGoDBBookmarkManager.cxx.

QGoDBBookmarkManager::~QGoDBBookmarkManager ( )

Definition at line 48 of file QGoDBBookmarkManager.cxx.

Member Function Documentation

void QGoDBBookmarkManager::AddABookmark ( int  iCoordID,
vtkMySQLDatabase *  iDatabaseConnector 
)

execute the dialog asking the user to enter a name and a description, validates the name, set the m_DatabaseConnectorForNewBkmrk and save the bookmark in the DB

Parameters
[in]iCoordIDID for the coordinate to be saved in the bookmark table
[in]iDatabaseConnectorconnection to the database

Definition at line 55 of file QGoDBBookmarkManager.cxx.

void QGoDBBookmarkManager::DeleteBookmark ( vtkMySQLDatabase *  iDatabaseConnector)

delete the bookmarks from the database from a list the user selects and send a signal to tell that the list has changed

Parameters
[in]iDatabaseConnectorconnection to the database

Definition at line 118 of file QGoDBBookmarkManager.cxx.

int QGoDBBookmarkManager::GetCoordIDForBookmark ( vtkMySQLDatabase *  iDatabaseConnector,
std::string  iName 
)
protectedslot

get the coordid for the bookmark with the name iName

Parameters
[in]iDatabaseConnectorconnection to the database
[in]iNameName of the bookmark
Returns
ID for the coordinate in the bookmark DBTable

Definition at line 98 of file QGoDBBookmarkManager.cxx.

GoDBCoordinateRow QGoDBBookmarkManager::GetCoordinatesForBookmark ( vtkMySQLDatabase *  iDatabaseConnector,
std::string  iName 
)

return the coordinate for the bookmark with the name iName

Parameters
[in]iDatabaseConnectorconnection to the database
[in]iNamename of the bookmark for which we want to get the coordinate
Returns
GoDBCoordinateRow containing the data for the coordinate which name is iName

Definition at line 85 of file QGoDBBookmarkManager.cxx.

void QGoDBBookmarkManager::ListBookmarksChanged ( )
signal
void QGoDBBookmarkManager::SaveNewEntityInDB ( )
protectedslot

Definition at line 65 of file QGoDBBookmarkManager.cxx.

void QGoDBBookmarkManager::ValidateName ( std::string  iName,
std::string  iDescription 
)
protectedslot

Definition at line 108 of file QGoDBBookmarkManager.cxx.

Member Data Documentation

int QGoDBBookmarkManager::m_CoordIDForNewBookmark
protected

Definition at line 87 of file QGoDBBookmarkManager.h.

GoDBBookmarkRow QGoDBBookmarkManager::m_NewBookmark
protected

Definition at line 86 of file QGoDBBookmarkManager.h.


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