From a45143269dfd724c6c4ff442b59bbe11d3e5eb55 Mon Sep 17 00:00:00 2001 From: cdfrey Date: Thu, 24 May 2007 19:14:53 +0000 Subject: [PATCH] - applied record.{h,cc} fix patch from Brian Edginton - ClassFlag - FreeBusyFlag - Clear() fixes --- ChangeLog | 4 ++++ src/record.cc | 45 +++++++++++++++++++++++++++++++++++++++++---- src/record.h | 48 +++++++++++++++++++++++++++++++++++------------- 3 files changed, 80 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41e7cef6..c17477a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ Release: version 0.8 - 2007/05/?? ------------------------------------------------------------------------------ 2007/05/24 - added ctags generation to buildgen.sh + - applied record.{h,cc} fix patch from Brian Edginton + - ClassFlag + - FreeBusyFlag + - Clear() fixes 2007/05/17 - fixed bug in Debian packaging that put util commands in /bin and /sbin instead of /usr/bin and /usr/sbin diff --git a/src/record.cc b/src/record.cc index a4378d5e..61882ccf 100644 --- a/src/record.cc +++ b/src/record.cc @@ -743,6 +743,10 @@ void Contact::Clear() MobilePhone.clear(); Pager.clear(); PIN.clear(); + Radio.clear(); + WorkPhone2.clear(); + HomePhone2.clear(); + OtherPhone.clear(); FirstName.clear(); LastName.clear(); Company.clear(); @@ -756,9 +760,23 @@ void Contact::Clear() Country.clear(); Title.clear(); PublicKey.clear(); + URL.clear(); + Prefix.clear(); + HomeAddress1.clear(); + HomeAddress2.clear(); + HomeAddress3.clear(); Notes.clear(); - - GroupLinks.clear(); + UserDefined1.clear(); + UserDefined2.clear(); + UserDefined3.clear(); + UserDefined4.clear(); + HomeCity.clear(); + HomeProvince.clear(); + HomePostalCode.clear(); + HomeCountry.clear(); + Image.clear(); + + GroupLinks.clear(); Unknowns.clear(); m_FirstNameSeen = false; @@ -1021,7 +1039,7 @@ void Message::Dump(std::ostream &os) const // calendar field codes #define CALFC_APPT_TYPE_FLAG 0x01 #define CALFC_SUBJECT 0x02 -#define CALFC_NOTES 0x03 +#define CALFC_NOTES 0x03 #define CALFC_LOCATION 0x04 #define CALFC_NOTIFICATION_TIME 0x05 #define CALFC_START_TIME 0x06 @@ -1031,6 +1049,7 @@ void Message::Dump(std::ostream &os) const #define CALFC_NOTIFICATION_DATA 0x1a #define CALFC_FREEBUSY_FLAG 0x1c #define CALFC_TIMEZONE_CODE 0x1e // only seems to show up if recurring +#define CALFC_CLASS_FLAG 0x28 // private flag from outlook #define CALFC_ALLDAYEVENT_FLAG 0xff #define CALFC_END 0xffff @@ -1041,7 +1060,6 @@ FieldLink CalendarFieldLinks[] = { { CALFC_NOTIFICATION_TIME,"Notification Time",0,0, 0, 0, &Calendar::NotificationTime }, { CALFC_START_TIME, "Start Time", 0, 0, 0, 0, &Calendar::StartTime }, { CALFC_END_TIME, "End Time", 0, 0, 0, 0, &Calendar::EndTime }, - { CALFC_FREEBUSY_FLAG, "Free/Busy", 0, 0, &Calendar::FreeBusy, 0, 0 }, { CALFC_END, "End of List",0, 0, 0, 0, 0 } }; @@ -1129,6 +1147,20 @@ const unsigned char* Calendar::ParseField(const unsigned char *begin, throw Error("Calendar::ParseField: not enough data in time zone code field"); } return begin; + + case CALFC_FREEBUSY_FLAG: + FreeBusyFlag = (FreeBusyFlagType)field->u.raw[0]; + if( FreeBusyFlag > OutOfOffice ) { + throw Error("Calendar::ParseField: FreeBusyFlag out of range" ); + } + return begin; + + case CALFC_CLASS_FLAG: + ClassFlag = (ClassFlagType)field->u.raw[0]; + if( ClassFlag > Private ) { + throw Error("Calendar::ParseField: ClassFlag out of range" ); + } + return begin; } // if still not handled, add to the Unknowns list @@ -1359,6 +1391,8 @@ void Calendar::Dump(std::ostream &os) const "Thu", "Fri", "Sat" }; static const char *MonthNames[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + static const char *ClassTypes[] = { "Public", "Confidential", "Private" }; + static const char *FreeBusy[] = { "Free", "Tentative", "Busy", "Out of Office" }; // FIXME - need a "check all data" function that make sure that all // recurrence data is within range. Then call that before using @@ -1367,6 +1401,8 @@ void Calendar::Dump(std::ostream &os) const os << "Calendar entry: 0x" << setbase(16) << RecordId << " (" << (unsigned int)RecType << ")\n"; os << " All Day Event: " << (AllDayEvent ? "yes" : "no") << "\n"; + os << " Class: " << ClassTypes[ClassFlag] << "\n"; + os << " Free/Busy: " << FreeBusy[FreeBusyFlag] << "\n"; // cycle through the type table for( const FieldLink *b = CalendarFieldLinks; @@ -1456,6 +1492,7 @@ void Calendar::Dump(std::ostream &os) const } + /////////////////////////////////////////////////////////////////////////////// // ServiceBookConfig class diff --git a/src/record.h b/src/record.h index 00729dce..d629c4c8 100644 --- a/src/record.h +++ b/src/record.h @@ -362,11 +362,43 @@ public: std::string Subject; std::string Notes; std::string Location; - std::string FreeBusy; time_t NotificationTime; time_t StartTime; time_t EndTime; + /// + /// Free Busy Flag + /// + /// This lists the available settings found in the device. + /// This list is based on information from MS Outlook 2007 + /// (Free ==0 and Busy == 2) + /// This is FBTYPE in RFC2445 and is defined as + /// FREE, BUSY, BUSY-UNAVAILABLE and BUSY-TENTATIVE + /// + enum FreeBusyFlagType { + Free = 0, + Tentative, + Busy, + OutOfOffice + }; + FreeBusyFlagType FreeBusyFlag; + + /// + /// Class Flag + /// + /// This is also called classification in Evolution and it + /// is the equivilant of public or private in outlook + /// Private is set to 0x2 in Outlook + /// RFC2445 CLASS is PUBLIC, PRIVATE, CONFIDENTIAL + /// + enum ClassFlagType { + Public = 0, + Confidential, + Private + }; + + ClassFlagType ClassFlag; + /// /// Recurring data /// @@ -389,18 +421,8 @@ public: //< set: WeekDays }; - /// - /// Free Busy Flag - /// - /// This lists the available settings found in the device. - /// - enum FreeBusyFlag { - Free = 0, - Tentative, - Busy, - OutOfOffice - }; - + + bool Recurring; RecurringCodeType RecurringType; unsigned short Interval; // must be >= 1 -- 2.11.4.GIT