CUpnpFileSharing Class Reference

class CUpnpFileSharing : public CBase

Interface class for UPnP File Sharing

MediaServerClient.lib
Since
S60 v3.1

Inherits from

Public Member Functions
~CUpnpFileSharing ()
IMPORT_C void DropAllContentL ( TRequestStatus &)
IMPORT_C void GetSharedContainerL ( TInt , CUpnpContainer &, TRequestStatus &)
IMPORT_C void GetSharedContainerListL ( TInt , CUpnpBrowseCriteria &, CUpnpContainerList &, TInt &, TRequestStatus &)
IMPORT_C void GetSharedItemL ( TInt , CUpnpItem &, TRequestStatus &)
IMPORT_C void GetSharedItemListL ( TInt , CUpnpBrowseCriteria &, CUpnpItemList &, TInt &, TRequestStatus &)
IMPORT_C RUpnpMediaServerClient & MediaServerClient ()
IMPORT_C CUpnpFileSharing * NewL ()
IMPORT_C void ShareContainerL (const TDesC8 &, CUpnpContainer &, TRequestStatus &)
IMPORT_C void ShareItemL (const TDesC8 &, CUpnpItem &, TRequestStatus &)
IMPORT_C void ShareItemListL (const TDesC8 &, CUpnpItemList &, TInt &, TRequestStatus &)
IMPORT_C void ShareReferenceL ( TInt , TInt , CUpnpItem &, TRequestStatus &)
IMPORT_C void ShareReferenceListL ( CUpnpItemList &, TInt &, TRequestStatus &)
IMPORT_C void UnshareContainerL ( TInt , TRequestStatus &)
IMPORT_C void UnshareItemL ( TInt , TRequestStatus &)
IMPORT_C void UnshareItemListL ( CUpnpItemList &, TInt &, TRequestStatus &)
Private Member Functions
CUpnpFileSharing ()
void ConstructL ()
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
CUpnpFileSharingBody * iBody

Constructor & Destructor Documentation

CUpnpFileSharing()

CUpnpFileSharing ( ) [private]

C++ default constructor.

~CUpnpFileSharing()

~CUpnpFileSharing ( ) [virtual]

Destructor.

Member Functions Documentation

ConstructL()

void ConstructL ( ) [private]

By default Symbian 2nd phase constructor is private.

DropAllContentL(TRequestStatus &)

IMPORT_C void DropAllContentL ( TRequestStatus & aStatus )

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

Since
S60 3.1

Parameters

TRequestStatus & aStatus reference to TRequestStatus which is completed when procedure is over

GetSharedContainerL(TInt, CUpnpContainer &, TRequestStatus &)

IMPORT_C void GetSharedContainerL ( TInt aItemId,
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 & aContainer reference to container where information is updated.
TRequestStatus & aStatus reference to TRequestStatus which is completed when procedure is over

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

IMPORT_C void GetSharedContainerListL ( TInt aContainerId,
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 aContainerId id of the container of which items are to be returned
CUpnpBrowseCriteria & aBrowseCriteria specifies request details, such as requestCount, startingIndes, filter
CUpnpContainerList & aItem
TInt & aTotalMatches
TRequestStatus & aStatus reference to TRequestStatus which is completed when procedure is over

GetSharedItemL(TInt, CUpnpItem &, TRequestStatus &)

IMPORT_C void GetSharedItemL ( TInt aItemId,
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 aItemId item id
CUpnpItem & aItem reference to item where information is updated.
TRequestStatus & aStatus reference to TRequestStatus which is completed when procedure is over

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

IMPORT_C void GetSharedItemListL ( TInt aContainerId,
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 aContainerId id of the container of which items are to be returned
CUpnpBrowseCriteria & aBrowseCriteria specifies request details, such as requestCount, startingIndes, filter
CUpnpItemList & aItemList reference to item list where information is updated.
TInt & aTotalMatches
TRequestStatus & aStatus reference 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 void ShareContainerL ( 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 & aContainer reference to container which is shared.
TRequestStatus & aStatus reference to TRequestStatus which is completed when procedure is over

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

IMPORT_C void ShareItemL ( 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 & aContainerId information to which container the item is shared.
CUpnpItem & aItem reference to item which is shared.
TRequestStatus & aStatus reference to TRequestStatus which is completed when procedure is over

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

IMPORT_C void ShareItemListL ( 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 & aContainerId information to which container the item is shared.
CUpnpItemList & aItemList reference to item list which are to be shared.
TInt & aExecStatus reference pointing to the index of item list
TRequestStatus & aStatus reference to TRequestStatus which is completed when procedure is over

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

IMPORT_C void ShareReferenceL ( TInt aContainerId,
TInt aObjectId,
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 & aItem reference item to be filled
TRequestStatus & aStatus reference to TRequestStatus which is completed when procedure is over

ShareReferenceListL(CUpnpItemList &, TInt &, TRequestStatus &)

IMPORT_C void ShareReferenceListL ( 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 & aExecStatus reference pointing to the index of item list
TRequestStatus & aStatus reference to TRequestStatus which is completed when procedure is over

UnshareContainerL(TInt, TRequestStatus &)

IMPORT_C void UnshareContainerL ( TInt aItemId,
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 & aStatus reference to TRequestStatus which is completed when procedure is over

UnshareItemL(TInt, TRequestStatus &)

IMPORT_C void UnshareItemL ( TInt aItemId,
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 aItemId item which is unshared
TRequestStatus & aStatus reference to TRequestStatus which is completed when procedure is over

UnshareItemListL(CUpnpItemList &, TInt &, TRequestStatus &)

IMPORT_C void UnshareItemListL ( 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 & aItemList list of items which are to be unshared
TInt & aExecStatus reference pointing to the index of item list
TRequestStatus & aStatus reference to TRequestStatus which is completed when procedure is over

Member Data Documentation

CUpnpFileSharingBody * iBody

CUpnpFileSharingBody * iBody [private]

Actual implementation class for the interface Own.