CUpnpFileSharing Class Reference

class CUpnpFileSharing : public CBase

Interface class for UPnP File Sharing

MediaServerClient.lib
Since
S60 v3.1

Inherits from

Constructor & Destructor Documentation

CUpnpFileSharing()

CUpnpFileSharing()[private]

C++ default constructor.

~CUpnpFileSharing()

~CUpnpFileSharing()[virtual]

Destructor.

Member Functions Documentation

ConstructL()

voidConstructL()[private]

By default Symbian 2nd phase constructor is private.

DropAllContentL(TRequestStatus &)

IMPORT_C voidDropAllContentL(TRequestStatus &aStatus)

Database Clearing function Stops mediaserver, delete database file and starts mediaserver

Since
S60 3.1

Parameters

TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

GetSharedContainerL(TInt, CUpnpContainer &, TRequestStatus &)

IMPORT_C voidGetSharedContainerL(TIntaItemId,
CUpnpContainer &aContainer,
TRequestStatus &aStatus
)

Gets shared container information from Media Server. Nested container and items are not returned. This operation returns all properties. Browse criteria is not used. Information is returned to container reference.

Since
S60 3.1

Parameters

TInt aItemId
CUpnpContainer & aContainerreference to container where information is updated.
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

GetSharedContainerListL(TInt, CUpnpBrowseCriteria &, CUpnpContainerList &, TInt &, TRequestStatus &)

IMPORT_C voidGetSharedContainerListL(TIntaContainerId,
CUpnpBrowseCriteria &aBrowseCriteria,
CUpnpContainerList &aItem,
TInt &aTotalMatches,
TRequestStatus &aStatus
)
Gets shared containers information from Media Server 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 container 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
CUpnpContainerList & aItem
TInt & aTotalMatches
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

GetSharedItemL(TInt, CUpnpItem &, TRequestStatus &)

IMPORT_C voidGetSharedItemL(TIntaItemId,
CUpnpItem &aItem,
TRequestStatus &aStatus
)

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
CUpnpItem & aItemreference to item where information is updated.
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

GetSharedItemListL(TInt, CUpnpBrowseCriteria &, CUpnpItemList &, TInt &, TRequestStatus &)

IMPORT_C voidGetSharedItemListL(TIntaContainerId,
CUpnpBrowseCriteria &aBrowseCriteria,
CUpnpItemList &aItemList,
TInt &aTotalMatches,
TRequestStatus &aStatus
)
Gets shared items information from Media Server 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
CUpnpItemList & aItemListreference to item list where information is updated.
TInt & aTotalMatches
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

MediaServerClient()

IMPORT_C RUpnpMediaServerClient &MediaServerClient()

Returns reference to media server client

Since
S60 5.0 HN

NewL()

IMPORT_C CUpnpFileSharing *NewL()[static]

Two-phased constructor.

ShareContainerL(const TDesC8 &, CUpnpContainer &, TRequestStatus &)

IMPORT_C voidShareContainerL(const TDesC8 &aParentId,
CUpnpContainer &aContainer,
TRequestStatus &aStatus
)
Shares a single container asynchronously to Media Server. Nested container and items are ignored. The container is created with parent id passed as an argument to this operation (object field iParentId value is ignored). Parent id existence is checked by Media Server. After creation input object is updated with the current:
  • iId

Since
S60 3.1

Parameters

const TDesC8 & aParentId
CUpnpContainer & aContainerreference to container which is shared.
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

ShareItemL(const TDesC8 &, CUpnpItem &, TRequestStatus &)

IMPORT_C voidShareItemL(const TDesC8 &aContainerId,
CUpnpItem &aItem,
TRequestStatus &aStatus
)
Shares a single item asynchronously to Media Server. Symbian data base doesn't support foreign key constraints. In order to avoid adding item with nonexistent parent container, parent id existence is checked by Media Server. The item is created with parent id passed as an argument to this operation (object field iParentId value is ignored). 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. For consistency the same approach will be used in online mode.

Since
S60 3.1

Parameters

const TDesC8 & aContainerIdinformation to which container the item is shared.
CUpnpItem & aItemreference to item which is shared.
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

ShareItemListL(const TDesC8 &, CUpnpItemList &, TInt &, TRequestStatus &)

IMPORT_C voidShareItemListL(const TDesC8 &aContainerId,
CUpnpItemList &aItemList,
TInt &aExecStatus,
TRequestStatus &aStatus
)

Shares a list of items asynchronously to Media Server. Each CUpnpItem of CUpnpItemList is created with the same parent id passed as an argument to this operation (object field iParentId value is ignored). Parent id existence is checked by Media Server - only once for this operation. 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).

Note: There is no support for chunked operations (splitting long operation into sequence of asynchronical calls). Each operation is atomic from Media Server Engine perspective. Long lasting operations may block Media Server Engine. In such case switching Media Server to offline mode is recommended.

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

  • "res" element value

Since
S60 3.1

Parameters

const TDesC8 & aContainerIdinformation to which container the item is shared.
CUpnpItemList & aItemListreference to item list which are to be shared.
TInt & aExecStatusreference pointing to the index of item list
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

ShareReferenceL(TInt, TInt, CUpnpItem &, TRequestStatus &)

IMPORT_C voidShareReferenceL(TIntaContainerId,
TIntaObjectId,
CUpnpItem &aItem,
TRequestStatus &aStatus
)

Creates a single reference upon passed item asynchronously in Media Server.

Since
S60 5.0 HN

Parameters

TInt aContainerId- container id upon which the reference will be located.
TInt aObjectId- the reference is created on the basis of passed object id
CUpnpItem & aItemreference item to be filled
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

ShareReferenceListL(CUpnpItemList &, TInt &, TRequestStatus &)

IMPORT_C voidShareReferenceListL(CUpnpItemList &aItemList,
TInt &aExecStatus,
TRequestStatus &aStatus
)

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

Since
S60 5.0 HN

Parameters

CUpnpItemList & aItemList'reference item' list which are to be shared
TInt & aExecStatusreference pointing to the index of item list
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

UnshareContainerL(TInt, TRequestStatus &)

IMPORT_C voidUnshareContainerL(TIntaItemId,
TRequestStatus &aStatus
)

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: This method removes uploaded file associated with item being destroyed. Shared files are never removed.

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 aItemId
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

UnshareItemL(TInt, TRequestStatus &)

IMPORT_C voidUnshareItemL(TIntaItemId,
TRequestStatus &aStatus
)

Unshares existing item from the Media Server. Item with specified id is removed from database regardless "restricted" property value. Note: This method removes uploaded file associated with item being destroyed. Shared files are never removed.

Since
S60 3.1

Parameters

TInt aItemIditem which is unshared
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

UnshareItemListL(CUpnpItemList &, TInt &, TRequestStatus &)

IMPORT_C voidUnshareItemListL(CUpnpItemList &aItemList,
TInt &aExecStatus,
TRequestStatus &aStatus
)

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.

Note: This method removes uploaded file associated with item being destroyed. Shared files are never removed.

Since
S60 3.1

Parameters

CUpnpItemList & aItemListlist of items which are to be unshared
TInt & aExecStatusreference pointing to the index of item list
TRequestStatus & aStatusreference to TRequestStatus which is completed when procedure is over

Member Data Documentation

CUpnpFileSharingBody * iBody

CUpnpFileSharingBody *iBody[private]

Actual implementation class for the interface Own.