00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef INCL_DATE_FILTER
00037 #define INCL_DATE_FILTER
00038
00043 #include "base/fscapi.h"
00044 #include "base/util/ArrayList.h"
00045 #include "base/util/StringBuffer.h"
00046 #include "outlook/ClientItem.h"
00047
00048
00063 class DateFilter {
00064
00065 public:
00066
00076 typedef enum FilterDirection {
00077 DIR_NONE = 0,
00078 DIR_OUT = 1,
00079 DIR_IN = 2,
00080 DIR_INOUT = 3
00081 } FilterDirection;
00082
00089 typedef enum RelativeLowerDate {
00090 NONE = 0,
00091 LAST_WEEK = 1,
00092 LAST_2_WEEKS = 2,
00093 LAST_MONTH = 3,
00094 LAST_3_MONTHS = 4,
00095 LAST_6_MONTHS = 5,
00096 ALL = 6
00097 } RelativeLowerDate;
00098
00099
00100 private:
00101
00104 FilterDirection direction;
00105
00107 DATE lowerDate;
00108
00110 DATE upperDate;
00111
00113 RelativeLowerDate relativeLowerDate;
00114
00116 bool usingRelativeLowerDate;
00117
00125 DATE subtractMonths(const DATE inputTime, const unsigned int numMonths);
00126
00127
00128 public:
00129
00130 DateFilter();
00131 ~DateFilter();
00132
00133 void setDirection(const FilterDirection dir) { direction = dir; }
00134 void setLowerDate(const DATE lower);
00135 void setUpperDate(const DATE upper) { upperDate = upper; }
00136
00138 _declspec(dllexport) void setRelativeLowerDate(const RelativeLowerDate value);
00139
00140
00141 FilterDirection getDirection() { return direction; }
00142 DATE getLowerDate() { return lowerDate; }
00143 DATE getUpperDate() { return upperDate; }
00144 _declspec(dllexport) RelativeLowerDate getRelativeLowerDate() { return relativeLowerDate; }
00145
00146
00147
00148
00150 bool isEnabled();
00151
00166 bool execute(ClientItem* cItem);
00167
00180 bool execute(_AppointmentItemPtr& app);
00181
00185 void updateNow();
00186
00187 };
00188
00191 #endif