redmineclass_time_entry.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef REDMINECLASS_TIME_ENTRY_H
  2. #define REDMINECLASS_TIME_ENTRY_H
  3. #include <QObject>
  4. #include <QTimer>
  5. #include "redmine.h"
  6. class RedmineClass_TimeEntry : public QObject
  7. {
  8. Q_OBJECT
  9. CALLBACK_DISPATCHER ( Redmine, RedmineClass_TimeEntry, this )
  10. private:
  11. Redmine *redmine;
  12. int id;
  13. int issueId;
  14. int projectId;
  15. float hours;
  16. QString comment;
  17. QDateTime endtime;
  18. int activityId;
  19. void init();
  20. QTimer saveTimer;
  21. QNetworkReply *saveReply;
  22. signals:
  23. void on_saveSuccess();
  24. void on_saveTimeout();
  25. void on_saveFailure ( QNetworkReply *reply );
  26. private slots:
  27. void saveTimeout();
  28. public:
  29. int save();
  30. //int set(QJsonObject *json);
  31. int set ( QDateTime timeFrom, QDateTime timeTo, int projectId, int issueId, QString comment, int activityId );
  32. int setIssueId ( int issueId );
  33. int getIssueId();
  34. int setProjectId ( int projectId );
  35. int getProjectId();
  36. int setRedmine ( Redmine *redmine );
  37. void saveCallback(QNetworkReply *reply, QJsonDocument *timeEntry_doc, void *_null );
  38. RedmineClass_TimeEntry();
  39. RedmineClass_TimeEntry ( Redmine *redmine );
  40. ~RedmineClass_TimeEntry();
  41. };
  42. #endif // REDMINECLASS_TIME_ENTRY_H