blueZync

Synchronize Bluetooth phone with Thunderbird

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

ThunderbirdAddressbook Class Reference

#include <thunderbird-addressbook.h>

Collaboration diagram for ThunderbirdAddressbook:

List of all members.


Public Member Functions

gboolean AddCard (ThunderbirdCard *pCard, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Add an address card to the address book.
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 thunderbird address book.
gboolean DeleteCard (const char *szKey, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Delete address card with given key.
gboolean Init (const char *szThunderbirdAddressbookFile, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Initialize the use of a thunderbird address book.
gboolean LogInfo (char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Log contents of address book - just for debugging and fun.
gboolean ModifyCardFromXML (const char *szKey, const char *szXML, char **pSzHash, char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Modify address card with given key to correspond to given XML.
Iterator


ThunderbirdCardCardCurrent ()
 Return current card in the iterator.
gboolean CardDone ()
 Check if iteration is complete.
gboolean CardFirst (char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Initialize iterator to first card.
gboolean CardNext (char **pSzError, void(*pLogFunction)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...))
 Advance iterator to next card.

Public Attributes

nsCOMPtr< nsIAbDirectory > myAbDirectory
nsCOMPtr< nsIAddrDatabase > myAddrDatabase
nsCOMPtr< nsIAddressBook > myAddressBook
nsCOMPtr< nsIEnumerator > myCards

Private Attributes

ThunderbirdCardmyPCurrentCard
const char * mySzURI

Member Function Documentation

gboolean ThunderbirdAddressbook::AddCard ( ThunderbirdCard pCard,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Add an address card to the address book.

Parameters:
pCard The card we shall add
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 MOZ_ERROR_CHECK_FALSE, myAbDirectory, ThunderbirdCard::myCard, and mySzURI.

Referenced by mozilla_sync_commit_addressbook_change().

ThunderbirdCard * ThunderbirdAddressbook::CardCurrent (  ) 

Return current card in the iterator.

Returns:
The current card in the iterator

References myPCurrentCard.

Referenced by LogInfo(), and mozilla_sync_report_addressbook_changes_to_hash().

gboolean ThunderbirdAddressbook::CardDone (  ) 

Check if iteration is complete.

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

References myPCurrentCard.

Referenced by LogInfo(), and mozilla_sync_report_addressbook_changes_to_hash().

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

Initialize iterator to first card.

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, myAbDirectory, myCards, and myPCurrentCard.

Referenced by LogInfo(), and mozilla_sync_report_addressbook_changes_to_hash().

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

Advance iterator to next card.

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 MOZ_ERROR_CHECK_FALSE, myCards, and myPCurrentCard.

Referenced by LogInfo(), and mozilla_sync_report_addressbook_changes_to_hash().

gboolean ThunderbirdAddressbook::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 thunderbird address book.

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 MOZ_ERROR_CHECK, myAbDirectory, myAddrDatabase, myAddressBook, and myCards.

Referenced by main(), and mozilla_sync_disconnect().

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

Delete address card with given key.

Parameters:
szKey The key of the card we want to modify
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, myAbDirectory, myAddrDatabase, mySzURI, and OPEN_SYNC_KEY.

Referenced by mozilla_sync_commit_addressbook_change().

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

Initialize the use of a thunderbird address book.

Parameters:
szThunderbirdAddressbookFile The name of the file, relative to the profile directory which should already be setup by XPCOM
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 GFREE, LOG, MOZ_ERROR_CHECK_FALSE, myAbDirectory, myAddrDatabase, myAddressBook, and mySzURI.

Referenced by main(), and mozilla_sync_connect().

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

Log contents of address book - 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 CardCurrent(), CardDone(), CardFirst(), CardNext(), ThunderbirdCard::GetHash(), ThunderbirdCard::GetKey(), ThunderbirdCard::GetLongName(), ThunderbirdCard::GetXML(), LOG, MOZ_ERROR_CHECK_FALSE, myAbDirectory, and myAddrDatabase.

Referenced by main().

Here is the call graph for this function:

gboolean ThunderbirdAddressbook::ModifyCardFromXML ( const char *  szKey,
const char *  szXML,
char **  pSzHash,
char **  pSzError,
void(*)(int level, bool sensitive, const char *szFile, int iLine, const char *szFunc, const char *szFormat,...)  pLogFunction 
)

Modify address card with given key to correspond to given XML.

Parameters:
szKey The key of the card we want to modify
szXML string according to xmlformat-card
pSzHash new hash value
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, ThunderbirdCard::GetHash(), LOG, MOZ_ERROR_CHECK_FALSE, myAbDirectory, myAddrDatabase, mySzURI, OPEN_SYNC_KEY, and ThunderbirdCard::ResetFromXML().

Referenced by mozilla_sync_commit_addressbook_change().

Here is the call graph for this function:


Member Data Documentation

nsCOMPtr<nsIAddressBook> ThunderbirdAddressbook::myAddressBook

Referenced by Close(), and Init().

nsCOMPtr<nsIEnumerator> ThunderbirdAddressbook::myCards

Referenced by CardFirst(), CardNext(), and Close().


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