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 voidAddressChangeL()
IMPORT_C TInetAddrGetAddress()
IMPORT_C voidGetContainerListL(TInt, CUpnpBrowseCriteria *, TInt *, CUpnpContainerList *)
IMPORT_C CUpnpContentDirectory *GetContentDirectory()
IMPORT_C voidGetItemListL(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 voidSetDownloadDirectoryL(const TDesC &)
IMPORT_C voidSetThumbnailDirectoryL(const TDesC &)
IMPORT_C voidShareItemListL(CUpnpItemList *, TInt *)
IMPORT_C voidShareObjectL(CUpnpObject *)
IMPORT_C voidShareReferenceL(CUpnpItem *)
IMPORT_C voidShareReferenceListL(CUpnpItemList *, TInt *)
IMPORT_C voidUnshareContainerL(TInt)
IMPORT_C voidUnshareItemL(TInt)
IMPORT_C voidUnshareItemListL(RArray< TInt > &, TInt *)
Private Member Functions
CUpnpContentDirectoryService()
voidCheckDbL()
voidConstructL(TUpnpCdSettings)
voidConstructL()
voidHandleDbErrorL(TInt)
TBool IsOnlineMode()
voidRecreateDbL(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 voidAddressChangeL()

Handles address change event used only by media server engine

CheckDbL()

voidCheckDbL()[private]

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

ConstructL(TUpnpCdSettings)

voidConstructL(TUpnpCdSettingsaSettings)[private]

By default Symbian 2nd phase constructor is private.

Parameters

TUpnpCdSettings aSettings

ConstructL()

voidConstructL()[private]

GetAddress()

IMPORT_C TInetAddrGetAddress()

Gets local inet address

Since
Series S60 3.1

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

IMPORT_C voidGetContainerListL(TIntaContainerId,
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 aContainerIdid of the container of which items are to be returned
CUpnpBrowseCriteria * aBrowseCriteriaspecifies request details, such as requestCount, startingIndes, filter
TInt * aTotalMatchestotal matches
CUpnpContainerList * aContainerListreference 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 voidGetItemListL(TIntaContainerId,
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 aContainerIdid of the container of which items are to be returned
CUpnpBrowseCriteria * aBrowseCriteriaspecifies request details, such as requestCount, startingIndes, filter
TInt * aTotalMatches
CUpnpItemList * aItemListreference to item list where information is updated.

GetSharedItemL(TInt)

IMPORT_C CUpnpItem *GetSharedItemL(TIntaItemId)

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 aItemIditem id

GetSingleContainerL(TInt)

IMPORT_C CUpnpContainer *GetSingleContainerL(TIntaContainerId)

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 aContainerIdcontainer id

HandleDbErrorL(TInt)

voidHandleDbErrorL(TIntaError)[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(TUpnpCdSettingsaSettings)[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(TUpnpCdSettingsaSettings)[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)

voidRecreateDbL(TIntaError)[private]

Recreates data base

Parameters

TInt aError

SetDownloadDirectoryL(const TDesC &)

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

Parameters

const TDesC & aDownloadDirthis directory is going to be set as download directory

SetThumbnailDirectoryL(const TDesC &)

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

Parameters

const TDesC & aDownloadDirthis directory is going to be set as thumbnail directory

ShareItemListL(CUpnpItemList *, TInt *)

IMPORT_C voidShareItemListL(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 * aItemListreference to item list which are to be shared.
TInt * aExecutionStatusreference pointing to the index of item list

ShareObjectL(CUpnpObject *)

IMPORT_C voidShareObjectL(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 * aObjectobject to be shared.

ShareReferenceL(CUpnpItem *)

IMPORT_C voidShareReferenceL(CUpnpItem *aItem)

Creates a single 'reference object' upon given refId

Since
S60 5.0 HN

Parameters

CUpnpItem * aItemreference object to be created

ShareReferenceListL(CUpnpItemList *, TInt *)

IMPORT_C voidShareReferenceListL(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 * aExecutionStatusreference pointing to the index of item list

UnshareContainerL(TInt)

IMPORT_C voidUnshareContainerL(TIntaContainerId)

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 aContainerIdcontainer which is unshared

UnshareItemL(TInt)

IMPORT_C voidUnshareItemL(TIntaItemId)

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 aItemIditem which is unshared

UnshareItemListL(RArray< TInt > &, TInt *)

IMPORT_C voidUnshareItemListL(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 > & aItemListlist of items which are to be unshared
TInt * aExecutionStatusreference 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]