00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef cgiCALENDAR_H
00019 #define cgiCALENDAR_H
00020 #include <ctime>
00021 #include "cgiExtend.h"
00022 #include <map>
00023
00024
00025
00026
00027
00028
00029
00030
00031 typedef multimap< int, string > dayItems;
00032
00033 typedef enum { posTop, posBottom, posBoth } eHeaderPos;
00034
00035
00036
00037
00038
00039 class cgiCalendar: public cgiCan
00040 {
00041 protected:
00042
00043 tm m_tm;
00044 string m_formatted;
00045 string header;
00046 eHeaderPos headerPos;
00047
00048 bool fillDays ( dayItems & items );
00049 bool fillDay ( dayItems & items );
00050 bool dayAdd( void );
00051
00052 public:
00053
00054 cgiCalendar( aString & year, aString & month );
00055 virtual ~cgiCalendar();
00056
00057 inline cgiCalendar & setHeaderPos( eHeaderPos inPos )
00058 {
00059 headerPos = inPos;
00060 return *this;
00061 }
00062 bool fill( dayItems & items, const char * url = NULL );
00063 string & strYear( void );
00064 string & strMonth( void );
00065 int year ( void );
00066 int month( void );
00067
00068 };
00069
00070
00071 #endif