CCPLiwMap Class Reference

class CCPLiwMap : public CLiwMap

Base Map class for Publisher Registry and Content

cputils.dll
Since
S60 v5.0

Inherits from

Public Member Functions
~CCPLiwMap ()
TBool ActivateActionSupport ()
TBool AtL ( TInt , TDes8 &)
TInt Count ()
void ExternalizeL ( RWriteStream &)
TBool FindL (const TDesC8 &, TLiwVariant &)
IMPORT_C CLiwDefaultList * GetActionTriggersLC ()
TBool GetActivateInfo ()
IMPORT_C TBool GetProperty (const TDesC8 &, TInt32 &)
IMPORT_C TBool GetPropertyL (const TDesC8 &, RBuf &)
IMPORT_C TBool GetPropertyL (const TDesC8 &, RBuf8 &)
void InsertL (const TDesC8 &, const TLiwVariant &)
IMPORT_C void IsValidForActionL ()
void IsValidForAddL ()
void IsValidForDeleteL ()
void IsValidForGetListL ()
IMPORT_C void IsValidForNotificationL ()
IMPORT_C CCPLiwMap * NewL ( RDesReadStream &)
IMPORT_C CCPLiwMap * NewL (const CLiwGenericParamList &)
IMPORT_C CCPLiwMap * NewL (const CLiwMap &)
IMPORT_C HBufC8 * PackForServerLC ()
void Remove (const TDesC8 &)
IMPORT_C void Reset ()
IMPORT_C void SetSecurityL (const RMessage2 &)
TInt Size ()
Protected Member Functions
CCPLiwMap ()
TInt32 AddL ( RSqlDatabase , CLiwDefaultList *)
TInt32 AddToDbL ( RSqlDatabase , CLiwDefaultList *)
void AppendFilterL ( RBuf &, TUint &)
void AppendGetListFilterL ( RBuf &, TUint &)
void AppendRemoveFilterL ( RBuf &, TUint &)
void AppendSortL ( RBuf &, const TCPSortOrder &)
void BindBinaryL ( RSqlStatement &, TInt , const TDesC8 &)
void BindInt64L ( RSqlStatement &, TInt , TInt64 )
void BindIntL ( RSqlStatement &, TInt , TInt )
void BindTextL ( RSqlStatement &, TInt , const TDesC &)
void BindValueL (const RBuf &, RSqlStatement &)
void CheckIdentifiersL ()
TInt ColumnIndexL ( RSqlStatement &, const TDesC &)
void ConstructGetListSelectL ( RBuf &, TBool )
void ConstructL ()
void ConstructRemoveSelectL ( RBuf &, TBool )
void ConstructSelectIdL ( RBuf &)
void ExtractParamL (const TLiwGenericParam &)
void FetchIdL ( RSqlDatabase , const TDesC &, TInt32 &)
void FetchIdsL ( TInt32 , const TDesC &, CLiwDefaultMap *, RSqlDatabase )
void FillChangeInfoMapL ( RSqlStatement &, CLiwDefaultMap *)
TUint GetFilterL ()
void GetIdsOfRemovedEntriesL ( RSqlDatabase , const TDesC &, CLiwDefaultList *)
TUint GetListL ( RSqlDatabase , CLiwGenericParamList *, RArray < TInt32 > &)
TUint GetListL ( RSqlDatabase , const TDesC &, CLiwGenericParamList *, RArray < TInt32 > &)
TCPSortOrder GetSortL ()
TBool IsContentIdL ()
TBool IsContentTypeL ()
TBool IsFlag ()
TBool IsGetListAllL ( TUint )
TBool IsId ()
void IsProperOperationL (const TLiwVariant &)
TBool IsPropertyValidL (const TDesC8 &)
TBool IsPublisherNameL ()
TBool IsTriggerL ()
TBool IsTypePublisherL (const TLiwVariant &)
void PrepareStmtforAddL ( RSqlDatabase , RSqlStatement &, const TDesC &)
TBool PropertyExists (const TDesC8 &)
void RemoveAllAttributeL ( TUint &)
void RemoveL ( RSqlDatabase , CLiwDefaultList *)
void RemoveL ( RSqlDatabase , const TDesC &)
void SaveQueryResultsIdsL ( RSqlStatement &, CLiwDefaultList *)
void SaveQueryResultsL ( RSqlStatement &, CLiwGenericParamList &, RArray < TInt32 > &)
void SetL (const CLiwGenericParamList &)
void SetL (const CLiwMap &)
void UpdateL ( RSqlDatabase , TInt32 , CLiwDefaultList *)
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()
CLiwContainer::CLiwContainer()
CLiwContainer::Close()
CLiwContainer::DecRef()
CLiwContainer::IncRef()
CLiwContainer::PushL()
CLiwContainer::~CLiwContainer()
CLiwMap::operator==(const CLiwMap &)const
Protected Member Enumerations
enum TCPProperties { EPublisher  = 1, EContentType  = 2, EContentId  = 4, EFlag  = 8 }
enum TCPSortOrder { ECPRecent  = 1, ECPPublisher  = 2, ECPContent  = 4, ECPContentId  = 8 }
Protected Attributes
CLiwGenericParamList * iMap
const CCPSecurityPolicy * iPolicy

Constructor & Destructor Documentation

CCPLiwMap()

CCPLiwMap ( ) [protected]

C++ default constructor.

~CCPLiwMap()

~CCPLiwMap ( ) [virtual]

Destructor.

Member Functions Documentation

ActivateActionSupport()

TBool ActivateActionSupport ( ) const [pure virtual]

AddL(RSqlDatabase, CLiwDefaultList *)

TInt32 AddL ( RSqlDatabase aSqlDb,
CLiwDefaultList * aNotificationList = 0
) const [protected, pure virtual]

Adds to database current content

Parameters

RSqlDatabase aSqlDb handle to database
CLiwDefaultList * aNotificationList = 0 list of notifications to fill in when something was actually changed in dataabse

AddToDbL(RSqlDatabase, CLiwDefaultList *)

TInt32 AddToDbL ( RSqlDatabase aSqlDb,
CLiwDefaultList * aNotificationList = 0
) const [protected, pure virtual]

Performs actuall add operation

Parameters

RSqlDatabase aSqlDb handle to database
CLiwDefaultList * aNotificationList = 0 list of notifications to fill in when something was actually changed in dataabse

AppendFilterL(RBuf &, TUint &)

void AppendFilterL ( RBuf & aQuery,
TUint & aFilter
) const [protected, virtual]

Appends filter as strings to SQL query according to aFilter

Parameters

RBuf & aQuery SQL query
TUint & aFilter as enum

AppendGetListFilterL(RBuf &, TUint &)

void AppendGetListFilterL ( RBuf & aQuery,
TUint & aFilter
) const [protected]

Appends GetList filter as strings to SQL query according to aFilter

Parameters

RBuf & aQuery SQL query
TUint & aFilter as enum

AppendRemoveFilterL(RBuf &, TUint &)

void AppendRemoveFilterL ( RBuf & aQuery,
TUint & aFilter
) const [protected]

Appends Remove filter as strings to SQL query according to aFilter

Parameters

RBuf & aQuery SQL query
TUint & aFilter as enum

AppendSortL(RBuf &, const TCPSortOrder &)

void AppendSortL ( RBuf & aQuery,
const TCPSortOrder & aSort
) const [protected, pure virtual]

Appends sorting criteria as strings to SQL query according to aSort

Parameters

RBuf & aQuery SQL query
const TCPSortOrder & aSort sort filter as TInt

AtL(TInt, TDes8 &)

TBool AtL ( TInt aIndex,
TDes8 & aFndKey
) const [virtual]

Returns the key stored at a specified index.

Parameters

TInt aIndex the index of the key to be found
TDes8 & aFndKey the key found at the passed index

BindBinaryL(RSqlStatement &, TInt, const TDesC8 &)

void BindBinaryL ( RSqlStatement & aStmt,
TInt aParameterIndex,
const TDesC8 & aParameterText
) const [protected]

Leaves if aParameterIndex is negative-error value or in case of binding error.

Parameters

RSqlStatement & aStmt
TInt aParameterIndex
const TDesC8 & aParameterText

BindInt64L(RSqlStatement &, TInt, TInt64)

void BindInt64L ( RSqlStatement & aStmt,
TInt aParameterIndex,
TInt64 aParameterValue
) const [protected]

Leaves if aParameterIndex is negative-error value or in case of binding error.

Parameters

RSqlStatement & aStmt
TInt aParameterIndex
TInt64 aParameterValue

BindIntL(RSqlStatement &, TInt, TInt)

void BindIntL ( RSqlStatement & aStmt,
TInt aParameterIndex,
TInt aParameterValue
) const [protected]

Leaves if aParameterIndex is negative-error value or in case of binding error.

Parameters

RSqlStatement & aStmt
TInt aParameterIndex
TInt aParameterValue

BindTextL(RSqlStatement &, TInt, const TDesC &)

void BindTextL ( RSqlStatement & aStmt,
TInt aParameterIndex,
const TDesC & aParameterText
) const [protected]

Leaves if aParameterIndex is negative-error value or in case of binding error.

Parameters

RSqlStatement & aStmt
TInt aParameterIndex
const TDesC & aParameterText

BindValueL(const RBuf &, RSqlStatement &)

void BindValueL ( const RBuf & aQuery,
RSqlStatement & aStmt
) const [protected]

Binds value to query

Parameters

const RBuf & aQuery SQL query
RSqlStatement & aStmt

CheckIdentifiersL()

void CheckIdentifiersL ( ) const [protected]

Leaves if publisher, content type od content_id is not descriptor type.

ColumnIndexL(RSqlStatement &, const TDesC &)

TInt ColumnIndexL ( RSqlStatement & aStmt,
const TDesC & aColumnName
) const [protected]

Leaves if column index return value is negative.

Parameters

RSqlStatement & aStmt
const TDesC & aColumnName

ConstructGetListSelectL(RBuf &, TBool)

void ConstructGetListSelectL ( RBuf & aQuery,
TBool aGet = ETrue
) const [protected]

Contructs SQL query to select entries for GetList

Parameters

RBuf & aQuery SQL query
TBool aGet = ETrue

ConstructL()

void ConstructL ( ) [protected]

Perform the second phase construction of a CCPLiwMap object.

ConstructRemoveSelectL(RBuf &, TBool)

void ConstructRemoveSelectL ( RBuf & aQuery,
TBool aGet = ETrue
) const [protected]

Contructs SQL query to select entries for Remove

Parameters

RBuf & aQuery SQL query
TBool aGet = ETrue

ConstructSelectIdL(RBuf &)

void ConstructSelectIdL ( RBuf & aQuery ) const [protected]

Contructs SQL query to select entry

Parameters

RBuf & aQuery SQL query

Count()

TInt Count ( ) const [virtual]

Returns the number of key-value pair stored in the map collection.

ExternalizeL(RWriteStream &)

void ExternalizeL ( RWriteStream & aOutputStream ) const [virtual]

The container managed data values can be serialized to an output stream.

Parameters

RWriteStream & aOutputStream the output stream to which the data will be streamed

ExtractParamL(const TLiwGenericParam &)

void ExtractParamL ( const TLiwGenericParam & aParam ) [protected]

Extracts a param and appends it to the internal list

Parameters

const TLiwGenericParam & aParam a param to extract

FetchIdL(RSqlDatabase, const TDesC &, TInt32 &)

void FetchIdL ( RSqlDatabase aSqlDb,
const TDesC & aQuery,
TInt32 & aId
) const [protected]

Fetches Id from database

Parameters

RSqlDatabase aSqlDb handle to database
const TDesC & aQuery SQL query
TInt32 & aId id entry from database

FetchIdsL(TInt32, const TDesC &, CLiwDefaultMap *, RSqlDatabase)

void FetchIdsL ( TInt32 aId,
const TDesC & aQuery,
CLiwDefaultMap * aMap,
RSqlDatabase aSqlDb
) const [protected]

Fetches Ids (Publisher, ContentType, ContentId) from database

Parameters

TInt32 aId id entry in database
const TDesC & aQuery SQL query
CLiwDefaultMap * aMap map to insert Ids
RSqlDatabase aSqlDb handle to database

FillChangeInfoMapL(RSqlStatement &, CLiwDefaultMap *)

void FillChangeInfoMapL ( RSqlStatement & aStmt,
CLiwDefaultMap * aMap
) const [protected, virtual]

Fills change info map with proper values aStmt

Parameters

RSqlStatement & aStmt handle to SQL statement
CLiwDefaultMap * aMap

FindL(const TDesC8 &, TLiwVariant &)

TBool FindL ( const TDesC8 & aKey,
TLiwVariant & aValue
) const [virtual]

Finds a value stored in the map collection based on the key.

Parameters

const TDesC8 & aKey the key to be searched
TLiwVariant & aValue

GetActionTriggersLC()

IMPORT_C CLiwDefaultList * GetActionTriggersLC ( ) const

Return list of action triggers from main map Note that these are not triggers from action map

GetActivateInfo()

TBool GetActivateInfo ( ) const [pure virtual]

GetFilterL()

TUint GetFilterL ( ) const [protected]

Check Get properties

GetIdsOfRemovedEntriesL(RSqlDatabase, const TDesC &, CLiwDefaultList *)

void GetIdsOfRemovedEntriesL ( RSqlDatabase aSqlDb,
const TDesC & aQuery,
CLiwDefaultList * aList
) const [protected]

Gets Ids (Id, Publisher, ContentType, ContentId) of removed entries from database

Parameters

RSqlDatabase aSqlDb handle to database
const TDesC & aQuery SQL query
CLiwDefaultList * aList List with ids

GetListL(RSqlDatabase, CLiwGenericParamList *, RArray< TInt32 > &)

TUint GetListL ( RSqlDatabase aSqlDb,
CLiwGenericParamList * aList,
RArray < TInt32 > & aItemsToDelete
) const [protected, pure virtual]

Fetches entries from database

Parameters

RSqlDatabase aSqlDb handle to database
CLiwGenericParamList * aList target list for enntries
RArray < TInt32 > & aItemsToDelete ids of entries for removal - they were found to be expired

GetListL(RSqlDatabase, const TDesC &, CLiwGenericParamList *, RArray< TInt32 > &)

TUint GetListL ( RSqlDatabase aSqlDb,
const TDesC & aQuery,
CLiwGenericParamList * aList,
RArray < TInt32 > & aItemsToDelete
) const [protected]

Fetches entries from database

Parameters

RSqlDatabase aSqlDb handle to database
const TDesC & aQuery aQuery SQL query
CLiwGenericParamList * aList target list for enntries
RArray < TInt32 > & aItemsToDelete ids of entries for removal - they were found to be expired

GetProperty(const TDesC8 &, TInt32 &)

IMPORT_C TBool GetProperty ( const TDesC8 & aProperty,
TInt32 & aResult
) const

Fetches value for property(key) from internal map

Parameters

const TDesC8 & aProperty name of the property ( key )
TInt32 & aResult target integer for fetching operation

GetPropertyL(const TDesC8 &, RBuf &)

IMPORT_C TBool GetPropertyL ( const TDesC8 & aProperty,
RBuf & aResult
) const

Fetches value for property(key) from internal map

Parameters

const TDesC8 & aProperty name of the property ( key )
RBuf & aResult target descriptor for fetching operation

GetPropertyL(const TDesC8 &, RBuf8 &)

IMPORT_C TBool GetPropertyL ( const TDesC8 & aProperty,
RBuf8 & aResult
) const

Fetches value for property(key) from internal map

Parameters

const TDesC8 & aProperty name of the property ( key )
RBuf8 & aResult target binary for fetching operation

GetSortL()

TCPSortOrder GetSortL ( ) const [protected]

Check and return sort order

InsertL(const TDesC8 &, const TLiwVariant &)

void InsertL ( const TDesC8 & aKey,
const TLiwVariant & aValue
) [virtual]

Inserts a key-value pair element to the map collection. If the specified key already exists, it will be removed from the collection and the new key-value pair will be added to the map.

Parameters

const TDesC8 & aKey the key to be stored
const TLiwVariant & aValue the value associated with the key to be stored

IsContentIdL()

TBool IsContentIdL ( ) const [protected]

Check if ContentId is set

IsContentTypeL()

TBool IsContentTypeL ( ) const [protected]

Check if ContentType is set

IsFlag()

TBool IsFlag ( ) const [protected]

Check if Flag is present

IsGetListAllL(TUint)

TBool IsGetListAllL ( TUint aFilter ) const [protected]

Checks if GetList for all items should be done

Parameters

TUint aFilter flag describing which ids are set

IsId()

TBool IsId ( ) const [protected]

Checks if Id property is present in internal map

IsProperOperationL(const TLiwVariant &)

void IsProperOperationL ( const TLiwVariant & aValue ) const [protected]

Checks if operation value is proper

Parameters

const TLiwVariant & aValue contains operation value

IsPropertyValidL(const TDesC8 &)

TBool IsPropertyValidL ( const TDesC8 & aProperty ) const [protected]

Returns ETrue if a property has valid name and type

Parameters

const TDesC8 & aProperty property name

IsPublisherNameL()

TBool IsPublisherNameL ( ) const [protected]

Check if Publisher name is set

IsTriggerL()

TBool IsTriggerL ( ) const [protected]

Check if ActionTrigger is set

IsTypePublisherL(const TLiwVariant &)

TBool IsTypePublisherL ( const TLiwVariant & aVariant ) [protected, static]

Checks a type a map

Parameters

const TLiwVariant & aVariant variant containing a map type

IsValidForActionL()

IMPORT_C void IsValidForActionL ( ) const

Leaves when Execute Action operation is not possible due to missing of some parameter

IsValidForAddL()

void IsValidForAddL ( ) const [virtual]

Leaves when Add data operation is not possible due to missing of some parameter

IsValidForDeleteL()

void IsValidForDeleteL ( ) const [pure virtual]

Check if IDs are valid for Delete operation

IsValidForGetListL()

void IsValidForGetListL ( ) const [pure virtual]

Check if IDs are valid for GetList operation

IsValidForNotificationL()

IMPORT_C void IsValidForNotificationL ( ) const

Leaves when RequestNotification operation is not possible due to missing of some parameter

NewL(RDesReadStream &)

IMPORT_C CCPLiwMap * NewL ( RDesReadStream & aStream ) [static]

Two-phased constructor.

Parameters

RDesReadStream & aStream

NewL(const CLiwGenericParamList &)

IMPORT_C CCPLiwMap * NewL ( const CLiwGenericParamList & aList ) [static]

Two-phased constructor.

Parameters

const CLiwGenericParamList & aList

NewL(const CLiwMap &)

IMPORT_C CCPLiwMap * NewL ( const CLiwMap & aMap ) [static]

Two-phased constructor.

Parameters

const CLiwMap & aMap

PackForServerLC()

IMPORT_C HBufC8 * PackForServerLC ( ) const

Used by client to serialize this object

PrepareStmtforAddL(RSqlDatabase, RSqlStatement &, const TDesC &)

void PrepareStmtforAddL ( RSqlDatabase aSqlDb,
RSqlStatement & aStmt,
const TDesC & aQuery
) const [protected, virtual]

Prepares SQL query for Add operation

Parameters

RSqlDatabase aSqlDb handle to database
RSqlStatement & aStmt handle to SQL statement
const TDesC & aQuery SQL query

PropertyExists(const TDesC8 &)

TBool PropertyExists ( const TDesC8 & aProperty ) const [protected]

Checks if property(key) is present in internal map

Parameters

const TDesC8 & aProperty

Remove(const TDesC8 &)

void Remove ( const TDesC8 & aKey ) [virtual]

Removes a key from the map collection.

Parameters

const TDesC8 & aKey the key to be removed from the map

RemoveAllAttributeL(TUint &)

void RemoveAllAttributeL ( TUint & aFilter ) const [protected]

Removes attributes with "All" value from map

Parameters

TUint & aFilter filter bit will be reset if any attribute == "all"

RemoveL(RSqlDatabase, CLiwDefaultList *)

void RemoveL ( RSqlDatabase aSqlDb,
CLiwDefaultList * aNotificationList = 0
) const [protected, pure virtual]

Removes entries from database

Parameters

RSqlDatabase aSqlDb handle to database
CLiwDefaultList * aNotificationList = 0 list of notifications to fill in when something was actually changed in dataabse

RemoveL(RSqlDatabase, const TDesC &)

void RemoveL ( RSqlDatabase aSqlDb,
const TDesC & aQuery
) const [protected]

Removes entries from database

Parameters

RSqlDatabase aSqlDb handle to database
const TDesC & aQuery SQL query

Reset()

IMPORT_C void Reset ( ) const

Reset map

SaveQueryResultsIdsL(RSqlStatement &, CLiwDefaultList *)

void SaveQueryResultsIdsL ( RSqlStatement & aStmt,
CLiwDefaultList * aList
) const [protected]

Saves Ids (Id, Publisher, ContentType, ContentId) from database

Parameters

RSqlStatement & aStmt
CLiwDefaultList * aList List with ids

SaveQueryResultsL(RSqlStatement &, CLiwGenericParamList &, RArray< TInt32 > &)

void SaveQueryResultsL ( RSqlStatement & aStmt,
CLiwGenericParamList & aList,
RArray < TInt32 > & aItemsToDelete
) const [protected, pure virtual]

Saves results from query to SQLite Server

Parameters

RSqlStatement & aStmt handle to SQL statement
CLiwGenericParamList & aList target list for enntries
RArray < TInt32 > & aItemsToDelete ids of entries for removal - they were found to be expired

SetL(const CLiwGenericParamList &)

void SetL ( const CLiwGenericParamList & aInParamList ) [protected]

Sets all parameters according to provided list

Parameters

const CLiwGenericParamList & aInParamList

SetL(const CLiwMap &)

void SetL ( const CLiwMap & aMap ) [protected]

Sets all parameters according to provided list

Parameters

const CLiwMap & aMap map with parameters

SetSecurityL(const RMessage2 &)

IMPORT_C void SetSecurityL ( const RMessage2 & aMessage )

Setter for security policy

Parameters

const RMessage2 & aMessage

Size()

TInt Size ( ) const [virtual]

Returns the size of the collection. The size is calculated based on the total numer of key-value elements and the size of each pair in the collection

UpdateL(RSqlDatabase, TInt32, CLiwDefaultList *)

void UpdateL ( RSqlDatabase aSqlDb,
TInt32 aId,
CLiwDefaultList * aNotificationList = 0
) const [protected, pure virtual]

Updates entry in database

Parameters

RSqlDatabase aSqlDb handle to database
TInt32 aId
CLiwDefaultList * aNotificationList = 0 list of notifications to fill in when something was actually changed in dataabse

Member Enumerations Documentation

Enum TCPProperties

Enum defining the properties of filter.

Enumerators

EPublisher = 1
EContentType = 2
EContentId = 4
EFlag = 8

Enum TCPSortOrder

Enum defining the sort ordering.

Enumerators

ECPRecent = 1
ECPPublisher = 2
ECPContent = 4
ECPContentId = 8

Member Data Documentation

CLiwGenericParamList * iMap

CLiwGenericParamList * iMap [protected]

const CCPSecurityPolicy * iPolicy

const CCPSecurityPolicy * iPolicy [protected]