CUpnpContentDirectoryService Class Reference

class CUpnpContentDirectoryService : public CBase

Content Directory factory class.

?library
Since
Series60 3.1

Inherits from

  • CUpnpContentDirectoryService
Public Member Functions
~CUpnpContentDirectoryService ()
IMPORT_C void AddressChangeL ()
IMPORT_C TInetAddr GetAddress ()
IMPORT_C void GetContainerListL ( TInt , CUpnpBrowseCriteria *, TInt *, CUpnpContainerList *)
IMPORT_C CUpnpContentDirectory * GetContentDirectory ()
IMPORT_C void GetItemListL ( TInt , CUpnpBrowseCriteria *, TInt *, CUpnpItemList *)
IMPORT_C CUpnpItem * GetSharedItemL ( TInt )
IMPORT_C CUpnpContainer * GetSingleContainerL ( TInt )
IMPORT_C CUpnpContentDirectoryService * NewL (TUpnpCdSettings)
IMPORT_C CUpnpContentDirectoryService * NewL ()
IMPORT_C CUpnpContentDirectoryService * NewLC (TUpnpCdSettings)
IMPORT_C CUpnpContentDirectoryService * NewLC ()
IMPORT_C void SetDownloadDirectoryL (const TDesC &)
IMPORT_C void SetThumbnailDirectoryL (const TDesC &)
IMPORT_C void ShareItemListL ( CUpnpItemList *, TInt *)
IMPORT_C void ShareObjectL ( CUpnpObject *)
IMPORT_C void ShareReferenceL ( CUpnpItem *)
IMPORT_C void ShareReferenceListL ( CUpnpItemList *, TInt *)
IMPORT_C void UnshareContainerL ( TInt )
IMPORT_C void UnshareItemL ( TInt )
IMPORT_C void UnshareItemListL ( RArray < TInt > &, TInt *)
Private Member Functions
CUpnpContentDirectoryService ()
void CheckDbL ()
void ConstructL (TUpnpCdSettings)
void ConstructL ()
void HandleDbErrorL ( TInt )
TBool IsOnlineMode ()
void RecreateDbL ( TInt )
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()
Private Attributes
CUpnpContentDirectory * iCd
CUpnpLocalStorage * iLocalStorage
CUpnpMetadataStorage * iMetadataStorage
CUpnpCdsSender * iSender
CUpnpTransferHandler * iTransferHandler

Constructor & Destructor Documentation

CUpnpContentDirectoryService()

CUpnpContentDirectoryService ( ) [private]

C++ default constructor.

~CUpnpContentDirectoryService()

~CUpnpContentDirectoryService ( ) [virtual]

Destructor.

Member Functions Documentation

AddressChangeL()

IMPORT_C void AddressChangeL ( )

Handles address change event used only by media server engine

CheckDbL()

void CheckDbL ( ) [private]

Checks if data base is created if not tries to recover it if fails leaves

ConstructL(TUpnpCdSettings)

void ConstructL ( TUpnpCdSettings aSettings ) [private]

By default Symbian 2nd phase constructor is private.

Parameters

TUpnpCdSettings aSettings

ConstructL()

void ConstructL ( ) [private]

GetAddress()

IMPORT_C TInetAddr GetAddress ( )

Gets local inet address

Since
Series S60 3.1

GetContainerListL(TInt, CUpnpBrowseCriteria *, TInt *, CUpnpContainerList *)

IMPORT_C void GetContainerListL ( TInt aContainerId,
CUpnpBrowseCriteria * aBrowseCriteria,
TInt * aTotalMatches,
CUpnpContainerList * aContainerList
)
Gets containers information according to supported browse criteria. Note: There are only two possible values of filter:
  • "" (empty filter) only required properties will be returned

  • "*" (asterisk) all properties will be returned Information is returned to container reference. Nested containers are not returned.

Since
S60 3.1

Parameters

TInt aContainerId id of the container of which items are to be returned
CUpnpBrowseCriteria * aBrowseCriteria specifies request details, such as requestCount, startingIndes, filter
TInt * aTotalMatches total matches
CUpnpContainerList * aContainerList reference to item list where information is updated.

GetContentDirectory()

IMPORT_C CUpnpContentDirectory * GetContentDirectory ( )

Gets pointer to CUpnpContentDirectory

Since
Series S60 3.1

GetItemListL(TInt, CUpnpBrowseCriteria *, TInt *, CUpnpItemList *)

IMPORT_C void GetItemListL ( TInt aContainerId,
CUpnpBrowseCriteria * aBrowseCriteria,
TInt * aTotalMatches,
CUpnpItemList * aItemList
)
Gets items information according to supported browse criteria. Note: There are only two possible values of filter:
  • "" (empty filter) only required properties will be returned

  • "*" (asterisk) all properties will be returned Information is returned to container reference.

Since
S60 3.1

Parameters

TInt aContainerId id of the container of which items are to be returned
CUpnpBrowseCriteria * aBrowseCriteria specifies request details, such as requestCount, startingIndes, filter
TInt * aTotalMatches
CUpnpItemList * aItemList reference to item list where information is updated.

GetSharedItemL(TInt)

IMPORT_C CUpnpItem * GetSharedItemL ( TInt aItemId )

Gets shared item information from MediaServer. This operation returns all properties. Browse criteria is not used. Information is returned to item reference.

Since
S60 3.1

Parameters

TInt aItemId item id

GetSingleContainerL(TInt)

IMPORT_C CUpnpContainer * GetSingleContainerL ( TInt aContainerId )

Gets container information Nested container and items are not returned. This operation returns all properties. Browse criteria is not used.

Since
S60 3.1

Parameters

TInt aContainerId container id

HandleDbErrorL(TInt)

void HandleDbErrorL ( TInt aError ) [private]

Database corruption recovery handlers

Parameters

TInt aError

IsOnlineMode()

TBool IsOnlineMode ( ) [private]

Checks if server is in online mode

NewL(TUpnpCdSettings)

IMPORT_C CUpnpContentDirectoryService * NewL ( TUpnpCdSettings aSettings ) [static]
Two-phased constructor for creating Content Directory Service (CDS).
Since
Series60 3.1

Parameters

TUpnpCdSettings aSettings

NewL()

IMPORT_C CUpnpContentDirectoryService * NewL ( ) [static]
Two-phased constructor for offline mode.
Since
Series60 3.1

NewLC(TUpnpCdSettings)

IMPORT_C CUpnpContentDirectoryService * NewLC ( TUpnpCdSettings aSettings ) [static]
Two-phased constructor for creating Content Directory Service (CDS).
Since
Series60 3.1

Parameters

TUpnpCdSettings aSettings

NewLC()

IMPORT_C CUpnpContentDirectoryService * NewLC ( ) [static]
Two-phased constructor for offline mode.
Since
Series60 3.1

RecreateDbL(TInt)

void RecreateDbL ( TInt aError ) [private]

Recreates data base

Parameters

TInt aError

SetDownloadDirectoryL(const TDesC &)

IMPORT_C void SetDownloadDirectoryL ( const TDesC & aDownloadDir )
Sets download directory
Since
Series S60 3.1

Parameters

const TDesC & aDownloadDir this directory is going to be set as download directory

SetThumbnailDirectoryL(const TDesC &)

IMPORT_C void SetThumbnailDirectoryL ( const TDesC & aDownloadDir )
Sets thumbnail directory
Since
Series S60 3.1

Parameters

const TDesC & aDownloadDir this directory is going to be set as thumbnail directory

ShareItemListL(CUpnpItemList *, TInt *)

IMPORT_C void ShareItemListL ( CUpnpItemList * aItemList,
TInt * aExecutionStatus
)

Shares a list. Database transaction is committed each 11 objects created into database. This empirical value is hard coded in current implementation. If an execution of task fails when creating object (e.g. 776-th item on list) error code is retuned (aExecStatus), which points to last successfully created item index [1...total count] (e.g. aExecutionStatus = 770 last item in database is object number 770, if no object is cretated index = 0, if all are created index = total count).

For each created item respective input object is updated with:
  • iId

  • "res" element value

Since
S60 3.1

Parameters

CUpnpItemList * aItemList reference to item list which are to be shared.
TInt * aExecutionStatus reference pointing to the index of item list

ShareObjectL(CUpnpObject *)

IMPORT_C void ShareObjectL ( CUpnpObject * aObject )
Shares a single object item/container. After creation input object is updated with:
  • iId - generated object identifier

  • "res" element value - in offline sharing there is no possible to set ip:port information in URL. "Res" value example: http:///00000001/filename.

Since
S60 3.1

Parameters

CUpnpObject * aObject object to be shared.

ShareReferenceL(CUpnpItem *)

IMPORT_C void ShareReferenceL ( CUpnpItem * aItem )

Creates a single 'reference object' upon given refId

Since
S60 5.0 HN

Parameters

CUpnpItem * aItem reference object to be created

ShareReferenceListL(CUpnpItemList *, TInt *)

IMPORT_C void ShareReferenceListL ( CUpnpItemList * aItemList,
TInt * aExecutionStatus
)

Creates some reference items, located at specific container, pointing onto specific objects

Since
S60 5.0 HN

Parameters

CUpnpItemList * aItemList 'reference item' list which are to be shared
TInt * aExecutionStatus reference pointing to the index of item list

UnshareContainerL(TInt)

IMPORT_C void UnshareContainerL ( TInt aContainerId )

Unshares existing container from the Media Server. Container with its whole branch is removed from database regardless "restricted" property value for this container and any object in branch. Object removing is a bottom-up process. If removing of particular object fails whole operation is broken and error is returned.

Note: The iId value is not verified whether it points to a container or item. Therefore, clients must not use UnshareContainer method with ids pointing to an item or other way round.

Since
S60 3.1

Parameters

TInt aContainerId container which is unshared

UnshareItemL(TInt)

IMPORT_C void UnshareItemL ( TInt aItemId )

Unshares existing item from the Media Server. Item with specified id is removed from database regardless "restricted" property value.

Since
S60 3.1

Parameters

TInt aItemId item which is unshared

UnshareItemListL(RArray< TInt > &, TInt *)

IMPORT_C void UnshareItemListL ( RArray < TInt > & aItemList,
TInt * aExecutionStatus
)

Unshares existing items from the MediaServer. Each Item from list is removed from database regardless "restricted" property value. Database transaction is committed each 11 objects removed database. If an execution of task fails when creating object error code is retuned, which points to last successfully removed item index.

Since
S60 3.1

Parameters

RArray < TInt > & aItemList list of items which are to be unshared
TInt * aExecutionStatus reference pointing to the index of item list

Member Data Documentation

CUpnpContentDirectory * iCd

CUpnpContentDirectory * iCd [private]

CUpnpLocalStorage * iLocalStorage

CUpnpLocalStorage * iLocalStorage [private]

CUpnpMetadataStorage * iMetadataStorage

CUpnpMetadataStorage * iMetadataStorage [private]

CUpnpCdsSender * iSender

CUpnpCdsSender * iSender [private]

CUpnpTransferHandler * iTransferHandler

CUpnpTransferHandler * iTransferHandler [private]