javamanager/javasettings/appmngrplugin/inc/appmngr2midletappinfo.h
branchRCL_3
changeset 19 04becd199f91
child 60 6c158198356e
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 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:  MidletAppInfo represents installed Java applications
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef APPMNGR2MIDLETAPPINFO_H
       
    20 #define APPMNGR2MIDLETAPPINFO_H
       
    21 #include <appmngr2appinfo.h>            // CAppMngr2AppInfo
       
    22 #include <SWInstApi.h>                  // SwiUI::RSWInstLauncher
       
    23 #include <appversion.h>                 // TAppVersion
       
    24 #include <downloadedcontenthandler.h>   // MDownloadedContentHandler
       
    25 #include <javaregistryincludes.h>
       
    26 #include "appmngr2midletinfo.h"         // MAppMngr2MidletInfo
       
    27 #include <string>
       
    28 
       
    29 class CFbsBitmap;
       
    30 class CAppMngr2MidletInfoIterator;
       
    31 class CAiwGenericParamList;
       
    32 class CAppMngr2MidletResourceHandler;
       
    33 
       
    34 namespace SwiUI
       
    35 {
       
    36 namespace CommonUI
       
    37 {
       
    38 class MCUIInfoIterator;
       
    39 class CCUICertificateInfo;
       
    40 }
       
    41 }
       
    42 
       
    43 /**
       
    44  * MIDlet Suite Application Info
       
    45  *
       
    46  * MIDlet Suite Application Info handles uinstallation of installed MIDlet suite,
       
    47  * shows MIDlet suite details and MIDlet suite settings.
       
    48  *
       
    49  * @lib appmngr2midletplugin.dll
       
    50  * @since S60 v9.1
       
    51  */
       
    52 class CAppMngr2MidletAppInfo : public CAppMngr2AppInfo,
       
    53         public MAppMngr2MidletInfo,
       
    54         public MDownloadedContentHandler
       
    55 
       
    56 {
       
    57 public:     // constructor and destructor
       
    58 
       
    59     /**
       
    60      * Two phase constructor
       
    61      *
       
    62      * @since S60 9.1
       
    63      * @param aRuntime Runtime
       
    64      * @param aEntry Java Registry Suite Entry. Ownership taken.
       
    65      * @param aFs Handle to a file server session
       
    66      * @return instance
       
    67      */
       
    68     static CAppMngr2MidletAppInfo* NewL(CAppMngr2Runtime& aRuntime,
       
    69                                         Java::CJavaRegistryPackageEntry* aEntry,
       
    70                                         RFs& aFs,
       
    71                                         CAppMngr2MidletResourceHandler& aResourceHandler);
       
    72 
       
    73     /**
       
    74      * Two phase constructor
       
    75      *
       
    76      * @since S60 9.1
       
    77      * @param aRuntime Runtime
       
    78      * @param aEntry Java Registry Suite Entry. Ownership taken.
       
    79      * @param aFs Handle to a file server session
       
    80      * @return instance
       
    81      */
       
    82     static CAppMngr2MidletAppInfo* NewLC(CAppMngr2Runtime& aRuntime,
       
    83                                          Java::CJavaRegistryPackageEntry* aEntry,
       
    84                                          RFs& aFs,
       
    85                                          CAppMngr2MidletResourceHandler& aResourceHandler);
       
    86     /**
       
    87      * Destructor
       
    88      *
       
    89      * @since S60 9.1
       
    90      */
       
    91     ~CAppMngr2MidletAppInfo();
       
    92 
       
    93 public:     // from CAppMngr2InfoBase
       
    94 
       
    95     /**
       
    96      * Icon index for the installed application or installation package.
       
    97      * Returns icon index referring to the icon array loaded in function
       
    98      * CAppMngr2Runtime::LoadIconsL(). If an item has a specific icon that
       
    99      * no other items use, return EAppMngr2UseSpecificIcon and load the
       
   100      * specific icon via CAppMngr2InfoBase::SpecificIconL().
       
   101      * @return TInt  Index to the icon array
       
   102      */
       
   103     TInt IconIndex() const;
       
   104 
       
   105     /**
       
   106      * Specific icon for the installed application or installation package.
       
   107      * CAppMngr2InfoBase::IconIndex() must return EAppMngr2UseSpecificIcon
       
   108      * to get CAppMngr2InfoBase::SpecificIconL() called. If the same icon is
       
   109      * used by many items, load it in CAppMngr2Runtime::LoadIconsL() and
       
   110      * use CAppMngr2InfoBase::IconIndex() to return icon indexes. This is
       
   111      * more efficient than loading the same icon bitmap many times.
       
   112      * @return CGulIcon  Item specific icon
       
   113      */
       
   114     CGulIcon* SpecificIconL() const;
       
   115 
       
   116     /**
       
   117      * Name of the list item, first line
       
   118      * @return const TDesC&  Displayable name
       
   119      */
       
   120     const TDesC& Name() const;
       
   121 
       
   122     /**
       
   123      * Additional info, second line (usually size)
       
   124      * @returns const TDesC&  Displayable additional information line
       
   125      */
       
   126     const TDesC& Details() const;
       
   127 
       
   128     /**
       
   129      * Indicator icon index. Returns indexes to the icon array returned by
       
   130      * CAppMngr2Runtime::LoadIconsL(). Also default icon indexes defined in
       
   131      * AppMngr2Common.hrh (TAppMngr2IconIndex) can be used. Return
       
   132      * EAppMngr2NoIndicatorIcon if no indicator icon should be displayed, or
       
   133      * EAppMngr2UseSpecificIcon if item specific indicator icon is returned
       
   134      * via CAppMngr2InfoBase::SpecificIndicatorIconL().
       
   135      * @return TInt  Index to the icon array, or default icon number
       
   136      */
       
   137     TInt IndicatorIconIndex() const;
       
   138 
       
   139     /**
       
   140      * Defines item specific menu items.
       
   141      * Empty default implementation is used, if plug-in does not override it.
       
   142      * Menu commands are run via CAppMngr2InfoBase::HandleCommandL()
       
   143      * @param aMenuCmds Array where plug-in specific menu items are added
       
   144      */
       
   145     void GetMenuItemsL(RPointerArray<CEikMenuPaneItem::SData>& aMenuCmds);
       
   146 
       
   147     /**
       
   148      * Can be used to enable generic menu commands. Generic menu commands are
       
   149      * defined in TAppMngr2GenericCommands enum in AppMngr2Common.hrh. Generic
       
   150      * commands are hidden from the menu if the currently selected item does not
       
   151      * support them. Return ETrue for those command ids that are supported by
       
   152      * this item.
       
   153      * @param aCmdId Generic command id
       
   154      * @return TBool ETrue if command aCmdId is supported
       
   155      */
       
   156     TBool SupportsGenericCommand(TInt aCmdId);
       
   157 
       
   158     /**
       
   159      * Starts user invoked commands asynchronously. Command id may be a generic
       
   160      * command id or a plug-in specific command id. Generic command ids are defined
       
   161      * inAppMngr2Common.hrh (see TAppMngr2GenericCommand enum). Plug-in specific
       
   162      * commands are defined via functions CAppMngr2InfoBase::GetMenuItemsL() and
       
   163      * CAppMngr2InfoBase::GetMiddleSoftkeyCommandL(). If the command is synchronous,
       
   164      * the plug-in must complete the aStatus by calling User::RequestComplete().
       
   165      * @param aCommandId  Command id to be run
       
   166      * @param aStatus  Active object request status
       
   167      */
       
   168     void HandleCommandL(TInt aCommandId, TRequestStatus& aStatus);
       
   169 
       
   170     /**
       
   171      * If CAppMngr2InfoBase::HandleCommandL() started an asynchronous operation,
       
   172      * this function is called when the operation completes.
       
   173      * @param aStatus  Completion code, KErrNone or some error code
       
   174      */
       
   175     void HandleCommandResultL(TInt aStatus);
       
   176 
       
   177     /**
       
   178      * Cancels asynchronously started HandleCommandL() command. This function
       
   179      * may be called any time when an asynchronous command is running and it
       
   180      * must cancel the running command as quickly as possible.
       
   181      */
       
   182     void CancelCommand();
       
   183 
       
   184 public:      // from MDownloadContentHandler
       
   185     /**
       
   186     * Handle downloaded content that has been saved to a file,
       
   187     * and return ETrue if it was handled successfully.
       
   188     *
       
   189     * @since S60 9.1
       
   190     * @param aFileName File name with path.
       
   191     * @param aParamList Generic parameter list.
       
   192     * @param aContinue Output parameter: It must be ETrue if the caller wants
       
   193     *                  Browser not to terminate after the content is handled.
       
   194     * @return ETrue if the implementer has processed the content. If it is
       
   195     *                  EFalse, BrowserLauncher opens that content in an
       
   196     *                  appropriate viewer application.
       
   197     */
       
   198     TBool HandleContentL(const TDesC& aFileName,
       
   199                          const CAiwGenericParamList& aParamList,
       
   200                          TBool& aContinue);
       
   201 
       
   202     /**
       
   203     * From MDownloadContentHandler for browser integration
       
   204     * @since S60 9.1
       
   205     // reserved for future use
       
   206     */
       
   207     TAny* DownloadedContentHandlerReserved1(TAny* /*aAnyParam*/);
       
   208 
       
   209 public:      // from MAppMngr2MidletInfo
       
   210     /**
       
   211      * Path to jar file
       
   212      *
       
   213      * @since S60 9.1
       
   214      * @return Path to jar file
       
   215      */
       
   216     const TDesC& JarFileName() const;
       
   217 
       
   218     /**
       
   219      * Path to jad file
       
   220      *
       
   221      * @since S60 9.1
       
   222      * @return Path to jad file
       
   223      */
       
   224     const TDesC& JadFileName() const;
       
   225 
       
   226     /**
       
   227      * Installed application MIME type
       
   228      *
       
   229      * @since S60 9.1
       
   230      * @return Application MIME type
       
   231      */
       
   232     const TDesC8& MimeType() const;
       
   233 
       
   234 
       
   235 public:     // new functions
       
   236     /**
       
   237      * Installed application version
       
   238      *
       
   239      * @since S60 9.1
       
   240      * @return Application version
       
   241      */
       
   242     const TDesC& Version() const;
       
   243 
       
   244     /**
       
   245      * Installed application vendor
       
   246      *
       
   247      * @since S60 9.1
       
   248      * @return Application vendor
       
   249      */
       
   250     const TDesC& Vendor() const;
       
   251 
       
   252     /**
       
   253      * Security domain category
       
   254      *
       
   255      * @since S60 9.1
       
   256      * @return Application security domain category
       
   257      */
       
   258     const std::wstring SecurityDomainCategory() const;
       
   259 
       
   260     /**
       
   261      * Security domain name
       
   262      *
       
   263      * @since S60 9.1
       
   264      * @return Application security domain name
       
   265      */
       
   266     const std::wstring SecurityDomainName() const;
       
   267 
       
   268     /**
       
   269      * Installed application data size
       
   270      *
       
   271      * @since S60 9.1
       
   272      * @return Application data size
       
   273      */
       
   274     const TDesC& DataSize() const;
       
   275 
       
   276     /**
       
   277      * Installed application description
       
   278      *
       
   279      * @since S60 9.1
       
   280      * @return Application description
       
   281      */
       
   282     const TDesC& Description() const;
       
   283 
       
   284     /**
       
   285      * Installed application info URL
       
   286      *
       
   287      * @since S60 9.1
       
   288      * @return Application info URL
       
   289      */
       
   290     const TDesC& InfoUrl() const;
       
   291 
       
   292     /**
       
   293      * Installed application update URL
       
   294      *
       
   295      * @since S60 9.1
       
   296      * @return Application update URL
       
   297      */
       
   298     const TDesC& UpdateUrl() const;
       
   299 
       
   300     /**
       
   301      * Installed application content
       
   302      *
       
   303      * @since S60 9.1
       
   304      * @return Application content
       
   305      */
       
   306     const TDesC& Content() const;
       
   307 
       
   308     /**
       
   309      * Installed application requested mandatory permissions
       
   310      *
       
   311      * @since S60 9.2
       
   312      * @return Permissions
       
   313      */
       
   314     const TDesC& Permissions() const;
       
   315 
       
   316 protected:  // new functions
       
   317 
       
   318     /**
       
   319      * Constructor
       
   320      *
       
   321      * @since S60 9.1
       
   322      * @param aRuntime Runtime
       
   323      * @param aFs Handle to a file server session
       
   324      */
       
   325     CAppMngr2MidletAppInfo(CAppMngr2Runtime& aRuntime, RFs& aFsSession, CAppMngr2MidletResourceHandler& aResourceHandler);
       
   326 
       
   327     /**
       
   328      * Second phase constructor
       
   329      *
       
   330      * @since S60 9.1
       
   331      * @param aEntry Java Registry Suite Entry
       
   332      */
       
   333     void ConstructL(Java::CJavaRegistryPackageEntry* aEntry);
       
   334 
       
   335 private:     // new functions
       
   336 
       
   337     /**
       
   338      * Uninstalls MIDlet suite package
       
   339      *
       
   340      * @since S60 9.1
       
   341      * @param aStatus The request status. KErrNone on completion,
       
   342      *                otherwise another of the system-wide error codes.
       
   343      */
       
   344     void UninstallL(TRequestStatus& aStatus);
       
   345 
       
   346     /**
       
   347     * Show installed MIDlet suite details
       
   348     *
       
   349     * @since S60 9.1
       
   350     */
       
   351     void ShowDetailsL();
       
   352 
       
   353     /**
       
   354     * Show installed MIDlet suite settings
       
   355     *
       
   356     * @since S60 9.1
       
   357     */
       
   358     void ShowSettingsL();
       
   359 
       
   360     /**
       
   361      * Send MIDlet suite installation package
       
   362      *
       
   363      * @since S60 9.1
       
   364      */
       
   365     void SendL();
       
   366 
       
   367     /**
       
   368      * Start update process
       
   369      *
       
   370      * @since S60 9.1
       
   371      */
       
   372     void UpdateL();
       
   373 
       
   374     /**
       
   375      * Starts the browser with midlet's MIDLET-Info-URL parameter
       
   376      *
       
   377      * @since S60 9.1
       
   378      */
       
   379     void ShowInfoUrlL();
       
   380 
       
   381     /**
       
   382      * Return Info Iterator
       
   383      *
       
   384      * @since S60 9.1
       
   385      * @return Info iterator object
       
   386      */
       
   387     CAppMngr2MidletInfoIterator& InfoIteratorL();
       
   388 
       
   389     /**
       
   390      * Reads MIDlet suite certificates info
       
   391      *
       
   392      * @since S60 9.1
       
   393      */
       
   394     void ReadCertificatesInfoL();
       
   395 
       
   396 
       
   397 private:    // data
       
   398 
       
   399     /**
       
   400      * MIDlet suite entry.
       
   401      */
       
   402     Java::CJavaRegistryPackageEntry* iEntry;
       
   403 
       
   404     /**
       
   405      * MIDlet suite jar file path
       
   406      * Owned
       
   407      */
       
   408     HBufC* iJarPath;
       
   409 
       
   410     /**
       
   411      * MIDlet suite jad file path
       
   412      * Owned
       
   413      */
       
   414     HBufC* iJadPath;
       
   415 
       
   416     /**
       
   417      * MIDlet suite details
       
   418      * Owned
       
   419      */
       
   420     HBufC* iDetails;
       
   421 
       
   422     /**
       
   423      * MIDlet suite version
       
   424      * Owned
       
   425      */
       
   426     HBufC* iVersion;
       
   427 
       
   428     /**
       
   429      * MIDlet suite MIME type
       
   430      * Owned
       
   431      */
       
   432     HBufC8* iMimeType;
       
   433 
       
   434     /**
       
   435      * MIDlet suite data size
       
   436      * Owned
       
   437      */
       
   438     HBufC* iDataSize;
       
   439 
       
   440     /**
       
   441      * MIDlet suite description
       
   442      * Owned
       
   443      */
       
   444     HBufC* iDescription;
       
   445 
       
   446     /**
       
   447      * MIDlet suite info URL
       
   448      * Owned
       
   449      */
       
   450     HBufC* iInfoUrl;
       
   451 
       
   452     /**
       
   453      * MIDlet suite update URL
       
   454      * Owned
       
   455      */
       
   456     HBufC* iUpdateUrl;
       
   457 
       
   458     /**
       
   459      * Localized MIDlet suite name
       
   460      * Owned
       
   461      */
       
   462     HBufC* iLocalizedMIDletName;
       
   463 
       
   464     /**
       
   465      * MIDlet suite content
       
   466      * Owned
       
   467      */
       
   468     HBufC* iContent;
       
   469 
       
   470     /**
       
   471      * MIDlet suite mandatory permissions
       
   472      * Owned
       
   473      */
       
   474     HBufC* iPermissions;
       
   475 
       
   476     /**
       
   477      * MIDlet suite bitmap
       
   478      * Owned
       
   479      */
       
   480     CFbsBitmap* iAppBitmap;
       
   481 
       
   482     /**
       
   483      * MIDlet suite bitmap mask
       
   484      * Owned
       
   485      */
       
   486     CFbsBitmap* iAppMask;
       
   487 
       
   488     /**
       
   489      * MIDlet suite security domain category
       
   490      * Owned
       
   491      */
       
   492     std::wstring iSecurityDomainCategory;
       
   493 
       
   494     /**
       
   495      * MIDlet suite security domain name
       
   496      * Owned
       
   497      */
       
   498     std::wstring iSecurityDomainName;
       
   499 
       
   500     /**
       
   501      * Installer launcher
       
   502      * Owned
       
   503      */
       
   504     SwiUI::RSWInstLauncher* iSWInstLauncher;
       
   505 
       
   506     /**
       
   507      * Info iterator
       
   508      * Owned
       
   509      */
       
   510     CAppMngr2MidletInfoIterator* iInfoIterator;
       
   511 
       
   512     /**
       
   513      * Is DRM protected
       
   514      */
       
   515     TBool iIsDRMProtected;
       
   516 
       
   517     /**
       
   518      * Is DRM right object missing or expired
       
   519      */
       
   520     TBool iIsROMissingOrExpired;
       
   521 
       
   522     /**
       
   523      * Certificates info
       
   524      * Owned
       
   525      */
       
   526     RPointerArray<SwiUI::CommonUI::CCUICertificateInfo> iCertificates;
       
   527 
       
   528     /**
       
   529      * Certificates has been already read
       
   530      */
       
   531     TBool iCertsRead;
       
   532     CAppMngr2MidletResourceHandler& iResourceHandler;
       
   533 };
       
   534 
       
   535 #endif // APPMNGR2MIDLETAPPINFO_H
       
   536