java_plat/java_registry_api/inc/javaregistry.h
changeset 1 53c80e845d7c
parent 0 3fd91c96c86c
child 3 255dd6e7afb6
equal deleted inserted replaced
0:3fd91c96c86c 1:53c80e845d7c
     1 /*
       
     2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  The main class of Java Registy API. Java Registy API
       
    15 *               can be used to query the installed Java applications
       
    16 *               and their properties.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 // JAVAREGISTRY.H
       
    23 #ifndef __JAVAREGISTRY_H
       
    24 #define __JAVAREGISTRY_H
       
    25 
       
    26 #include <e32base.h>
       
    27 #include "javaregistryentrytype.h"
       
    28 
       
    29 
       
    30 namespace Java
       
    31 {
       
    32 namespace Manager
       
    33 {
       
    34 namespace Registry
       
    35 {
       
    36 
       
    37 // FORWARD DECLARATION
       
    38 class CWriteableJavaRegistry;
       
    39 
       
    40 }// namespace Registry
       
    41 }// namespace Manager
       
    42 }// namespace Java
       
    43 
       
    44 namespace Java
       
    45 {
       
    46 class CJavaRegistryEntry;
       
    47 
       
    48 /**
       
    49  * This class provides the Platform API for JavaRegistry.
       
    50  * It allows for clients to retrieve properties of
       
    51  * Java install packages, applications, services etc.
       
    52  *
       
    53  * @lib javaregistryclient.lib
       
    54  * @since S60 v3.2
       
    55  */
       
    56 class CJavaRegistry : public CBase
       
    57 {
       
    58 
       
    59     // Constructors
       
    60 public:
       
    61 
       
    62     /**
       
    63      * Creates a CJavaRegistry object.
       
    64      * The function may leave with one of the system-wide error codes.
       
    65      *
       
    66      * @since S60 v3.2
       
    67      * @return A pointer to a CJavaRegistry object.
       
    68      *         Caller takes over the ownership of the object being
       
    69      *         transferred.
       
    70      */
       
    71     IMPORT_C static CJavaRegistry* NewL();
       
    72 
       
    73     /**
       
    74      * Creates a CJavaRegistry object.
       
    75      * The function may leave with one of the system-wide error codes.
       
    76      *
       
    77      * @since S60 v3.2
       
    78      * @return A pointer to a CJavaRegistry object.
       
    79      *         Caller takes over the ownership of the object being
       
    80      *         transferred.
       
    81      */
       
    82     IMPORT_C static CJavaRegistry* NewLC();
       
    83 
       
    84 
       
    85 public:
       
    86 
       
    87     // Generic methods
       
    88 
       
    89     /**
       
    90      * Returns whether registry entry with the specified Uid exists.
       
    91      * Registry entries representing entities installed on
       
    92      * removable media which are currently not present in the device
       
    93      * are considered as not existent.
       
    94      * The function may leave with one of the system-wide error codes.
       
    95      *
       
    96      * @since S60 v3.2
       
    97      * @param aUid The Uid to be checked.
       
    98      * @return ETrue if the registry entry exists, EFalse otherwise.
       
    99      */
       
   100     IMPORT_C TBool RegistryEntryExistsL(const TUid& aUid) const;
       
   101 
       
   102     /**
       
   103      * Returns an array of Uids of the existing registry entries.
       
   104      * Uids of registry entries representing entities installed on
       
   105      * removable media which are currently not present in the device
       
   106      * are not returned.
       
   107      * The function may leave with one of the system-wide error codes.
       
   108      *
       
   109      * @since S60 v3.2
       
   110      * @param aUids [out] Uids of the registry entries.
       
   111      */
       
   112     IMPORT_C void GetRegistryEntryUidsL(RArray<TUid>& aUids) const;
       
   113 
       
   114     /**
       
   115      * Returns an array of Uids of the existing registry entries.
       
   116      * Entries are searched by the specified type.
       
   117      * Uids of registry entries representing entities installed on
       
   118      * removable media which are currently not present in the device
       
   119      * are not returned.
       
   120      * The function may leave with one of the system-wide error codes.
       
   121      *
       
   122      * @since S60 v3.2
       
   123      * @param aType Type of registry entries whose Uids are to be returned.
       
   124      * @param aUids [out] Uids of the matching registry entries.
       
   125      */
       
   126     IMPORT_C void GetRegistryEntryUidsL
       
   127     (TJavaRegistryEntryType aType, RArray<TUid>& aUids) const;
       
   128 
       
   129     /**
       
   130      * Returns the corresponding registry entry for a given Uid.
       
   131      * The returned entry can be casted to the appropriate subclass
       
   132      * according to the type property. If type is in the package range
       
   133      * ( EGeneralPackage <= entryType < EGeneralApplication ), it can
       
   134      * be casted to CJavaRegistryPackageEntry, and if type is
       
   135      * in the application range ( EGeneralApplication <= entryType ),
       
   136      * it can be casted to CJavaRegistryApplicationEntry.
       
   137      * Registry entries representing entities installed on
       
   138      * removable media which are currently not present in the device
       
   139      * are not returned.
       
   140      * The function may leave with one of the system-wide error codes.
       
   141      *
       
   142      * @since S60 v3.2
       
   143      * @param aUid The Uid of the entry to be retrieved
       
   144      * @return The returned registry entry or null if registry entry
       
   145      *         not found. Caller takes over the ownership of the object
       
   146      *         being transferred.
       
   147      */
       
   148     IMPORT_C CJavaRegistryEntry* RegistryEntryL(const TUid& aUid) const;
       
   149 
       
   150     // Destructor
       
   151     /**
       
   152      * CJavaRegistry::~CJavaRegistry destructor
       
   153      *
       
   154      * @since S60 v3.2
       
   155      */
       
   156     virtual ~CJavaRegistry();
       
   157 
       
   158 private:
       
   159 
       
   160     // Constructor
       
   161 
       
   162     /**
       
   163      * CJavaRegistry::CJavaRegistry constructor
       
   164      *
       
   165      * @since S60 v3.2
       
   166      */
       
   167     CJavaRegistry();
       
   168 
       
   169     // 2nd phase constructor
       
   170 
       
   171     /**
       
   172      * CJavaRegistry::ConstructL method
       
   173      * The function may leave with one of the system-wide error codes.
       
   174      *
       
   175      * @since S60 v3.2
       
   176      */
       
   177     void ConstructL();
       
   178 
       
   179 private: // Data
       
   180 
       
   181 
       
   182     /**
       
   183      * CJavaRegistry::iJavaReg member
       
   184      * Pointer Owned
       
   185      * @since S60 v3.2
       
   186      */
       
   187     Java::Manager::Registry::CWriteableJavaRegistry* iJavaReg;
       
   188 
       
   189 };
       
   190 
       
   191 }// namespace Java
       
   192 
       
   193 #endif // __JAVAREGISTRY_H