FactDev  0.1
user.h
1 #ifndef USER_H
2 #define USER_H
3 #include <QString>
4 #include <QDir>
5 #include <QStandardPaths>
6 
7 #include "models/imodel.h"
8 #include "models/project.h"
9 #include "models/customer.h"
10 #include "models/people.h"
11 
12 #include "utils/log.h"
13 #include "utils/directories.h"
14 
15 namespace Models {
20 class User : public People
21 {
22 public:
26  User();
27 
32  User(int id);
33 
37  void commit();
38 
44  void hydrat(int id=1);
45 
49  void remove();
50 
55  QVariantHash getDataMap();
56 
57 
72  void updateFolders(void);
73 
79  QString getTitle() const;
85  void setTitle(const QString &title);
86 
92  QString getNoSiret() const;
98  void setNoSiret(const QString &noSiret);
99 
104  QPixmap *getImage();
105 
110  void setImage(QPixmap *image);
111 
116  QString getWorkspaceName() const;
122  void setWorkspaceName(const QString &workspaceName);
123 
128  QString getWorkspacePath() const;
134  void setWorkspacePath(const QString &workspacePath);
135 
142  bool operator ==(const User &u);
150  bool operator !=(const User &u);
151 
156  QString getPdflatexPath() const;
157 
162  void setPdflatexPath(const QString &getPdflatexPath);
163 
168  double getNbHoursPerDay() const;
173  void setNbHoursPerDay(double value);
174 
179  double getNbDaysPerMonth() const;
184  void setNbDaysPerMonth(double getNbDaysPerMonth);
185 
190  double getNbDaysPerWeek() const;
191 
196  void setNbDaysPerWeek(double value);
197 
202  double getNbHoursPerWeek() const;
203 
208  double getNbHoursPerMonth() const;
209 
210 private:
211  QString _title;
212  QString _noSiret;
213  QString _workspaceName;
214  QString _workspacePath;
215  QString _pdflatexPath;
216 
217  double _nbHoursPerDay;
218  double _nbDaysPerWeek;
219  double _nbDaysPerMonth;
220 
221 };
222 }
223 #endif // USER_H
QString getTitle() const
User::getTitle Return a short description of User (company) activity.
Definition: user.cpp:137
void setPdflatexPath(const QString &getPdflatexPath)
setPdflatexPath Change the pdflatex command path.
Definition: user.cpp:212
QPixmap * getImage()
User::getImage Return the compagny image.
Definition: user.cpp:157
double getNbDaysPerWeek() const
getNbDaysPerWeek The number of days per week
Definition: user.cpp:226
void setWorkspacePath(const QString &workspacePath)
User::setWorkspacePath Change the current workspace path by the new workspacePath ...
Definition: user.cpp:188
void setNbDaysPerWeek(double value)
setNbDaysPerWeek Change the number of days per week
Definition: user.cpp:231
QString getWorkspaceName() const
User::getWorkspaceName Return the name of the workspace user.
Definition: user.cpp:173
void updateFolders(void)
MainWindow::updateFolders Make directories which contain quotes and billings. Directories are the sam...
Definition: user.cpp:57
void setNoSiret(const QString &noSiret)
User::setNoSiret Modify the SIRET number (company registration number) noSiret
Definition: user.cpp:152
void setImage(QPixmap *image)
User::setImage Change the current image by the new image
Definition: user.cpp:166
void hydrat(int id=1)
User::hydrat Get data of the user who is specified by id from the database.
Definition: user.cpp:94
void setWorkspaceName(const QString &workspaceName)
User::setWorkspaceName Change the current workspace name by the new workspaceName ...
Definition: user.cpp:178
void setTitle(const QString &title)
User::setTitle Modify the user/company activities description
Definition: user.cpp:142
The User class User of it application.
Definition: user.h:20
QString getWorkspacePath() const
User::getWorkspacePath Return the path of the workspace user.
Definition: user.cpp:183
QString getNoSiret() const
User::getNoSiret Return the SIRET number (company registration number)
Definition: user.cpp:147
User()
User::User. Contruct an User.
Definition: user.cpp:8
double getNbDaysPerMonth() const
getNbDaysPerMonths The number of days per months who the user work.
Definition: user.cpp:245
QVariantHash getDataMap()
getDataMap Get all data of model with a HashMap key/value
Definition: user.cpp:30
bool operator==(const User &u)
User::operator == Re-define the operator "==" to compare if the current User is the same to the other...
Definition: user.cpp:193
void setNbDaysPerMonth(double getNbDaysPerMonth)
setNbDaysPerMonth Change the number of days per month
Definition: user.cpp:250
void setNbHoursPerDay(double value)
setNbHoursPerDay Change the number of hours per day
Definition: user.cpp:222
void commit()
User::commit Update user data in User table on the database.
Definition: user.cpp:17
double getNbHoursPerMonth() const
getNbHoursPerMonth The number of hours per months.
Definition: user.cpp:241
bool operator!=(const User &u)
User::operator == Re-define the operator "!=" to compare if the current User is differnt to the other...
Definition: user.cpp:201
The People class People.
Definition: people.h:12
double getNbHoursPerDay() const
nbHoursPerDays The number of hours per days who the user work.
Definition: user.cpp:217
double getNbHoursPerWeek() const
getNbHoursPerWeek The number of hours per weeks.
Definition: user.cpp:236
QString getPdflatexPath() const
getPdflatexPath The path of pdflatex
Definition: user.cpp:207