javamanager/javainstaller/javasifplugin/inc/javasifplugin.h
branchRCL_3
changeset 60 6c158198356e
parent 19 04becd199f91
child 83 26b2b12093af
equal deleted inserted replaced
59:e5618cc85d74 60:6c158198356e
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    20 
    20 
    21 #ifndef JAVASIFPLUGIN_H
    21 #ifndef JAVASIFPLUGIN_H
    22 #define JAVASIFPLUGIN_H
    22 #define JAVASIFPLUGIN_H
    23 
    23 
    24 #include <e32base.h>
    24 #include <e32base.h>
       
    25 #include <hbdevicenotificationdialogsymbian.h>
    25 #include <usif/sif/sifplugin.h>
    26 #include <usif/sif/sifplugin.h>
    26 
    27 
       
    28 #include "asyncwaitcallback.h"
    27 #include "f32file.h"
    29 #include "f32file.h"
    28 #include "resultsserver.h"
    30 
       
    31 class ResultsServer;
    29 
    32 
    30 using namespace Usif;
    33 using namespace Usif;
    31 
    34 
    32 /**
    35 /**
    33  * The messages known by JavaSifPlugin.
    36  * The messages known by JavaSifPlugin.
    34  */
    37  */
    35 
    38 
    36 const int INSTALLER_CANCEL_MESSAGE_ID = 603;
    39 const int INSTALLER_CANCEL_MESSAGE_ID = 603;
    37 const int INSTALLER_CANCEL_RESPONSE_MESSAGE_ID = 604;
    40 const int INSTALLER_CANCEL_RESPONSE_MESSAGE_ID = 604;
    38 
    41 
    39 namespace Java
    42 namespace java
    40 {
    43 {
    41 namespace Installer
    44 namespace installer
    42 {
    45 {
    43 
    46 
    44 /**
    47 /**
    45  * This class implements the ECom KUidSifPlugin interface for midlet
    48  * This class implements the ECom KUidSifPlugin interface for midlet
    46  * installation for OMJ.
    49  * installation for OMJ.
   193      *  This is a synchronous call. When it returns the original asynchronous call is completed.
   196      *  This is a synchronous call. When it returns the original asynchronous call is completed.
   194      */
   197      */
   195     virtual void CancelOperation();
   198     virtual void CancelOperation();
   196 
   199 
   197 
   200 
       
   201     /**
       
   202      * Hides 'preparing installation' dialog.
       
   203      */
       
   204     void HidePrepInstDialogL();
       
   205 
   198 private:
   206 private:
   199 
   207 
   200     /**
   208     /**
   201      * Constructor.
   209      * Constructor.
   202      */
   210      */
   219      *  will be copied to tmp directory in Java Installer data cage
   227      *  will be copied to tmp directory in Java Installer data cage
   220      *  if needed. In this case aFileName is changed also.
   228      *  if needed. In this case aFileName is changed also.
   221      */
   229      */
   222     void CopyFilesIfNeededL(TFileName &aFileName);
   230     void CopyFilesIfNeededL(TFileName &aFileName);
   223 
   231 
       
   232     /**
       
   233      * Check if the file is Jad file. Argument KSifInParam_MimeType is
       
   234      * used for check if it exists.
       
   235      *
       
   236      * @param[in] aFileHandle the file to be checked
       
   237      * @param[in] aArguments Install request arguments
       
   238      * @param[out] aIsJad set to ETrue if the file is Jad file
       
   239      * @return KErrNone or Symbian error code
       
   240      */
       
   241     TInt IsJadFile(RFile& aFileHandle, const COpaqueNamedParams& aArguments, TBool& aIsJad);
       
   242 
       
   243     /**
       
   244      * Check if the file is Jad file.
       
   245      *
       
   246      * @param[in] aFileHandle the file to be checked
       
   247      * @param[out] aIsJad set to ETrue if the file is Jad file
       
   248      * @return KErrNone or Symbian error code
       
   249      */
       
   250     TInt IsJadFile(RFile& aFileHandle, TBool& aIsJad);
       
   251 
       
   252     /**
       
   253      * Uses the information in aArguments to create the correct command line for
       
   254      * Java Installer.
       
   255      *
       
   256      * @param[in][out] aCommandLine the buffer to be filled with command line arguments
       
   257      * @param[in]      aArguments The array of opaque params for the plug-in. An empty
       
   258      *   array may be passed.  The following param is defined for the "SCOMO Install
       
   259      *   Inactive" operation:
       
   260      *   Name: InstallInactive, Type: Int, Value: ETrue
       
   261      *   If a plug-in receives this param, it must install a component normally but the SCOMO
       
   262      *   State should remain EDeactivated.
       
   263      */
       
   264     void BuildInstallCommandLine(
       
   265         TPtr& aCommandLine,
       
   266         const COpaqueNamedParams& aArguments);
       
   267 
       
   268     /**
       
   269      * Returns the value of int param found from aArguments or -1 if
       
   270      * the param is not found. Must be called only for int params
       
   271      * that have positive value range!
       
   272      *
       
   273      * @param[in] aName The name of the integer param to be obtained.
       
   274      * @param[in] aArguments The array of opaque params for the plug-in.
       
   275      * @return -1 if the named param if not found, otherwise the value of the
       
   276      */
       
   277     TInt GetPositiveIntParam(
       
   278         const TDesC& aName,
       
   279         const COpaqueNamedParams& aArguments);
       
   280 
       
   281     /**
       
   282      * Start ResultsServer for receiving Comms message(s) from
       
   283      * Java Installer
       
   284      *
       
   285      * @param[in][out] aResults If Comms message contains installation or
       
   286      *  uninstallation operation results, they will be stored in this variable
       
   287      * @param[in][out] aComponentInfo If Comms message contains contains details of
       
   288      *  a component, they will be stored into this variable
       
   289      * @return
       
   290      */
       
   291     TInt StartResultsServer(
       
   292         COpaqueNamedParams& aResults,
       
   293         CComponentInfo& aComponentInfo);
       
   294 
       
   295     /**
       
   296      * If Java Installer is already running, set error category EInstallerBusy etc
       
   297      * to aResults, set aStatus to KErrAlreadyExists and return ETrue
       
   298      * @param[in][out] aResults
       
   299      * @param[in][out] aStatus
       
   300      * @return ETrue if Java Installer is running
       
   301      */
       
   302     TBool ExitIfJavaInstallerRunning(
       
   303         COpaqueNamedParams& aResults,
       
   304         TRequestStatus& aStatus);
       
   305 
       
   306     /**
       
   307      * Creates 'preparing installation' dialog.
       
   308      */
       
   309     void CreatePrepInstDialogL();
   224 
   310 
   225 private: //  Data
   311 private: //  Data
   226 
   312 
   227     TRequestStatus* iStatus;
   313     RFs mRFs;
   228     RFs iRFs;
   314     RArray<RProcess> mHandlesToClose;
   229     RArray<RProcess> iHandlesToClose;
   315     ResultsServer*   mResultsServer;
   230     ResultsServer*   iResultsServer;
   316 
   231 
   317     COpaqueNamedParams* mDummyResults;
   232     COpaqueNamedParams* iDummyResults;
   318     CComponentInfo*     mDummyInfo;
   233     CComponentInfo*     iDummyInfo;
   319 
       
   320     CHbDeviceNotificationDialogSymbian* mPrepInstDialog;
       
   321     CAsyncWaitCallBack* mWaitToHideDialog;
   234 };
   322 };
   235 
   323 
   236 } // Installer
   324 } // Installer
   237 } // Java
   325 } // Java
   238 
   326