ChspsClient Class Reference

class ChspsClient : public CActive

ChspsClient. ChspsClient performs all client-side theme installation and maintenance related functionality. Theme maintenance services includes theme listings, theme activation, theme removal, and default theme restoring functionality.

Class inheritance: ================== ChspsClient derives CActive for asynchronous request handling, and MhspsInstallationService and MhspsMaintenanceService from Homescreenpluginservices.

Theme installation functionality: ================================= Client application must call hspsInstallNextPhaseL() after testing that the synchronous call hspsInstallTheme() has returned EhspsInstallPhaseSuccess return code signalling that actual installation is allowed. The rest of the installation phases will be executed automatically, however, installation can be interrupted by calling hspsCancelInstallTheme() at any time. If installation is canceled, hspsThemeServer initiates roll-back functionality removing inconsistent installation. Installation service uses specific manifest-file format to get informed about the xml, css, dtd, and resource files to be installed. Resource files might be locale-specific or generic as well. hspsThemeServer takes care of saving everything on their appropriate places in the target device's user disk. Theme storage is located in hspsThemeServer's private-folder. Locales are instructed in manifest file also. Manifest file's file-extension must be .dat, but actually, the file-name can be whatever, however, when low-level parametrization is used, the name must be "manifest.dat" and it must be the last file extracted from the installation package. For more information of manifest-file format, see Homescreen wikipages.

Installation functions can return one of the following ThspsServiceCompletedMessage-codes:
  • EhspsInstallThemeSuccess,

  • EhspsInstallPhaseSuccess, or

  • EhspsInstallThemeFailed.

Client application must implement MhspsThemeManagementServiceObserver-interface and listen these messages mentioned. Let it be emphasised that both synchronous and asynchronous calls can return the codes above. Installation functions may also return one of the following codes:
  • EhspsServiceRequestSheduled, or

  • EhspsServiceRequestError.

For explanation of the meanings of these messages, see ThspsServiceCompletedMessage-documentation.

Theme maintenance functionality: ================================ Most of the maintenance functions are synchronous, only one is asynchronous; hspsGetNextHeader(). Others functions are straightforward to use but hspsGetListHeaders(). This will be explained next; synchronous call hspsGetListHeaders() initiates the theme header listing by passing search mask to HSPS Server's Maintenance Service. This search mask is called a query. It also passes a list object in where maintenance service should append theme-header objects (type of ChspsODT-class without DOM-document) when one is retrieved asychronously. Search mask should be filled with proper parameters matching the need in hand. If no parameters are given, all headers of Application Themes available in Definition Repository will be delivered, otherwise, only sub-set of theme-headers will be delivered. After the query-call hspsGetListHeaders(), the delivering of the theme-headers is asynchronous. Asynchronous service must be initiated by calling hspsGetNextHeader() after checking that any theme matching on current query is found or that query is valid anyway. This action is called a subscription. To receive theme listing, the client application must implement MhspsThemeManagementServiceObserver-interface and start to listen call-back messages. The headers matching on query will be delivered immediately. Query remains until hspsCancelGetListHeaders() is called by client. If a new Application Theme exist in repository, it will be delivered. As mentioned, when hspsGetListHeaders() returns, the return value must be checked. Return value could be one of the following:
  • EhspsGetListHeadersSuccess - there is at least one Application Theme available matching on query. Call first hspsGetNextHeader() to get the headers. Same call will set the subscribtion of new ones possible coming available later.

  • EhspsGetListHeadersEmpty - there is no themes matching on the query available at the time, however, some might be exist later in due to installations. Client application should retain the subcription.

  • EhspsGetListHeadersFailed - service request failed for some reason. Possible reasons are for e.g. the missing rights to list headers queried.

Additional Return Code Support (ChspsResult) will express for e.g. the number of headers to be delivered or possible system error code in failed cases.

By MhspsServiceObserver::HandlehspsServiceMessage() call-back function implementation, client application must listen the following ThspsServiceCompletedMessage-messages:

  • EhspsGetListHeadersUpdate - header list on the client side has a new object appended at the end of the list,

  • EhspsGetListHeadersRestart - header list on server side has changed so much that the client must empty the list printed on screen. New list will be delivered immediately. The subscription stands.

  • EhspsGetListHeadersEmpty - header list on server side is now empty. The client must empty the list on screen if printed. The subscription stands.

  • EhspsGetListHeadersFailed - operation has failed. Client should cancel request and restart.

Maintenanace functions may also return one of the following codes:
  • EhspsServiceRequestSheduled, or

  • EhspsServiceRequestError.

For explanation of the meanings of these messages, see ThspsServiceCompletedMessage-documentation.

hspsClient.lib
Since
S60 5.0

Inherits from

Public Member Functions
~ChspsClient()
IMPORT_C voidGethspsResult(ChspsResult &)
IMPORT_C ChspsClient *NewL(MhspsThemeManagementServiceObserver &)
IMPORT_C ChspsClient *NewLC(MhspsThemeManagementServiceObserver &)
IMPORT_C voidSetLogBus(void *)
IMPORT_C ThspsServiceCompletedMessagehspsAddPlugin(const TInt, const TInt, const TInt, const TInt, TInt &)
IMPORT_C ThspsServiceCompletedMessagehspsCancelGetListHeaders()
IMPORT_C ThspsServiceCompletedMessagehspsCancelInstallTheme()
IMPORT_C TInthspsGetHeaders(const ChspsODT &, const TBool, CArrayPtrFlat< ChspsODT > &)
IMPORT_C ThspsServiceCompletedMessagehspsGetListHeaders(const ChspsODT &, const TBool, CArrayPtrFlat< ChspsODT > &)
IMPORT_C ThspsServiceCompletedMessagehspsGetListHeaders(const TDesC8 &, CArrayPtrSeg< HBufC8 > &)
IMPORT_C ThspsServiceCompletedMessagehspsGetNextHeader()
IMPORT_C ThspsServiceCompletedMessagehspsGetPluginOdtL(const TInt, const TInt, ChspsODT *)
IMPORT_C ThspsServiceCompletedMessagehspsInstallNextPhaseL(ChspsODT &)
IMPORT_C ThspsServiceCompletedMessagehspsInstallNextPhaseL(TDes8 &)
IMPORT_C ThspsServiceCompletedMessagehspsInstallTheme(const TDesC &, ChspsODT &)
IMPORT_C ThspsServiceCompletedMessagehspsInstallTheme(const TDesC &, TDes8 &)
IMPORT_C ThspsServiceCompletedMessagehspsMovePluginsL(const TInt, const TInt, const CArrayFixFlat< TInt > &)
IMPORT_C ThspsServiceCompletedMessagehspsPluginUpdateL(const ChspsODT &)
IMPORT_C ThspsServiceCompletedMessagehspsReinstallConf(TInt, TInt)
IMPORT_C ThspsServiceCompletedMessagehspsRemovePlugin(const TInt, const TInt)
IMPORT_C ThspsServiceCompletedMessagehspsRemoveThemeL(const ChspsODT &)
IMPORT_C ThspsServiceCompletedMessagehspsReplacePlugin(const TInt, const TInt, const TInt)
IMPORT_C ThspsServiceCompletedMessagehspsRestoreActiveAppConf(const TInt, const TInt)
IMPORT_C ThspsServiceCompletedMessagehspsRestoreConfigurations(const TInt, const ThspsRestore)
IMPORT_C ThspsServiceCompletedMessagehspsRestoreDefault(const ChspsODT &, ChspsODT &)
IMPORT_C ThspsServiceCompletedMessagehspsSetActivePlugin(const TInt, const TInt)
IMPORT_C ThspsServiceCompletedMessagehspsSetActiveTheme(const ChspsODT &, ChspsODT &)
IMPORT_C ThspsServiceCompletedMessagehspsSetActiveTheme(const TDesC8 &, TDes8 &)
IMPORT_C ThspsServiceCompletedMessagehspsSetConfState(const TInt, const TInt, const ThspsConfigurationState, const ThspsConfStateChangeFilter)
IMPORT_C ThspsServiceCompletedMessagehspsSetPluginSettings(const ChspsODT &, const TInt, ChspsDomDocument &, const TBool)
Protected Member Functions
voidDoCancel()
TInt RunError(TInt)
voidRunL()
Private Member Functions
ChspsClient(MhspsThemeManagementServiceObserver &)
voidAppendHeaderListL(TDesC8 &)
voidConstructL()
TInt StreamOdtL(TDes &, const TInt, ChspsODT *)
voidUpdatehspsResult(TDesC8 &)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
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()
Inherited Enumerations
CActive:TPriority
Private Attributes
ThspsServiceRequestMessage iCancelRequestMessage
ChspsODT *iHeader
TBuf8< KMaxHeaderDataLength8 >iHeaderData
CArrayPtrSeg< HBufC8 > *iHeaderDataList
CArrayPtrFlat< ChspsODT > *iHeaderList
TBool iODTMode
MhspsThemeManagementServiceObserver &iObserver
ChspsODT *iOdt
ChspsResult *iResult
TBuf8< KMaxResultDataLength8 >iResultData
HBufC8 *iSearchMaskData
RhspsClientSession iSession
HBufC8 *iSetMaskData
TBool iSubscription
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

ChspsClient(MhspsThemeManagementServiceObserver &)

ChspsClient(MhspsThemeManagementServiceObserver &aObserver)[private]

ChspsClient. Performs the first phase of two phase construction.

Parameters

MhspsThemeManagementServiceObserver & aObserverThe object to be used to handle updates from the server.

~ChspsClient()

~ChspsClient()[virtual]

~ChspsClient.

Destructor. Destroys the object and release all memory objects.

Member Functions Documentation

AppendHeaderListL(TDesC8 &)

voidAppendHeaderListL(TDesC8 &aHeaderData)[private]

Creates a header object from header data (iHeaderData) and adds created header to the header list (iHeaderList)

Parameters

TDesC8 & aHeaderDataHeader data

ConstructL()

voidConstructL()[private]

ConstructL. Performs the second phase construction of a ChspsClient object.

DoCancel()

voidDoCancel()[protected, virtual]

From CActive, DoCancel. Cancels any outstanding operation.

GethspsResult(ChspsResult &)

IMPORT_C voidGethspsResult(ChspsResult &aResult)

GethspsResult

Since
S60 5.0

Parameters

ChspsResult & aResultis a ChspsResult object containing additional information of query result.

NewL(MhspsThemeManagementServiceObserver &)

IMPORT_C ChspsClient *NewL(MhspsThemeManagementServiceObserver &aObserver)[static]

NewL.

Two-phased constructor. Creates a ChspsClient object using two phase construction, and return a pointer to the created object.

Since
S60 5.0

Parameters

MhspsThemeManagementServiceObserver & aObserverThe object to be used to handle updates from the server.

NewLC(MhspsThemeManagementServiceObserver &)

IMPORT_C ChspsClient *NewLC(MhspsThemeManagementServiceObserver &aObserver)[static]

NewLC.

Two-phased constructor. Creates a ChspsClinet object using two phase construction, and return a pointer to the created object.

Since
S60 5.0

Parameters

MhspsThemeManagementServiceObserver & aObserverThe object to be used to handle updates from the server.

RunError(TInt)

TInt RunError(TIntaError)[protected, virtual]
From CActive Called when asynchronous request has failed
Since
S60 3.1

Parameters

TInt aError

RunL()

voidRunL()[protected, virtual]

From CActive, RunL. Callback function. Invoked to handle responses from the server.

SetLogBus(void *)

IMPORT_C voidSetLogBus(void *aLogBus)

Internal log bus setter. Empty method in product builds.

Since
S60 5.0

Parameters

void * aLogBusLog bus to be set.

StreamOdtL(TDes &, const TInt, ChspsODT *)

TInt StreamOdtL(TDes &aOdtPath,
const TIntaAppUid,
ChspsODT *aPluginOdt
)[private]
Gets file handle and streams odt from the file.
Since
S60 5.0

Parameters

TDes & aOdtPath- odt file path
const TInt aAppUid- application uid for accessing to the file
ChspsODT * aPluginOdt- odt for streaming

UpdatehspsResult(TDesC8 &)

voidUpdatehspsResult(TDesC8 &aResultData)[private]

Updates iResult

Parameters

TDesC8 & aResultDataResult data

hspsAddPlugin(const TInt, const TInt, const TInt, const TInt, TInt &)

IMPORT_C ThspsServiceCompletedMessagehspsAddPlugin(const TIntaAppUid,
const TIntaConfId,
const TIntaPluginUid,
const TIntaPosition,
TInt &aAddedPluginId
)

Parameters

const TInt aAppUid
const TInt aConfId
const TInt aPluginUid
const TInt aPosition
TInt & aAddedPluginId

hspsCancelGetListHeaders()

IMPORT_C ThspsServiceCompletedMessagehspsCancelGetListHeaders()

hspsCancelInstallTheme()

IMPORT_C ThspsServiceCompletedMessagehspsCancelInstallTheme()

hspsGetHeaders(const ChspsODT &, const TBool, CArrayPtrFlat< ChspsODT > &)

IMPORT_C TInthspsGetHeaders(const ChspsODT &aSearchMask,
const TBoolaCopyLogos,
CArrayPtrFlat< ChspsODT > &aHeaderList
)

Returns ODT header list according to the defined search mask

Since
S60 5.0

Parameters

const ChspsODT & aSearchMaskis ChspsODT-object which attributes are filled to present search parameters for theme set queried by client. This parametrisation follows the high-level schema.
const TBool aCopyLogosis set if client wants to view logos
CArrayPtrFlat< ChspsODT > & aHeaderListis an list object able to carry ChspsODT-objects.

hspsGetListHeaders(const ChspsODT &, const TBool, CArrayPtrFlat< ChspsODT > &)

IMPORT_C ThspsServiceCompletedMessagehspsGetListHeaders(const ChspsODT &aSearchMask,
const TBoolaCopyLogos,
CArrayPtrFlat< ChspsODT > &aHeaderList
)

Parameters

const ChspsODT & aSearchMask
const TBool aCopyLogos
CArrayPtrFlat< ChspsODT > & aHeaderList

hspsGetListHeaders(const TDesC8 &, CArrayPtrSeg< HBufC8 > &)

IMPORT_C ThspsServiceCompletedMessagehspsGetListHeaders(const TDesC8 &aSearchMaskData,
CArrayPtrSeg< HBufC8 > &aHeaderDataList
)

Parameters

const TDesC8 & aSearchMaskData
CArrayPtrSeg< HBufC8 > & aHeaderDataList

hspsGetNextHeader()

IMPORT_C ThspsServiceCompletedMessagehspsGetNextHeader()

hspsGetPluginOdtL(const TInt, const TInt, ChspsODT *)

IMPORT_C ThspsServiceCompletedMessagehspsGetPluginOdtL(const TIntaAppUid,
const TIntaPluginUid,
ChspsODT *aPluginOdt
)

Parameters

const TInt aAppUid
const TInt aPluginUid
ChspsODT * aPluginOdt

hspsInstallNextPhaseL(ChspsODT &)

IMPORT_C ThspsServiceCompletedMessagehspsInstallNextPhaseL(ChspsODT &aHeader)

Parameters

ChspsODT & aHeader

hspsInstallNextPhaseL(TDes8 &)

IMPORT_C ThspsServiceCompletedMessagehspsInstallNextPhaseL(TDes8 &aHeaderData)

Parameters

TDes8 & aHeaderData

hspsInstallTheme(const TDesC &, ChspsODT &)

IMPORT_C ThspsServiceCompletedMessagehspsInstallTheme(const TDesC &aManifestFileName,
ChspsODT &aHeader
)

Parameters

const TDesC & aManifestFileName
ChspsODT & aHeader

hspsInstallTheme(const TDesC &, TDes8 &)

IMPORT_C ThspsServiceCompletedMessagehspsInstallTheme(const TDesC &aManifestFileName,
TDes8 &aHeaderData
)

Parameters

const TDesC & aManifestFileName
TDes8 & aHeaderData

hspsMovePluginsL(const TInt, const TInt, const CArrayFixFlat< TInt > &)

IMPORT_C ThspsServiceCompletedMessagehspsMovePluginsL(const TIntaAppUid,
const TIntaConfId,
const CArrayFixFlat< TInt > &aPluginIdList
)

Parameters

const TInt aAppUid
const TInt aConfId
const CArrayFixFlat< TInt > & aPluginIdList

hspsPluginUpdateL(const ChspsODT &)

IMPORT_C ThspsServiceCompletedMessagehspsPluginUpdateL(const ChspsODT &)

Updates plugin configuration in all application configuration

Since
S60 5.0

Parameters

const ChspsODT &

hspsReinstallConf(TInt, TInt)

IMPORT_C ThspsServiceCompletedMessagehspsReinstallConf(TIntaAppUid,
TIntaConfUid
)

Reinstalls requested configuration

Since
S60 5.0

Parameters

TInt aAppUidis interface.
TInt aConfUidis ID of the reinstalled configuration.

hspsRemovePlugin(const TInt, const TInt)

IMPORT_C ThspsServiceCompletedMessagehspsRemovePlugin(const TIntaAppUid,
const TIntaPluginId
)

Parameters

const TInt aAppUid
const TInt aPluginId

hspsRemoveThemeL(const ChspsODT &)

IMPORT_C ThspsServiceCompletedMessagehspsRemoveThemeL(const ChspsODT &aSetMask)

Parameters

const ChspsODT & aSetMask

hspsReplacePlugin(const TInt, const TInt, const TInt)

IMPORT_C ThspsServiceCompletedMessagehspsReplacePlugin(const TIntaAppUid,
const TIntaPluginId,
const TIntaConfUid
)

Parameters

const TInt aAppUid
const TInt aPluginId
const TInt aConfUid

hspsRestoreActiveAppConf(const TInt, const TInt)

IMPORT_C ThspsServiceCompletedMessagehspsRestoreActiveAppConf(const TIntaAppUid,
const TIntaConfUid
)

Parameters

const TInt aAppUid
const TInt aConfUid

hspsRestoreConfigurations(const TInt, const ThspsRestore)

IMPORT_C ThspsServiceCompletedMessagehspsRestoreConfigurations(const TIntaAppUid,
const ThspsRestoreaRestore
)
Restores plugin configurations according to the input.
Since
S60 5.2

Parameters

const TInt aAppUidApplication uid
const ThspsRestore aRestoreOperation to be executed

hspsRestoreDefault(const ChspsODT &, ChspsODT &)

IMPORT_C ThspsServiceCompletedMessagehspsRestoreDefault(const ChspsODT &aSetMask,
ChspsODT &aHeader
)

Parameters

const ChspsODT & aSetMask
ChspsODT & aHeader

hspsSetActivePlugin(const TInt, const TInt)

IMPORT_C ThspsServiceCompletedMessagehspsSetActivePlugin(const TIntaAppUid,
const TIntaPluginId
)

Parameters

const TInt aAppUid
const TInt aPluginId

hspsSetActiveTheme(const ChspsODT &, ChspsODT &)

IMPORT_C ThspsServiceCompletedMessagehspsSetActiveTheme(const ChspsODT &aSetMask,
ChspsODT &aHeader
)

Parameters

const ChspsODT & aSetMask
ChspsODT & aHeader

hspsSetActiveTheme(const TDesC8 &, TDes8 &)

IMPORT_C ThspsServiceCompletedMessagehspsSetActiveTheme(const TDesC8 &aSetMaskData,
TDes8 &aHeaderData
)

Parameters

const TDesC8 & aSetMaskData
TDes8 & aHeaderData

hspsSetConfState(const TInt, const TInt, const ThspsConfigurationState, const ThspsConfStateChangeFilter)

IMPORT_C ThspsServiceCompletedMessagehspsSetConfState(const TIntaAppUid,
const TIntaConfId,
const ThspsConfigurationStateaState,
const ThspsConfStateChangeFilteraFilter
)

Parameters

const TInt aAppUid
const TInt aConfId
const ThspsConfigurationState aState
const ThspsConfStateChangeFilter aFilter

hspsSetPluginSettings(const ChspsODT &, const TInt, ChspsDomDocument &, const TBool)

IMPORT_C ThspsServiceCompletedMessagehspsSetPluginSettings(const ChspsODT &aHeader,
const TIntaPluginId,
ChspsDomDocument &aDom,
const TBoolaPluginStoringStatus
)

Parameters

const ChspsODT & aHeader
const TInt aPluginId
ChspsDomDocument & aDom
const TBool aPluginStoringStatus

Member Data Documentation

ThspsServiceRequestMessage iCancelRequestMessage

ThspsServiceRequestMessage iCancelRequestMessage[private]

Message to cancel outstanding request.

ChspsODT * iHeader

ChspsODT *iHeader[private]

TBuf8< KMaxHeaderDataLength8 > iHeaderData

TBuf8< KMaxHeaderDataLength8 >iHeaderData[private]

CArrayPtrSeg< HBufC8 > * iHeaderDataList

CArrayPtrSeg< HBufC8 > *iHeaderDataList[private]

An pointer array given by service requester to be filled with headers.

CArrayPtrFlat< ChspsODT > * iHeaderList

CArrayPtrFlat< ChspsODT > *iHeaderList[private]

TBool iODTMode

TBool iODTMode[private]

MhspsThemeManagementServiceObserver & iObserver

MhspsThemeManagementServiceObserver &iObserver[private]

iObserver, observer which handles updates from the server.

ChspsODT * iOdt

ChspsODT *iOdt[private]

ChspsResult * iResult

ChspsResult *iResult[private]

TBuf8< KMaxResultDataLength8 > iResultData

TBuf8< KMaxResultDataLength8 >iResultData[private]

HBufC8 * iSearchMaskData

HBufC8 *iSearchMaskData[private]

RhspsClientSession iSession

RhspsClientSession iSession[private]

iSession, the theme server session.

HBufC8 * iSetMaskData

HBufC8 *iSetMaskData[private]

TBool iSubscription

TBool iSubscription[private]