00001 00006 #ifndef __EVENT_ 00007 #define __EVENT_ 00008 00009 #include <time.h> 00010 #include <list> 00011 00012 using namespace std; 00013 00015 #define EVENT_TITLE_SIZE 128 00016 00017 #define EVENT_LOCATION_SIZE 64 00018 00019 #define EVENT_STREET_SIZE 64 00020 00021 #define EVENT_CITY_SIZE 32 00022 00023 #define EVENT_STATE_SIZE 3 00024 00025 #define EVENT_ZIP_SIZE 11 00026 00027 #define EVENT_URL_SIZE 1024 00028 00029 #define EVENT_DESCRIPTION_SIZE 1024 00030 00032 #define EVENT_COORDINATE_UNKNOWN -500 00033 00034 #define EVENT_TIME_UNKNOWN -1 00035 00040 class Event 00041 { 00042 public: 00043 00045 Event(); 00047 Event(const Event &otherEvent); 00049 ~Event(); 00050 00059 00060 int operator== (const Event ¶m); 00061 00067 00068 bool isRealEvent(); 00069 00071 typedef enum EventCategory { 00073 CONCERT, 00075 PERFORMANCE, 00077 SPORTS, 00079 COMEDY, 00081 MUSEUM, 00083 OTHER_UNKNOWN 00084 } EventCategory; 00085 00087 00090 char* getEventTitle(); 00091 00093 00096 char* getLocationTitle(); 00097 00099 00102 char* getStreet(); 00103 00105 00108 char* getState(); 00109 00110 00112 00115 char* getCity(); 00116 00118 00121 char* getZip(); 00122 00124 00127 double getLatitude(); 00128 00130 00133 double getLongitude(); 00134 00136 00139 time_t getStartTime(); 00140 00141 00142 00144 00148 bool isTimeSpecified(); 00149 00151 00154 time_t getEndTime(); 00155 00156 00157 00159 00163 list<EventCategory> getCategories(); 00164 00169 list<EventCategory> getCategories_c() const; 00170 00172 00175 char* getUrl(); 00176 00178 00181 char* getDescription(); 00182 00184 00188 bool setEventTitle(char* title); 00189 00191 00195 bool setLocationTitle(char* location); 00196 00197 00199 00203 bool setStreet(char* street); 00204 00206 00210 bool setState (char* state); 00211 00213 00217 bool setCity(char* city); 00218 00220 00224 bool setZip(char* zip); 00225 00227 00231 bool setLatitude (double latitude); 00232 00234 00238 bool setLongitude (double longitude); 00239 00241 00245 bool setStartTime (time_t startTime); 00246 00248 00253 void setTimeSpecified (bool timeSpecified); 00254 00256 00260 bool setEndTime (time_t endTime); 00261 00263 00266 void setStartTimeSpecified(bool isSpecified); 00267 00269 00272 void setEndTimeSpecified(bool isSpecified); 00273 00275 00282 bool isStartTimeSpecified(); 00283 00285 00292 bool isEndTimeSpecified(); 00293 00299 bool addCategory(EventCategory cat); 00300 00302 00306 bool setUrl (char* url); 00307 00309 00313 bool setDescription (char* description); 00314 00316 00320 void mergeEvent(const Event &otherEvent); 00321 00323 void printEvent(); 00324 00325 private: 00326 char event_Title[EVENT_TITLE_SIZE]; 00327 char event_Location[EVENT_LOCATION_SIZE]; 00328 char event_Street[EVENT_STREET_SIZE]; 00329 char event_State[EVENT_STATE_SIZE]; 00330 char event_City[EVENT_CITY_SIZE]; 00331 char event_Zip[EVENT_ZIP_SIZE]; 00332 char event_Url[EVENT_URL_SIZE]; 00333 char event_Description[EVENT_DESCRIPTION_SIZE]; 00334 double event_Latitude; 00335 double event_Longitude; 00336 time_t event_StartTime; 00337 time_t event_EndTime; 00338 list<EventCategory> event_Categories; 00339 00340 int coordinates_Known; 00341 bool starttime_Known; 00342 bool endtime_Known; 00343 bool starttime_Specified; 00344 bool endtime_Specified; 00345 }; 00346 00347 #endif /* ifndef __EVENT_ */