FactDev  0.1
userdatabase.h
1 #ifndef USERDATABASE_H
2 #define USERDATABASE_H
3 
4 #include "database/database.h"
5 #include "exceptions/dbexception.h"
6 #include "models/user.h"
7 #include "gui/utils/image.h"
8 
9 namespace Databases {
10 
18 class UserDatabase : public Database
19 {
20 private:
21  static UserDatabase* _instance;
22 
25  UserDatabase()throw(DbException*) ;
26 
27 public:
32  static UserDatabase* instance()throw(DbException*);
33 
40  Models::User *getUser(const int pId=1);
41 
45  void updateUser(const Models::User&);
46 
52  QPixmap getUserImage(const int pId=1);
53 
59  void setUserImage(Models::User &pUser);
60 
61 };
62 }
63 #endif // USERDATABASE_H
The DbException class for database exception : queries, db file, …
Definition: dbexception.h:18
The Database class Master class for all database access.
Definition: database.h:34
The User class User of it application.
Definition: user.h:20
The UserDatabase class Access to User data in the the table User of the Database
Definition: userdatabase.h:18
static UserDatabase * instance()
UserDatabase::getInstance Return an instance of UserDatabase.
Definition: userdatabase.cpp:13
QPixmap getUserImage(const int pId=1)
UserDatabase::getUserImage Return a User image.
Definition: userdatabase.cpp:113
void setUserImage(Models::User &pUser)
UserDatabase::setUserImage Change the image of the customer pCustomer
Definition: userdatabase.cpp:133
Models::User * getUser(const int pId=1)
UserDatabase::getUser Get informations about the user (identified by 'pId')
Definition: userdatabase.cpp:21
void updateUser(const Models::User &)
UserDatabase::updateUser Update informations about the user.
Definition: userdatabase.cpp:68