BPS C++ API  2.24.4
bpsschedule.h
Go to the documentation of this file.
1 
4 #ifndef BPSSCHEDULE_H
5 #define BPSSCHEDULE_H
6 
7 #include "bpscore_global.h"
8 #include <QDate>
9 #include <QDateTime>
10 #include <QMetaType>
11 #include <QVariant>
12 
13 class BpsDatastore;
14 
19 {
21 
22 public:
27 
32  BpsSchedule(const BpsSchedule& aOther);
33 
37  BpsSchedule(const QString& aCronText);
38 
40  virtual ~BpsSchedule();
42 
47  void setCronText(const QString& aCronText);
48 
63  void loadExceptionDays(BpsDatastore* aDatastore, const QVariant& aPartnerKey = QVariant());
64 
78  void loadExceptionDays(BpsDatastore* aDatastore, const QVariantList& aPartnerKeys);
79 
84 
88  QString cronText() const;
89 
94  bool minute(int aMinute) const;
95 
100  bool hour(int aHour) const;
101 
106  bool dayOfMonth(int aDayOfMonth) const;
107 
112  bool weekday(int aWeekday) const;
113 
118  bool weekday(const QString& aWeekday) const;
119 
124  bool month(int aMonth) const;
125 
130  bool month(const QString& aMonth) const;
131 
137  void setMinute(int aMinute, bool aEnable);
138 
144  void setHour(int aHour, bool aEnable);
145 
151  void setDayOfMonth(int aDayOfMonth, bool aEnable);
152 
158  void setWeekday(int aWeekday, bool aEnable);
159 
165  void setWeekday(const QString& aWeekday, bool aEnable);
166 
172  void setMonth(int aMonth, bool aEnable);
173 
179  void setMonth(const QString& aMonth, bool aEnable);
180 
186  bool isDateIncluded(const QDate& aDate) const;
187 
193  QDate nextDate(const QDate& aStart) const;
194 
200  QDate previousDate(const QDate& aStart) const;
201 
207  bool isDateTimeIncluded(const QDateTime& aDateTime) const;
208 
214  QDateTime nextDateTime(const QDateTime& aStart) const;
215 
221  QDateTime previousDateTime(const QDateTime& aStart) const;
222 
226  QTime firstTime() const;
227 
231  QTime lastTime() const;
232 
238  QDateTime firstDateTime(const QDate& aDate) const;
239 
245  QDateTime lastDateTime(const QDate& aDate) const;
246 
253 
254 };
255 
256 Q_DECLARE_METATYPE(BpsSchedule)
257 
258 #endif // BPSSCHEDULE_H
Public include file for BPS CORE library macros.
#define BPSCORE_EXPORT
Declare class to be an import from the shared library.
Definition: bpscore_global.h:22
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
BPS datastore class.
Definition: bpsdatastore.h:61
Schedule object processing.
Definition: bpsschedule.h:19
void setHour(int aHour, bool aEnable)
Change the enable state of a hour.
QTime firstTime() const
QDate nextDate(const QDate &aStart) const
Find the next schedule date after the given start date.
QString cronText() const
void setMonth(int aMonth, bool aEnable)
Change the enable state of a month.
BpsSchedule & operator=(const BpsSchedule &aOther)
Assign from other schedule.
void loadExceptionDays(BpsDatastore *aDatastore, const QVariantList &aPartnerKeys)
Load exception days from datastore.
QDateTime firstDateTime(const QDate &aDate) const
Find the first date/time for a given date.
void setDayOfMonth(int aDayOfMonth, bool aEnable)
Change the enable state of a day of month.
bool month(int aMonth) const
void setWeekday(const QString &aWeekday, bool aEnable)
Change the enable state of a weekday.
bool month(const QString &aMonth) const
QDate previousDate(const QDate &aStart) const
Find the previous schedule date before the given start date.
bool isDateIncluded(const QDate &aDate) const
Check if a date is included in the schedule.
bool minute(int aMinute) const
QDateTime lastDateTime(const QDate &aDate) const
Find the last date/time for a given date.
void loadExceptionDays(BpsDatastore *aDatastore, const QVariant &aPartnerKey=QVariant())
Load exception days from datastore.
void setCronText(const QString &aCronText)
Set schedule by a CRON text.
QTime lastTime() const
QDateTime nextDateTime(const QDateTime &aStart) const
Find the next schedule date/time after the given start date/time.
void clearExceptionDays()
Clear the list of exception days.
BpsSchedule()
Default constructor.
bool hour(int aHour) const
bool weekday(int aWeekday) const
BpsSchedule(const QString &aCronText)
bool isDateTimeIncluded(const QDateTime &aDateTime) const
Check if a date/time is included in the schedule.
void setWeekday(int aWeekday, bool aEnable)
Change the enable state of a weekday.
BpsSchedule(const BpsSchedule &aOther)
Copy constructor.
bool dayOfMonth(int aDayOfMonth) const
bool weekday(const QString &aWeekday) const
void setMonth(const QString &aMonth, bool aEnable)
Change the enable state of a month.
QDateTime previousDateTime(const QDateTime &aStart) const
Find the previous schedule date/time before the given start date/time.
void setMinute(int aMinute, bool aEnable)
Change the enable state of a minute.