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 &)
voidCompleted(TInt)
voidConstructL()
voidDeleteEntryCondL(const TDesC8 &)
voidDeleteEntryCondL(const TCalLocalUid &)
voidDeleteEntryCondL(const CCalEntry &)
voidDeleteEntryCondL(const CalCommon::TCalTimeRange &)
TInt DeleteEntryL(const TDesC8 &, TInt)
TInt DeleteEntryL(const TCalLocalUid &, TInt)
voidDeleteTombstoneL(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 &)
voidFetchEntriesL(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()
voidGetMultiCalendarNameListL(RArray< TPtrC > &)
voidHandleCalDbStatus(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 &)
voidProgress(TInt)
voidSetCurCalendarByColIdL(TInt)
voidSetCurCalendarByDbIdL(TCalFileId)
voidSetCurCalendarByEntryL(MESMRCalEntry &)
voidSetCurCalendarByIndex(TInt)
voidSetCurCalendarByNameL(const TDesC &)
MESMRUtilsTombsExt::TESMRUtilsDbResult StoreEntryCondL(CCalEntry &, TBool, TBool)
TInt StoreEntryL(CCalEntry &, TBool)
TInt UpdateEntryL(const CCalEntry &)
Private Member Functions
TBool CheckSpaceBelowCriticalLevelL()
voidLoadMultiCalenInfoL()
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 & aCalSessioncalendar session reference
MMRUtilsObserver & aObserverutility 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)

voidCompleted(TIntaError)[protected]

Parameters

TInt aError

ConstructL()

voidConstructL()[protected]

Constructor, second phase.

DeleteEntryCondL(const TDesC8 &)

voidDeleteEntryCondL(const TDesC8 &aUid)[protected]

Parameters

const TDesC8 & aUid

DeleteEntryCondL(const TCalLocalUid &)

voidDeleteEntryCondL(const TCalLocalUid &aLocalUid)[protected]

Parameters

const TCalLocalUid & aLocalUid

DeleteEntryCondL(const CCalEntry &)

voidDeleteEntryCondL(const CCalEntry &aCalEntry)[protected]

Parameters

const CCalEntry & aCalEntry

DeleteEntryCondL(const CalCommon::TCalTimeRange &)

voidDeleteEntryCondL(const CalCommon::TCalTimeRange &aCalTimeRange)[protected]

Parameters

const CalCommon::TCalTimeRange & aCalTimeRange

DeleteEntryL(const TDesC8 &, TInt)

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

Parameters

const TDesC8 & aUid
TInt aCalenIndex

DeleteEntryL(const TCalLocalUid &, TInt)

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

Parameters

const TCalLocalUid & aLocalUid
TInt aCalenIndex

DeleteTombstoneL(const CCalEntry &)

voidDeleteTombstoneL(const CCalEntry &aEntry)[protected]

Helper method for deleting a tombstone entry.

Parameters

const CCalEntry & aEntryentry 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 & aUidfirst identity criterion
const TCalTime & aRecurrenceIdsecond identity criterion
const CESMRCalDbBase & aDbdatabase where to look
RPointerArray< CCalEntry > & aCalEntryArraycontains all entries with same GUID
TInt & aIndextells 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 & aDbdatabase where to look
RPointerArray< CCalEntry > & aCalEntryArraycontains all entries with same GUID
TInt & aIndextells 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 & aEntryentry to be evaluated
const CCalEntry & aDbEntrycorresponding 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 &)

voidFetchEntriesL(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 > &)

voidGetMultiCalendarNameListL(RArray< TPtrC > &aCalendarNameList)[protected]

Parameters

RArray< TPtrC > & aCalendarNameList

HandleCalDbStatus(const CESMRCalDbBase *, MESMRCalDbObserver::TDbStatus)

voidHandleCalDbStatus(const CESMRCalDbBase *aNotifier,
MESMRCalDbObserver::TDbStatusaStatus
)[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 & aEntryentry to be evaluated

LoadMultiCalenInfoL()

voidLoadMultiCalenInfoL()[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)

voidProgress(TIntaPercentageCompleted)[protected]

Parameters

TInt aPercentageCompleted

SetCurCalendarByColIdL(TInt)

voidSetCurCalendarByColIdL(TIntaColId)[protected]

Parameters

TInt aColId

SetCurCalendarByDbIdL(TCalFileId)

voidSetCurCalendarByDbIdL(TCalFileIdaDbId)[protected]

Parameters

TCalFileId aDbId

SetCurCalendarByEntryL(MESMRCalEntry &)

voidSetCurCalendarByEntryL(MESMRCalEntry &aEntry)[protected]

Parameters

MESMRCalEntry & aEntry

SetCurCalendarByIndex(TInt)

voidSetCurCalendarByIndex(TIntaIndex)[protected]

Parameters

TInt aIndex

SetCurCalendarByNameL(const TDesC &)

voidSetCurCalendarByNameL(const TDesC &aCalendarName)[protected]

Parameters

const TDesC & aCalendarName

StoreEntryCondL(CCalEntry &, TBool, TBool)

MESMRUtilsTombsExt::TESMRUtilsDbResult StoreEntryCondL(CCalEntry &aCalEntry,
TBoolaResurrect,
TBoolaCheckOnly = EFalse
)[protected]

Parameters

CCalEntry & aCalEntry
TBool aResurrect
TBool aCheckOnly = EFalse

StoreEntryL(CCalEntry &, TBool)

TInt StoreEntryL(CCalEntry &aCalEntry,
TBoolaToNormalDb = 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