CESMRCalDbMgr Class Reference

class CESMRCalDbMgr : public CBase

Manages two databases: normal Agenda db and tombstone db, and handles command logic related to these databases. This class is also responsible for collecting both database status information and async command progress, and to notify aObserver.

esmrdb.lib

Inherits from

Public Member Functions
~CESMRCalDbMgr ()
IMPORT_C CESMRCalDbMgr * NewL (CCalSession &, MMRUtilsObserver &)
Protected Member Functions
CESMRCalDbMgr (CCalSession &, MMRUtilsObserver &)
CCalSession & CalSession ()
MESMRUtilsTombsExt::TESMRUtilsDbResult CheckEntryCondL (const CCalEntry &)
void Completed ( TInt )
void ConstructL ()
void DeleteEntryCondL (const TDesC8 &)
void DeleteEntryCondL (const TCalLocalUid &)
void DeleteEntryCondL (const CCalEntry &)
void DeleteEntryCondL (const CalCommon::TCalTimeRange &)
TInt DeleteEntryL (const TDesC8 &, TInt )
TInt DeleteEntryL (const TCalLocalUid &, TInt )
void DeleteTombstoneL (const CCalEntry &)
TBool EntryExistsInDbL (const TDesC8 &, const TCalTime &, const CESMRCalDbBase &, RPointerArray < CCalEntry > &, TInt &)
TBool EntryExistsInDbL (const CCalEntry &, const CESMRCalDbBase &, RPointerArray < CCalEntry > &, TInt &)
CCalEntryView * EntryView ()
CCalEntryView * EntryViewL (const CCalEntry &)
MESMRUtilsTombsExt::TESMRUtilsDbResult EvaluateExistingEntryL (const CCalEntry &, const CCalEntry &)
MESMRUtilsTombsExt::TESMRUtilsDbResult EvaluateNewEntryL (const CCalEntry &)
void FetchEntriesL ( RPointerArray < CCalEntry > &, const CalCommon::TCalTimeRange &)
CCalEntry * FetchEntryL (const TDesC8 &, const TCalTime &)
CCalInstance * FindInstanceL (const CCalEntry &)
TRgb GetCalendarColorByEntryL ( MESMRCalEntry &)
TRgb GetCalendarColorByNameL (const TDesC &)
TPtrC GetCalendarNameByEntryL ( MESMRCalEntry &)
TInt GetCurCalendarColIdL ()
TRgb GetCurCalendarColor ()
TInt GetCurCalendarIndex ()
void GetMultiCalendarNameListL ( RArray < TPtrC > &)
void HandleCalDbStatus (const CESMRCalDbBase *, MESMRCalDbObserver::TDbStatus )
CCalInstanceView * InstanceViewL (const CCalEntry &)
TBool IsValidNewModL (const CCalEntry &)
RPointerArray < CCalInstanceView > NormalDbAllCalenInstanceView ()
CCalEntryView * NormalDbEntryView ()
CCalInstanceView * NormalDbInstanceView ()
TBool NotifyProgress ()
TBool OriginatingExistInDbL (const CCalEntry &)
void Progress ( TInt )
void SetCurCalendarByColIdL ( TInt )
void SetCurCalendarByDbIdL ( TCalFileId )
void SetCurCalendarByEntryL ( MESMRCalEntry &)
void SetCurCalendarByIndex ( TInt )
void SetCurCalendarByNameL (const TDesC &)
MESMRUtilsTombsExt::TESMRUtilsDbResult StoreEntryCondL ( CCalEntry &, TBool , TBool )
TInt StoreEntryL ( CCalEntry &, TBool )
TInt UpdateEntryL (const CCalEntry &)
Private Member Functions
TBool CheckSpaceBelowCriticalLevelL ()
void LoadMultiCalenInfoL ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Protected Attributes
RPointerArray < CCalEntryView > iCalEntryViewArray
RPointerArray < CCalInstanceView > iCalInstanceViewArray
CCalSession & iCalSession
RPointerArray < CCalSession > iCalSessionArray
RPointerArray < CCalCalendarInfo > iCalendarInfoArray
CESMREntryCmdIteratorAO * iCmdIterator
TInt iCurrentAsyncOp
CESMRCalDbBase * iNormalDb
MMRUtilsObserver & iObserver
Private Attributes
TInt iCurCalenIndex

Constructor & Destructor Documentation

CESMRCalDbMgr(CCalSession &, MMRUtilsObserver &)

CESMRCalDbMgr ( CCalSession & aCalSession,
MMRUtilsObserver & aObserver
) [protected]

C++ default constructor.

Parameters

CCalSession & aCalSession calendar session reference
MMRUtilsObserver & aObserver utility observer reference

~CESMRCalDbMgr()

~CESMRCalDbMgr ( )

Destructor.

Member Functions Documentation

CalSession()

CCalSession & CalSession ( ) [protected]

CheckEntryCondL(const CCalEntry &)

MESMRUtilsTombsExt::TESMRUtilsDbResult CheckEntryCondL ( const CCalEntry & aCalEntry ) [protected]

Parameters

const CCalEntry & aCalEntry

CheckSpaceBelowCriticalLevelL()

TBool CheckSpaceBelowCriticalLevelL ( ) [private]

Completed(TInt)

void Completed ( TInt aError ) [protected]

Parameters

TInt aError

ConstructL()

void ConstructL ( ) [protected]

Constructor, second phase.

DeleteEntryCondL(const TDesC8 &)

void DeleteEntryCondL ( const TDesC8 & aUid ) [protected]

Parameters

const TDesC8 & aUid

DeleteEntryCondL(const TCalLocalUid &)

void DeleteEntryCondL ( const TCalLocalUid & aLocalUid ) [protected]

Parameters

const TCalLocalUid & aLocalUid

DeleteEntryCondL(const CCalEntry &)

void DeleteEntryCondL ( const CCalEntry & aCalEntry ) [protected]

Parameters

const CCalEntry & aCalEntry

DeleteEntryCondL(const CalCommon::TCalTimeRange &)

void DeleteEntryCondL ( const CalCommon::TCalTimeRange & aCalTimeRange ) [protected]

Parameters

const CalCommon::TCalTimeRange & aCalTimeRange

DeleteEntryL(const TDesC8 &, TInt)

TInt DeleteEntryL ( const TDesC8 & aUid,
TInt aCalenIndex
) [protected]

Parameters

const TDesC8 & aUid
TInt aCalenIndex

DeleteEntryL(const TCalLocalUid &, TInt)

TInt DeleteEntryL ( const TCalLocalUid & aLocalUid,
TInt aCalenIndex
) [protected]

Parameters

const TCalLocalUid & aLocalUid
TInt aCalenIndex

DeleteTombstoneL(const CCalEntry &)

void DeleteTombstoneL ( const CCalEntry & aEntry ) [protected]

Helper method for deleting a tombstone entry.

Parameters

const CCalEntry & aEntry entry to be deleted

EntryExistsInDbL(const TDesC8 &, const TCalTime &, const CESMRCalDbBase &, RPointerArray< CCalEntry > &, TInt &)

TBool EntryExistsInDbL ( const TDesC8 & aUid,
const TCalTime & aRecurrenceId,
const CESMRCalDbBase & aDb,
RPointerArray < CCalEntry > & aCalEntryArray,
TInt & aIndex
) const [protected]

Tests whether entry with same GUID and RECURRENCE-ID exists in aDb. If yes, then aIndex will tell it's position in aCalEntryArray which contains all entries with the same GUID.

Parameters

const TDesC8 & aUid first identity criterion
const TCalTime & aRecurrenceId second identity criterion
const CESMRCalDbBase & aDb database where to look
RPointerArray < CCalEntry > & aCalEntryArray contains all entries with same GUID
TInt & aIndex tells position of entry, if method returned ETrue

EntryExistsInDbL(const CCalEntry &, const CESMRCalDbBase &, RPointerArray< CCalEntry > &, TInt &)

TBool EntryExistsInDbL ( const CCalEntry & aEntry,
const CESMRCalDbBase & aDb,
RPointerArray < CCalEntry > & aCalEntryArray,
TInt & aIndex
) const [protected]

Tests whether entry with same GUID and RECURRENCE-ID exists in aDb. If yes, then aIndex will tell it's position in aCalEntryArray which contains all entries with the same GUID.

Parameters

const CCalEntry & aEntry
const CESMRCalDbBase & aDb database where to look
RPointerArray < CCalEntry > & aCalEntryArray contains all entries with same GUID
TInt & aIndex tells position of entry, if method returned ETrue

EntryView()

CCalEntryView * EntryView ( ) [protected]

EntryViewL(const CCalEntry &)

CCalEntryView * EntryViewL ( const CCalEntry & aCalEntry ) [protected]

Parameters

const CCalEntry & aCalEntry

EvaluateExistingEntryL(const CCalEntry &, const CCalEntry &)

MESMRUtilsTombsExt::TESMRUtilsDbResult EvaluateExistingEntryL ( const CCalEntry & aEntry,
const CCalEntry & aDbEntry
) const [protected]

Helper method for evaluating validity and status of entry in relation to an another entry which exists in a database.

Parameters

const CCalEntry & aEntry entry to be evaluated
const CCalEntry & aDbEntry corresponding entry existing in a database

EvaluateNewEntryL(const CCalEntry &)

MESMRUtilsTombsExt::TESMRUtilsDbResult EvaluateNewEntryL ( const CCalEntry & aEntry ) const [protected]

Helper method for evaluating validity and status of a new entry. entry to be evaluated

Parameters

const CCalEntry & aEntry

FetchEntriesL(RPointerArray< CCalEntry > &, const CalCommon::TCalTimeRange &)

void FetchEntriesL ( RPointerArray < CCalEntry > & aCalEntryArray,
const CalCommon::TCalTimeRange & aTimeRange
) [protected]

Parameters

RPointerArray < CCalEntry > & aCalEntryArray
const CalCommon::TCalTimeRange & aTimeRange

FetchEntryL(const TDesC8 &, const TCalTime &)

CCalEntry * FetchEntryL ( const TDesC8 & aUid,
const TCalTime & aRecurrenceId
) [protected]

Parameters

const TDesC8 & aUid
const TCalTime & aRecurrenceId

FindInstanceL(const CCalEntry &)

CCalInstance * FindInstanceL ( const CCalEntry & aEntry ) [protected]

Parameters

const CCalEntry & aEntry

GetCalendarColorByEntryL(MESMRCalEntry &)

TRgb GetCalendarColorByEntryL ( MESMRCalEntry & aEntry ) [protected]

Parameters

MESMRCalEntry & aEntry

GetCalendarColorByNameL(const TDesC &)

TRgb GetCalendarColorByNameL ( const TDesC & aCalendarName ) [protected]

Parameters

const TDesC & aCalendarName

GetCalendarNameByEntryL(MESMRCalEntry &)

TPtrC GetCalendarNameByEntryL ( MESMRCalEntry & aEntry ) [protected]

Parameters

MESMRCalEntry & aEntry

GetCurCalendarColIdL()

TInt GetCurCalendarColIdL ( ) [protected]

GetCurCalendarColor()

TRgb GetCurCalendarColor ( ) [protected]

GetCurCalendarIndex()

TInt GetCurCalendarIndex ( ) [protected]

GetMultiCalendarNameListL(RArray< TPtrC > &)

void GetMultiCalendarNameListL ( RArray < TPtrC > & aCalendarNameList ) [protected]

Parameters

RArray < TPtrC > & aCalendarNameList

HandleCalDbStatus(const CESMRCalDbBase *, MESMRCalDbObserver::TDbStatus)

void HandleCalDbStatus ( const CESMRCalDbBase * aNotifier,
MESMRCalDbObserver::TDbStatus aStatus
) [protected]

Parameters

const CESMRCalDbBase * aNotifier
MESMRCalDbObserver::TDbStatus aStatus

InstanceViewL(const CCalEntry &)

CCalInstanceView * InstanceViewL ( const CCalEntry & aCalEntry ) [protected]

Parameters

const CCalEntry & aCalEntry

IsValidNewModL(const CCalEntry &)

TBool IsValidNewModL ( const CCalEntry & aEntry ) const [protected]

Helper method which checks if given child entry would be a valid new modifying entry, i.e. if it has a recurrence id which matches to an existing instance.

Parameters

const CCalEntry & aEntry entry to be evaluated

LoadMultiCalenInfoL()

void LoadMultiCalenInfoL ( ) [private]

Load multi calendar info to dbmgr

NewL(CCalSession &, MMRUtilsObserver &)

IMPORT_C CESMRCalDbMgr * NewL ( CCalSession & aCalSession,
MMRUtilsObserver & aObserver
) [static]

Symbian two-phased constructor. calendar session reference utility observer reference

Parameters

CCalSession & aCalSession
MMRUtilsObserver & aObserver

NormalDbAllCalenInstanceView()

RPointerArray < CCalInstanceView > NormalDbAllCalenInstanceView ( ) [protected]

NormalDbEntryView()

CCalEntryView * NormalDbEntryView ( ) [protected]

NormalDbInstanceView()

CCalInstanceView * NormalDbInstanceView ( ) [protected]

NotifyProgress()

TBool NotifyProgress ( ) [protected]

OriginatingExistInDbL(const CCalEntry &)

TBool OriginatingExistInDbL ( const CCalEntry & aModEntry ) [protected]

Evaluates if corresponding originating entry exists in database.

Parameters

const CCalEntry & aModEntry

Progress(TInt)

void Progress ( TInt aPercentageCompleted ) [protected]

Parameters

TInt aPercentageCompleted

SetCurCalendarByColIdL(TInt)

void SetCurCalendarByColIdL ( TInt aColId ) [protected]

Parameters

TInt aColId

SetCurCalendarByDbIdL(TCalFileId)

void SetCurCalendarByDbIdL ( TCalFileId aDbId ) [protected]

Parameters

TCalFileId aDbId

SetCurCalendarByEntryL(MESMRCalEntry &)

void SetCurCalendarByEntryL ( MESMRCalEntry & aEntry ) [protected]

Parameters

MESMRCalEntry & aEntry

SetCurCalendarByIndex(TInt)

void SetCurCalendarByIndex ( TInt aIndex ) [protected]

Parameters

TInt aIndex

SetCurCalendarByNameL(const TDesC &)

void SetCurCalendarByNameL ( const TDesC & aCalendarName ) [protected]

Parameters

const TDesC & aCalendarName

StoreEntryCondL(CCalEntry &, TBool, TBool)

MESMRUtilsTombsExt::TESMRUtilsDbResult StoreEntryCondL ( CCalEntry & aCalEntry,
TBool aResurrect,
TBool aCheckOnly = EFalse
) [protected]

Parameters

CCalEntry & aCalEntry
TBool aResurrect
TBool aCheckOnly = EFalse

StoreEntryL(CCalEntry &, TBool)

TInt StoreEntryL ( CCalEntry & aCalEntry,
TBool aToNormalDb = ETrue
) [protected]

Parameters

CCalEntry & aCalEntry
TBool aToNormalDb = ETrue

UpdateEntryL(const CCalEntry &)

TInt UpdateEntryL ( const CCalEntry & aCalEntry ) [protected]

Parameters

const CCalEntry & aCalEntry

Member Data Documentation

RPointerArray< CCalEntryView > iCalEntryViewArray

RPointerArray < CCalEntryView > iCalEntryViewArray [protected]

CCalEntryView array, support multi calendar Own.

RPointerArray< CCalInstanceView > iCalInstanceViewArray

RPointerArray < CCalInstanceView > iCalInstanceViewArray [protected]

CCalInstanceView array, support multi calendar Own.

CCalSession & iCalSession

CCalSession & iCalSession [protected]

Calendar session reference Not own.

RPointerArray< CCalSession > iCalSessionArray

RPointerArray < CCalSession > iCalSessionArray [protected]

Calendar session array, support multi calendar Own.

RPointerArray< CCalCalendarInfo > iCalendarInfoArray

RPointerArray < CCalCalendarInfo > iCalendarInfoArray [protected]

CCalCalendarInfo array, support multi calendar Own.

CESMREntryCmdIteratorAO * iCmdIterator

CESMREntryCmdIteratorAO * iCmdIterator [protected]

Handles asynchronous operation iteration Own.

TInt iCurCalenIndex

TInt iCurCalenIndex [private]

TInt iCurrentAsyncOp

TInt iCurrentAsyncOp [protected]

Currently ongoing asynchronous utils operation

CESMRCalDbBase * iNormalDb

CESMRCalDbBase * iNormalDb [protected]

Normal agenda database Own.

MMRUtilsObserver & iObserver

MMRUtilsObserver & iObserver [protected]

Reference to cal db observer