00001 /* 00002 cgiCalendar.h 00003 00004 Common Gateway Interface Class Definitions. 00005 Extended classes for cgi support 00006 -- generic calendar container 00007 copyright (c) 2002 00008 00009 Open Connections LLC, Dalton, Ga. 00010 00011 David McCombs davidmc@newcottage.com 00012 00013 Nuclear Core Class Library 00014 00015 freely re-usable, redistributable. 00016 00017 */ 00018 #ifndef cgiCALENDAR_H 00019 #define cgiCALENDAR_H 00020 #include <ctime> 00021 #include "cgiExtend.h" 00022 #include <map> 00023 00024 /* 00025 dayItems 00026 -------- 00027 A multimap of day of month integer value and itmes to put on the particular day. 00028 This used used to fill the calendar with items on particular days. 00029 00030 */ 00031 typedef multimap< int, string > dayItems; 00032 typedef multimap< string, string > timeItems; 00033 00034 typedef enum { posTop, posBottom, posBoth } eHeaderPos; 00035 /* 00036 A generic html calendar 00037 00038 */ 00039 00040 class cgiCalendar: public cgiCan 00041 { 00042 protected: 00043 00044 tm m_tm; 00045 string m_formatted; 00046 string header; 00047 eHeaderPos headerPos; 00048 string weekDayHeader; 00049 bool isDayMode; 00050 00051 bool fillDays ( dayItems & items ); 00052 bool fillDay ( dayItems & items ); 00053 00054 bool fillHalfHours ( timeItems & items ); 00055 bool fillHalfHour ( timeItems & items, string & key); 00056 00057 bool dayAdd( void ); 00058 00059 public: 00061 aString dayTemplate; 00064 aString timeTemplate; 00065 // the day view starting hour - default: 6 00066 int iHourStart; 00067 // the day view ending hour - default: 22 00068 int iHourEnd; 00069 00070 string addedCriteria; 00071 00072 cgiCalendar( aString & year, aString & month, aString day = "" ); 00073 virtual ~cgiCalendar(); 00074 00075 inline cgiCalendar & setHeaderPos( eHeaderPos inPos ) 00076 { 00077 headerPos = inPos; 00078 return *this; 00079 } 00080 bool fill( dayItems & items, const char * url = NULL ); 00081 bool fill( timeItems & items, const char * url = NULL ); 00082 string & strYear( void ); 00083 string & strMonth( void ); 00084 int year ( void ); 00085 int month( void ); 00086 void WeekDayHeader( string newWeekDayHeader ); 00087 }; 00088 00089 00090 #endif
1.5.5