blueZync

Synchronize Bluetooth phone with Thunderbird

Develpers' detailed documentation for the mozilla-sync plugin for OpenSync. A part of blueZync.

MozillaCalendar Class Reference

#include <mozilla-calendar.h>

Collaboration diagram for MozillaCalendar:

List of all members.


Public Member Functions

gboolean AddEvent (const char *szICS, char **pSzNewKey, char **pSzNewHash, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Add an event to a Mozilla calendar.
gboolean Close (char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Finalize the use of a mozilla calendar.
gboolean DeleteEvent (const char *szKey, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Delete an event in a Mozilla calendar.
gboolean Init (char *szCalendarId, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Initialize the use of a mozilla calendar.
gboolean LogInfo (char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Log contents of calendar - just for debugging and fun.
gboolean ModifyEvent (const char *szKey, const char *szICS, char **pSzNewHash, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Modify an event in a Mozilla calendar.
Iterator


const char * CurrentEventHash ()
 Return hash (last_modified) of current iterator event.
const char * CurrentEventUid ()
 Return Uid of current iterator event.
char * CurrentICS (char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Get ICS for current iterator event.
gboolean CurrentKeyHashTitle (char **pSzKey, char **pSzHash, char **pSzTitle, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Get key, hash, and title of current iterator event.
gboolean EventDone ()
 Check if iteration is complete.
gboolean EventFirst (char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Initialize iterator to first event.
gboolean EventNext (char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Advance iterator to next evant.

Private Attributes

nsCOMPtr< mozIStorageConnection > myConn
PRBool myHasMoreData
nsCOMPtr< mozIStorageStatement > myStatement
char * mySzCalendarId

Member Function Documentation

gboolean MozillaCalendar::AddEvent ( const char *  szXML,
char **  pSzNewKey,
char **  pSzNewHash,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Add an event to a Mozilla calendar.

Parameters:
szXML (IN) String according to xmlformat-event
pSzNewKey (OUT) The generated uuid of the event
pSzNewHash (OUT) The hash value (modified time) of the event
pSzError (OUT) Pointer to string, into which we shall write an error message if we return false
pLogFunction (OUT)Function used to log information text
Returns:
TRUE on success; FALSE on error

References EventAdd(), myConn, and mySzCalendarId.

Referenced by mozilla_sync_commit_calendar_change().

Here is the call graph for this function:

gboolean MozillaCalendar::Close ( char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Finalize the use of a mozilla calendar.

Todo:
clean up after mozilla calendar use
Parameters:
pSzError Pointer to string, into which we shall write an error message if we return false
pLogFunction Function used to log information text
Returns:
TRUE on success; FALSE on error

Referenced by main().

const char * MozillaCalendar::CurrentEventHash (  ) 

Return hash (last_modified) of current iterator event.

Returns:
hash (last_modified) of current iterator event

References myStatement.

const char * MozillaCalendar::CurrentEventUid (  ) 

Return Uid of current iterator event.

Returns:
Uid of current iterator event

References myStatement.

char * MozillaCalendar::CurrentICS ( char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Get ICS for current iterator event.

Parameters:
pSzError (OUT) Pointer to string, into which we shall write an error message if we return false
pLogFunction (OUT)Function used to log information text
Returns:
vcalendar representation of current iterator event

References EventICS(), myConn, myStatement, and mySzCalendarId.

Referenced by mozilla_sync_report_calendar_changes_to_hash().

Here is the call graph for this function:

gboolean MozillaCalendar::CurrentKeyHashTitle ( char **  pSzKey,
char **  pSzHash,
char **  pSzTitle,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Get key, hash, and title of current iterator event.

Parameters:
pSzKey (OUT) The uuid of the event
pSzHash (OUT) The hash value (modified_time) of the event
pSzTitle (OUT) The title of the event
pSzError (OUT) Pointer to string, into which we shall write an error message if we return false
pLogFunction (OUT)Function used to log information text
Returns:
TRUE on success; FALSE on error

References myStatement.

Referenced by mozilla_sync_report_calendar_changes_to_hash().

gboolean MozillaCalendar::DeleteEvent ( const char *  szKey,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Delete an event in a Mozilla calendar.

Parameters:
szKey (IN) The uuid of the event
pSzError (OUT) Pointer to string, into which we shall write an error message if we return false
pLogFunction (OUT)Function used to log information text
Returns:
TRUE on success; FALSE on error

References GFREE, LOG, MOZ_ERROR_CHECK_FALSE, and myConn.

Referenced by mozilla_sync_commit_calendar_change().

gboolean MozillaCalendar::EventDone (  ) 

Check if iteration is complete.

Returns:
TRUE on if all cards have been iterated; FALSE if more cards are left

References myHasMoreData.

Referenced by mozilla_sync_report_calendar_changes_to_hash().

gboolean MozillaCalendar::EventFirst ( char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Initialize iterator to first event.

Parameters:
pSzError Pointer to string, into which we shall write an error message if we return false
pLogFunction Function used to log information text
Returns:
TRUE on success; FALSE on error

References ERROR, MOZ_ERROR_CHECK_FALSE, myConn, myHasMoreData, myStatement, and mySzCalendarId.

Referenced by mozilla_sync_report_calendar_changes_to_hash().

gboolean MozillaCalendar::EventNext ( char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Advance iterator to next evant.

Parameters:
pSzError Pointer to string, into which we shall write an error message if we return false
pLogFunction Function used to log information text
Returns:
TRUE on success; FALSE on error

References ERROR, MOZ_ERROR_CHECK_FALSE, myHasMoreData, and myStatement.

Referenced by mozilla_sync_report_calendar_changes_to_hash().

gboolean MozillaCalendar::Init ( char *  szCalendarID,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Initialize the use of a mozilla calendar.

Parameters:
szCalendarID Identifier of the mozilla calendar
pSzError Pointer to string, into which we shall write an error message if we return false
pLogFunction Function used to log information text
Returns:
TRUE on success; FALSE on error

References ERROR, LOG, MOZ_ERROR_CHECK_FALSE, myConn, and mySzCalendarId.

Referenced by main(), and mozilla_sync_connect().

gboolean MozillaCalendar::LogInfo ( char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Log contents of calendar - just for debugging and fun.

Parameters:
pSzError Pointer to string, into which we shall write an error message if we return false
pLogFunction Function used to log information text
Returns:
TRUE on success; FALSE on error

References LOG, MOZ_ERROR_CHECK_FALSE, and myConn.

Referenced by main().

gboolean MozillaCalendar::ModifyEvent ( const char *  szKey,
const char *  szXML,
char **  pSzNewHash,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Modify an event in a Mozilla calendar.

Parameters:
szXML (IN) String according to xmlformat-event
szKey (IN) The uuid of the event
pSzNewHash (OUT) The hash value (modified time) of the event
pSzError (OUT) Pointer to string, into which we shall write an error message if we return false
pLogFunction (OUT)Function used to log information text
Returns:
TRUE on success; FALSE on error

References EventModify(), myConn, and mySzCalendarId.

Referenced by mozilla_sync_commit_calendar_change().

Here is the call graph for this function:


Member Data Documentation

nsCOMPtr<mozIStorageConnection> MozillaCalendar::myConn [private]

Referenced by EventDone(), EventFirst(), and EventNext().


The documentation for this class was generated from the following files: