java_plat/java_registry_api/inc/javaregistrypackageentry.h
changeset 1 53c80e845d7c
parent 0 3fd91c96c86c
child 3 255dd6e7afb6
equal deleted inserted replaced
0:3fd91c96c86c 1:53c80e845d7c
     1 /*
       
     2 * Copyright (c) 2005-2008 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: Java Registy API header file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef JAVAREGISTRYPACKAGEENTRY_H
       
    20 #define JAVAREGISTRYPACKAGEENTRY_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <e32cmn.h>
       
    24 #include <f32file.h>
       
    25 #include "javaregistryentry.h"
       
    26 #include "javaregistryentrytype.h"
       
    27 
       
    28 // FORWARD DECLARATION
       
    29 class TAppVersion;
       
    30 
       
    31 namespace Java
       
    32 {
       
    33 namespace Manager
       
    34 {
       
    35 namespace Registry
       
    36 {
       
    37 
       
    38 // FORWARD DECLARATION
       
    39 class CWriteableJavaRegistryPackageEntry;
       
    40 
       
    41 }// namespace Registry
       
    42 }// namespace Manager
       
    43 
       
    44 
       
    45 /**
       
    46  * This subclass of CJavaRegistryEntry supports attributes
       
    47  * for packages, that can contain embedded entries.
       
    48  *
       
    49  * @lib javaregistryclient.lib
       
    50  * @since S60 v3.2
       
    51  */
       
    52 class CJavaRegistryPackageEntry : public CJavaRegistryEntry
       
    53 {
       
    54 public:
       
    55 
       
    56 
       
    57     /**
       
    58      * CJavaRegistryPackageEntry::CJavaRegistryPackageEntry constructor
       
    59      *
       
    60      * @since S60 v3.2
       
    61      * @param aWritableEntry Pointer to a writable entry, to delegate
       
    62      *          getter methods. Pointer ownership taken.
       
    63      */
       
    64     CJavaRegistryPackageEntry(Java::Manager::Registry::
       
    65                               CWriteableJavaRegistryPackageEntry* aWritableEntry);
       
    66 
       
    67     /**
       
    68      * Gets the version of Java entity represented by this package entry.
       
    69      *
       
    70      * @since S60 v3.2
       
    71      * @return A TAppVersion object.
       
    72      *         Default value if not set: TAppVersion( 0, 0, 0 ).
       
    73      */
       
    74     IMPORT_C TAppVersion Version() const;
       
    75 
       
    76     /**
       
    77      * Gets the vendor name of the Java entity represented by this
       
    78      * package entry.
       
    79      *
       
    80      * @since S60 v3.2
       
    81      * @return Vendor name of the Java entity.
       
    82      *         Default value if not set: KNullDesC.
       
    83      */
       
    84     IMPORT_C const TDesC& Vendor() const;
       
    85 
       
    86 
       
    87     /**
       
    88      * Tells if the Java entity represented by this package entry
       
    89      * is uninstallable.
       
    90      *
       
    91      * @since S60 v3.2
       
    92      * @return ETrue if the entity is uninstallable, EFalse otherwise.
       
    93      *         Default value if not set: ETrue.
       
    94      */
       
    95     IMPORT_C TBool IsUninstallable() const;
       
    96 
       
    97     /**
       
    98      * Returns an array of Uids associated with the Java entity
       
    99      * represented by this package entry.
       
   100      * E.g. if this entry represents a MIDlet suite this method returns
       
   101      * an array of MIDlet Uids.
       
   102      *
       
   103      * @since S60 v3.2
       
   104      * @param aUids [out] Returns Uids of the embedded entries.
       
   105      */
       
   106     IMPORT_C void GetEmbeddedEntries(RArray<TUid>& aUids) const;
       
   107 
       
   108     /**
       
   109      * Gets the number of embedded entries in Java entity represented
       
   110      * by this package entry.
       
   111      *
       
   112      * @since S60 v3.2
       
   113      * @return the number of embedded entries
       
   114      */
       
   115     IMPORT_C TInt NumberOfEmbeddedEntries() const;
       
   116 
       
   117     /**
       
   118      * Returns the corresponding embedded entry for the given Uid.
       
   119      * The returned entry can be casted to the appropriate subclass
       
   120      * according to the type property. If type is in the package range
       
   121      * ( EGeneralPackage <= entryType < EGeneralApplication ), it can
       
   122      * be casted to CJavaRegistryPackageEntry, and if type is
       
   123      * in the application range ( EGeneralApplication <= entryType ),
       
   124      * it can be casted to CJavaRegistryApplicationEntry.
       
   125      * The function may leave with one of the system-wide error codes.
       
   126      *
       
   127      * @since S60 v3.2
       
   128      * @param aAppUid The Uid of the embedded entry to be retrieved
       
   129      * @return The returned embedded entry or null if entry is not found.
       
   130      *         Caller takes over the ownership of the object being
       
   131      *         transferred.
       
   132      */
       
   133     IMPORT_C CJavaRegistryEntry*
       
   134     EmbeddedEntryByUidL(const TUid& aEntryUid) const;
       
   135 
       
   136     /**
       
   137      * Returns an embedded entry specified by a zero-based index.
       
   138      * There is not any guaranteed order for embedded entries inside this
       
   139      * package entry.
       
   140      * The returned entry can be casted to the appropriate subclass
       
   141      * according to the type property. If type is in the package range
       
   142      * ( EGeneralPackage <= entryType < EGeneralApplication ), it can
       
   143      * be casted to CJavaRegistryPackageEntry, and if type is
       
   144      * in the application range ( EGeneralApplication <= entryType ),
       
   145      * it can be casted to CJavaRegistryApplicationEntry.
       
   146      *
       
   147      * The function may leave with one of the system-wide error codes.
       
   148      *
       
   149      * @since S60 v3.2
       
   150      * @param aAppNum Zero-based index of the embedded entry to be
       
   151      *                retrieved.
       
   152      * @return The returned embedded entry or null if entry is not found.
       
   153      *         Caller takes over the ownership of the object being
       
   154      *         transferred.
       
   155      */
       
   156     IMPORT_C CJavaRegistryEntry*
       
   157     EmbeddedEntryByNumberL(TInt aEntryNum) const;
       
   158 
       
   159     /**
       
   160      * Returns the amount of disk space taken by the installed application.
       
   161      *
       
   162      * @since S60 v5.1
       
   163      * @return Returns the size of used disk space in bytes.
       
   164      */
       
   165     IMPORT_C TInt64 UsedUserDiskSpace() const;
       
   166 
       
   167     /**
       
   168      * Tells if the application package is pre-installed.
       
   169      *
       
   170      * If a pre-installed application package is upgraded,
       
   171      * it remains marked as pre-installed.
       
   172      *
       
   173      * If a pre-installed application package is uninstalled
       
   174      * and later installed again, it is no more marked as
       
   175      * pre-installed.
       
   176      *
       
   177      * @since S60 v5.1
       
   178      * @return ETrue if the application suite is pre-installed,
       
   179      *         EFalse otherwise.
       
   180      */
       
   181     IMPORT_C TBool IsPreinstalled() const;
       
   182 
       
   183 protected:
       
   184 
       
   185     /**
       
   186      * CJavaRegistryPackageEntry::WritableEntry method returns the member
       
   187      * of the parent class, but first casts it to
       
   188      * CWriteableJavaRegistrypackageEntry.
       
   189      *
       
   190      * @since S60 v3.2
       
   191      * @return Returns the member of this class.
       
   192      */
       
   193     Java::Manager::Registry::
       
   194     CWriteableJavaRegistryPackageEntry* WritableEntry() const;
       
   195 
       
   196 };
       
   197 
       
   198 } // namespace Java
       
   199 
       
   200 #endif // JAVAREGISTRYPACKAGEENTRY_H