ChspsDefinitionRepository Class Reference
class ChspsDefinitionRepository : public CBase
|
hspsDefinitionRepository is a common and secure place to store the HSPS's definition files.
Class provides the APIs to store and retrieve all the definition files: locale, style, structure and resource files.
Repository can store disk space limited number of ODT data structures and definition files (themes) for every application. Themes are identified by application uid, vendor name, theme name and theme version. Localisation is supported by naming the ODT for each language variant uniquely. TLanguage enumeration is used in the ODT header to specify the variant. The ODT can be retrieved from the repository as a fully constructed object or a descriptor stream.
Existing themes can be queried from the repository for managing purposes. Same method can be used to avoid accidental overwrites. If the query returns zero count for the appropriate ODT the new theme can be safely installed. Themes can be also removed with the valid header information. When the theme is removed also all the definition files will be deleted.
hspsDefRep.dll
-
Since
-
S60 5.0
Inherits from
-
ChspsDefinitionRepository
Public Member Functions
|
|
~ChspsDefinitionRepository
()
|
IMPORT_C void
|
BackupConfigurationL
(const
ChspsODT
&)
|
IMPORT_C void
|
ClearBackupsL
()
|
IMPORT_C void
|
GetODTPathL
(const
ChspsODT
&,
TDes
&)
|
IMPORT_C
TInt
|
GetOdtHeaderL
(
TDes
&,
TLanguage
,
ChspsODT
&)
|
IMPORT_C
TInt
|
GetOdtL
(
ChspsODT
&)
|
IMPORT_C void
|
GetOdtL
(const
TDes
&,
ChspsODT
&)
|
IMPORT_C
TInt
|
GetResourceListL
(const
ChspsODT
&,
CArrayPtrSeg
<
ChspsResource
> &)
|
IMPORT_C void
|
GetResourcePathL
(const
ChspsODT
&,
ThspsResourceType
,
TDes
&)
|
IMPORT_C void
|
GetThemeListAsStreamL
(
CArrayPtrSeg
<
HBufC8
> &, const
ChspsODT
&)
|
IMPORT_C void
|
GetThemePathListL
(
CDesCArraySeg
&, const
ChspsODT
&)
|
IMPORT_C void
|
Lock
()
|
IMPORT_C
TBool
|
Locked
()
|
IMPORT_C void
|
MakeODTPathL
(
ChspsODT
&,
ChspsResource
&)
|
IMPORT_C void
|
MakeResourcePathL
(const
ChspsODT
&,
ChspsResource
&)
|
IMPORT_C
ChspsDefinitionRepository
*
|
NewL
(
CRepository
&)
|
IMPORT_C void
|
RegisterNotification
(
ThspsRepositoryInfo
)
|
IMPORT_C void
|
RegisterObserverL
(const
MhspsDefinitionRepositoryObserver
&)
|
IMPORT_C void
|
RemoveThemeL
(const
ChspsODT
&)
|
IMPORT_C
TInt
|
RestoreBackupConfiguration
(const
ChspsODT
&)
|
IMPORT_C
TInt
|
SetLocaleL
(
ChspsODT
&,
ChspsResource
&)
|
IMPORT_C void
|
SetLogBus
(void *)
|
IMPORT_C
TInt
|
SetOdtL
(const
ChspsODT
&)
|
IMPORT_C
TInt
|
SetResourceL
(const
ChspsODT
&, const
CFbsBitmap
&,
ChspsResource
&)
|
IMPORT_C
TInt
|
SetResourceListL
(
ChspsODT
&, const
CArrayPtrSeg
<
ChspsResource
> &)
|
IMPORT_C void
|
Unlock
()
|
IMPORT_C void
|
UnregisterObserver
(const
MhspsDefinitionRepositoryObserver
&)
|
Private Member Functions
|
|
ChspsDefinitionRepository
(
CRepository
&)
|
void
|
AddLocalePathL
(
TDes
&,
TInt
)
|
void
|
AppendDesCIntoPathL
(
TDes
&, const
TDesC
&)
|
void
|
AppendNumIntoPathL
(
TDes
&, const
TUint
)
|
void
|
ConstructL
()
|
TInt
|
CopyFileL
(const
TDesC
&)
|
TInt
|
CopyFileL
(const
TDesC
&, const
TDesC
&)
|
void
|
FileExtensionL
(
ThspsResourceType
,
TInt
)
|
void
|
GetPathL
(const
ChspsODT
&,
ThspsResourceType
)
|
void
|
MatchingFoldersFromAllDrivesL
(const
TDesC
&, const
TDesC
&,
CDesCArraySeg
&)
|
TInt
|
MatchingFoldersL
(const
TDesC
&, const
TDesC
&,
CDesCArraySeg
&)
|
CFileStore
*
|
OpenFileStoreLC
(const
TDesC
&)
|
TInt
|
ReadFromFileL
(const
TDesC
&,
ChspsODT
&)
|
void
|
RemoveDirectoryL
()
|
void
|
RemoveDirectoryL
(
TDesC
&)
|
void
|
SelectFilesFromPathL
(
CDesCArraySeg
&, const
TDesC
&,
TEntryKey
, const
TDesC
&)
|
void
|
SetupPropertiesL
(const
TUint
)
|
HBufC8
*
|
StreamHeaderFromFileL
(const
TDesC
&)
|
TInt
|
WriteToFileL
(const
ChspsODT
&)
|
Constructor & Destructor Documentation
ChspsDefinitionRepository(CRepository &)
ChspsDefinitionRepository
|
(
|
CRepository
&
|
aCentralRepository
|
)
|
[private]
|
~ChspsDefinitionRepository()
~ChspsDefinitionRepository
|
(
|
)
|
[virtual]
|
Member Functions Documentation
AddLocalePathL(TDes &, TInt)
void
|
AddLocalePathL
|
(
|
TDes
&
|
aPath,
|
|
TInt
|
aLanguage
|
|
)
|
[private]
|
AppendDesCIntoPathL(TDes &, const TDesC &)
void
|
AppendDesCIntoPathL
|
(
|
TDes
&
|
aPath,
|
|
const
TDesC
&
|
aText
|
|
)
|
[private]
|
AppendNumIntoPathL(TDes &, const TUint)
void
|
AppendNumIntoPathL
|
(
|
TDes
&
|
aPath,
|
|
const
TUint
|
aNum
|
|
)
|
[private]
|
BackupConfigurationL(const ChspsODT &)
IMPORT_C void
|
BackupConfigurationL
|
(
|
const
ChspsODT
&
|
aODT
|
)
|
|
Copies a defined configuration to theme backup folder
-
Since
-
S60 5.0
Parameters
const
ChspsODT
& aODT
|
ODT header defining the configuration to be copied
|
ClearBackupsL()
IMPORT_C void
|
ClearBackupsL
|
(
|
)
|
|
Clears previous backup data
-
Since
-
S60 5.0
ConstructL()
void
|
ConstructL
|
(
|
)
|
[private]
|
By default Symbian 2nd phase constructor is private.
CopyFileL(const TDesC &)
TInt
|
CopyFileL
|
(
|
const
TDesC
&
|
aSourceFile
|
)
|
[private]
|
Parameters
const
TDesC
& aSourceFile
|
|
CopyFileL(const TDesC &, const TDesC &)
TInt
|
CopyFileL
|
(
|
const
TDesC
&
|
aSourceFile,
|
|
const
TDesC
&
|
aDestinationFile
|
|
)
|
[private]
|
Parameters
const
TDesC
& aSourceFile
|
|
const
TDesC
& aDestinationFile
|
|
FileExtensionL(ThspsResourceType, TInt)
GetODTPathL(const ChspsODT &, TDes &)
IMPORT_C void
|
GetODTPathL
|
(
|
const
ChspsODT
&
|
aODT,
|
|
TDes
&
|
aPath
|
|
)
|
|
Creates a path from the header information. Results are stored into the iPath member.
Parameters
const
ChspsODT
& aODT
|
An ODT whose path is being requested
|
TDes
& aPath
|
Relative path without a drive letter
|
GetOdtHeaderL(TDes &, TLanguage, ChspsODT &)
Retrieves the ODT header from the repository. The aPath variable must contain the valid path. Leaves if path not found.
Parameters
TDes
& aPath
|
The path where the theme is located.
|
TLanguage
aLang
|
Informs the correct language version.
|
ChspsODT
& aODT
|
A reference to ODT header object, which is filled with data from the repository.
|
GetOdtL(ChspsODT &)
Retrieves the ODT from the repository. The ODT must contain the valid header information, which is used to locate the correct data. Leaves if ODT not found.
Parameters
ChspsODT
& aODT
|
A reference to ODT object, which is filled with data from the repository.
|
GetOdtL(const TDes &, ChspsODT &)
IMPORT_C void
|
GetOdtL
|
(
|
const
TDes
&
|
aPath,
|
|
ChspsODT
&
|
aODT
|
|
)
|
|
Retrieves the ODT from the repository. The aPath variable must contain the valid path. Leaves if path not found.
-
Since
-
S60 5.0
Parameters
const
TDes
& aPath
|
The path where the theme is located.
|
ChspsODT
& aODT
|
A reference to ODT object, which is filled with data from the repository.
|
GetPathL(const ChspsODT &, ThspsResourceType)
GetResourceListL(const ChspsODT &, CArrayPtrSeg< ChspsResource > &)
Retrieves the resource list in an array. Every registered resource has an own entry in the array. Leaves if the repository is corrupted. Use RemoveThemeL to remove the corrupted repository.
Parameters
const
ChspsODT
& aODT
|
contains the theme header associated to this resourcelist.
|
CArrayPtrSeg
<
ChspsResource
> & aResourceList
|
destination resource list where resource are read from repository.
|
GetResourcePathL(const ChspsODT &, ThspsResourceType, TDes &)
Retrieves the exact path of the repository object. Does not check whether the object is really existing on repository or not.
Parameters
const
ChspsODT
& aODT
|
Contains the header information. Works as a search mask. Leaves if invalid data.
|
ThspsResourceType
aResourceType
|
resource type to search for.
|
TDes
& aFilePath
|
A file path returned to caller.
|
GetThemeListAsStreamL(CArrayPtrSeg< HBufC8 > &, const ChspsODT &)
Retrieves the list of installed themes as a streams in an array. ODT header information works as a search mask.
Parameters
CArrayPtrSeg
<
HBufC8
> & aThemeList
|
A reference to an array, which contains internalized theme headers.
|
const
ChspsODT
& aODT
|
Contains the header information. Works as a search mask. Leaves if invalid data.
|
GetThemePathListL(CDesCArraySeg &, const ChspsODT &)
Retrieves the list of installed themes in an array. ODT header information works as a search mask. If all the information is available in the header a function can be used to query the theme's existence. This is useful when the accidental overwrites needs to be avoided e.g. when installing a new theme.
Parameters
CDesCArraySeg
& aThemeList
|
A reference to an array, which is filled with the theme paths.
|
const
ChspsODT
& aODT
|
Contains the header information. Works as a search mask. Leaves if invalid data.
|
Lock()
Increases the semaphore controlling repository locking. Locking semaphore is increased explicitly by clients that going to write data to repository.. Lockin semaphore revents reading repository as long as there are writers.
Locked()
IMPORT_C
TBool
|
Locked
|
(
|
)
|
const
|
Returns repository locking status
MakeODTPathL(ChspsODT &, ChspsResource &)
Creates a path for the ODT to be stored on repository. ODT-header information works as a set mask.
Parameters
ChspsODT
& aODT
|
Contains the header information. Works as a set mask. Leaves if invalid data.
|
ChspsResource
& aResource
|
A ChspsResource-object filled with the new path is returned to caller.
|
MakeResourcePathL(const ChspsODT &, ChspsResource &)
Get a path for resource to be stored.
Parameters
const
ChspsODT
& aODT
|
Contains the header information.
|
ChspsResource
& aResource
|
resource where path is stored. Leaves if path could not be defined.
|
MatchingFoldersFromAllDrivesL(const TDesC &, const TDesC &, CDesCArraySeg &)
void
|
MatchingFoldersFromAllDrivesL
|
(
|
const
TDesC
&
|
aWildName,
|
|
const
TDesC
&
|
aScanDir,
|
|
CDesCArraySeg
&
|
aThemeList
|
|
)
|
[private]
|
MatchingFoldersL(const TDesC &, const TDesC &, CDesCArraySeg &)
OpenFileStoreLC(const TDesC &)
ReadFromFileL(const TDesC &, ChspsODT &)
RegisterNotification(ThspsRepositoryInfo)
GetRepositoryInfo Register a ThspsRepositoryInfo-object to the repository. Repository's responsibility is to notify its observers about the notification.
RegisterObserverL(const MhspsDefinitionRepositoryObserver &)
RegisterObserverL ( ) Returns a refrence to a RArray-object containing changes in repository system. It is a responsibilty of the caller to lock the repository for modifications.
RemoveDirectoryL()
void
|
RemoveDirectoryL
|
(
|
)
|
[private]
|
RemoveDirectoryL(TDesC &)
void
|
RemoveDirectoryL
|
(
|
TDesC
&
|
aDirPath
|
)
|
[private]
|
RemoveThemeL(const ChspsODT &)
IMPORT_C void
|
RemoveThemeL
|
(
|
const
ChspsODT
&
|
aODT
|
)
|
|
Removes the theme specific ODT and definition files from the repository. ODT header information works as a mask, which defines the level of removal. A single theme, all themes from a provider or all application specific themes can be removed at once.
Parameters
const
ChspsODT
& aODT
|
Contains the header information. Leaves if information is not valid.
|
RestoreBackupConfiguration(const ChspsODT &)
IMPORT_C
TInt
|
RestoreBackupConfiguration
|
(
|
const
ChspsODT
&
|
aODT
|
)
|
|
Restores a defined configuration from backup folder
-
Since
-
S60 5.0
Parameters
const
ChspsODT
& aODT
|
ODT header defining the configuration to be restored
|
SelectFilesFromPathL(CDesCArraySeg &, const TDesC &, TEntryKey, const TDesC &)
SetLocaleL(ChspsODT &, ChspsResource &)
Saves the localisation file into repository. ODT must contain the valid header information, which is used to define the location for the file. Updates resource object with the new location. Leaves if original file does not exist or information is not valid.
Parameters
ChspsODT
& aODT
|
Contains the header information.
|
ChspsResource
& aResource
|
The resource file to be saved.
|
SetLogBus(void *)
IMPORT_C void
|
SetLogBus
|
(
|
void *
|
aLogBus
|
)
|
|
Set log bus. Empty implementation if non HSPS_LOG_ACTIVE build.
Parameters
void * aLogBus
|
Log bus to be set.
|
SetOdtL(const ChspsODT &)
Saves the ODT data structure into the repository. The location of the data is defined from the ODT's header information.
Parameters
const
ChspsODT
& aODT
|
The actual data to be stored.
|
SetResourceL(const ChspsODT &, const CFbsBitmap &, ChspsResource &)
Saves the resource into the repository.
Parameters
const
ChspsODT
& aODT
|
Contains the header information.
|
const
CFbsBitmap
& aFbsBitmap
|
bitmap to store to repository.
|
ChspsResource
& aResource
|
resource where path is stored. Leaves if original file does not exist.
|
SetResourceListL(ChspsODT &, const CArrayPtrSeg< ChspsResource > &)
Stores the resource list to the repository. Every registered resource has an own entry in the array. Leaves if the repository is corrupted. Use RemoveThemeL to remove the corrupted repository.
SetupPropertiesL(const TUint)
void
|
SetupPropertiesL
|
(
|
const
TUint
|
aKey
|
)
|
[private]
|
StreamHeaderFromFileL(const TDesC &)
HBufC8
*
|
StreamHeaderFromFileL
|
(
|
const
TDesC
&
|
aPath
|
)
|
[private]
|
Unlock()
Decreases the semaphore controlling repository locking. Semaphore minimun value is 0 meaning unlocked situation.
UnregisterObserver(const MhspsDefinitionRepositoryObserver &)
UnregisterObserver Returns a refrence to a RArray-object containing changes in repository system. It is a responsibilty of the caller to lock the repository for modifications.
WriteToFileL(const ChspsODT &)
Member Data Documentation
CRepository & iCentralRepository
TBool
iLicenseDefault
TBool
|
iLicenseDefault
|
[private]
|
TInt
iLockSemaphore
TInt
|
iLockSemaphore
|
[private]
|
RPointerArray< MhspsDefinitionRepositoryObserver > iObservers
RArray< ThspsRepositoryInfo > iRepositoryInfoQueue
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.