applicationmanagement/server/inc/ApplicationManagementServer.h
branchRCL_3
changeset 58 5b858729772b
parent 57 6757f1e2efd2
equal deleted inserted replaced
57:6757f1e2efd2 58:5b858729772b
    26 #include <ssl.h>
    26 #include <ssl.h>
    27 #include <swi/launcher.h>
    27 #include <swi/launcher.h>
    28 #include <swi/sisregistrysession.h>
    28 #include <swi/sisregistrysession.h>
    29 #include <swi/sisregistrypackage.h>
    29 #include <swi/sisregistrypackage.h>
    30 #include <swi/sisregistryentry.h>
    30 #include <swi/sisregistryentry.h>
    31 #include <hbprogressdialog.h>
    31 #include <downloadmgrclient.h>
    32 #include <hbmainwindow.h>
    32 
    33 #include <hbaction.h>
       
    34 #include <usif/sif/sif.h>
       
    35 #include <SWInstApi.h>
       
    36 #include <QGraphicsLinearLayout>
       
    37 #include "ApplicationManagementClientServer.h"
    33 #include "ApplicationManagementClientServer.h"
    38 #include "PlatformSecurityPolicies.h"
    34 #include "PlatformSecurityPolicies.h"
    39 #include "AMDeploymentComponent.h"
    35 #include "AMDeploymentComponent.h"
    40 #include "amstorage.h"
    36 #include "amstorage.h"
    41 #include "ApplicationManagementUtility.h"
    37 #include "ApplicationManagementUtility.h"
    42 #include "AMDownloaddb.h"
    38 #include "AMDownloaddb.h"
    43 #include "amwaitprogdialog.h"
    39 
    44 #include "AMDownloadStore.h"
    40 #include "AMDownloadManager.h"
    45 
       
    46 // CONSTANTS
    41 // CONSTANTS
    47 const TUid NProperty = {0x200267FB};
       
    48 const TUint32 NInteger = 0x00000001;
       
    49 const TInt KBase64BufSize = 131072;
    42 const TInt KBase64BufSize = 131072;
    50 const QString path = "z:/resource/qt/translations/";
       
    51 class CAppMgmtSrvApp;
    43 class CAppMgmtSrvApp;
    52 _LIT(KIndicatorParamDownloading, "Downloading");
    44 
    53 namespace NApplicationManagement
    45 namespace NApplicationManagement
    54     {
    46     {
    55 
    47 
    56     // -----------------------------------------------------------
    48     // -----------------------------------------------------------
    57     // ApplicationManagement server panic codes
    49     // ApplicationManagement server panic codes
    61         EPanicGeneral,
    53         EPanicGeneral,
    62         EBadSubsessionHandle,
    54         EBadSubsessionHandle,
    63         EPanicIllegalFunction,
    55         EPanicIllegalFunction,
    64         EBadDescriptor
    56         EBadDescriptor
    65         };
    57         };
    66     // -----------------------------------------------------------
    58 
    67     // Wait dialog types
       
    68     // -----------------------------------------------------------
       
    69     enum TDialogType
       
    70         {
       
    71         EInstallWaitDlg,
       
    72         EUninstallWaitDlg
       
    73         };
       
    74     // FUNCTION PROTOTYPES
    59     // FUNCTION PROTOTYPES
    75 
    60 
    76     void PanicClient(const RMessagePtr2& aMessage,
    61     void PanicClient(const RMessagePtr2& aMessage,
    77             TApplicationManagementPanic aPanic);
    62             TApplicationManagementPanic aPanic);
    78 
    63 
    95     /**
    80     /**
    96      *  CApplicationManagementServer 
    81      *  CApplicationManagementServer 
    97      *  Description.
    82      *  Description.
    98      */
    83      */
    99 
    84 
   100     class CApplicationManagementServer : public CPolicyServer,
    85     class CApplicationManagementServer : public CAknAppServer,
   101         public MDownloadMngrObserver,public MInstallerCallBack
    86         public MDownloadMngrObserver
   102         {
    87         {
   103 public:
    88 public:
   104         static CServer2* NewL(HbMainWindow *mainWindow);
    89         static CApplicationManagementServer* NewL();
   105         ~CApplicationManagementServer();
    90         ~CApplicationManagementServer();
   106 
    91 
   107         void Panic(TInt aPanicCode);
    92         void Panic(TInt aPanicCode);
   108         void AddSession();
    93         void AddSession();
   109         void DropSession();
    94         void DropSession();
   110         
    95 
   111         CPolicyServer::TCustomResult CreateServiceSecurityCheckL(
    96         CPolicyServer::TCustomResult CreateServiceSecurityCheckL(
   112                 TUid aServiceType, const RMessage2& aMsg, TInt& aAction,
    97                 TUid aServiceType, const RMessage2& aMsg, TInt& aAction,
   113                 TSecurityInfo& aMissing);
    98                 TSecurityInfo& aMissing);
   114 private:
    99 private:
   115 
   100 
   116         CApplicationManagementServer();
   101         CApplicationManagementServer();
   117         virtual void ConstructL(HbMainWindow *mainWindow);
   102         virtual void ConstructL(const TDesC &aServerName);
   118         CSession2* NewSessionL(const TVersion& aVersion, 
   103         /*CSession2* NewSessionL(const TVersion& aVersion, 
   119          const RMessage2& aMessage) const;
   104          const RMessage2& aMessage) const;*/
   120 
   105 
   121         //From CPolicyServer
   106         //From CPolicyServer
   122         CPolicyServer::TCustomResult
   107         CPolicyServer::TCustomResult
   123                 CustomSecurityCheckL(const RMessage2& aMsg, TInt& aAction,
   108                 CustomSecurityCheckL(const RMessage2& aMsg, TInt& aAction,
   124                         TSecurityInfo& aMissing);
   109                         TSecurityInfo& aMissing);
   254         void ComponentDownloadFailed(CDeploymentComponent *aComponent,
   239         void ComponentDownloadFailed(CDeploymentComponent *aComponent,
   255                 TInt aReason);
   240                 TInt aReason);
   256 
   241 
   257         void StartShutDownTimerL();
   242         void StartShutDownTimerL();
   258 
   243 
       
   244         void SendServerToBackground();
       
   245 
       
   246         void BringServertoForeground();
       
   247 
       
   248         void BringDMUItoForeground();
   259         TBool IsInstalledAppRemovableL(TDriveNumber &iDrive);
   249         TBool IsInstalledAppRemovableL(TDriveNumber &iDrive);
   260 
   250 
   261 	  void InstallationCancelled();
       
   262 private:
   251 private:
   263 
   252 
   264         /**
   253         /**
   265          * FullUpdateL updates target with source
   254          * FullUpdateL updates target with source
   266          * @param sid Source deployment component 
   255          * @param sid Source deployment component 
   346         void GenerateTempFileNameL(RFs &aFs,
   335         void GenerateTempFileNameL(RFs &aFs,
   347                 const CDeploymentComponent& aCompo, TFileName &aFileName,
   336                 const CDeploymentComponent& aCompo, TFileName &aFileName,
   348                 TFileName &aMetaFileName) const;
   337                 TFileName &aMetaFileName) const;
   349 
   338 
   350         CApaAppServiceBase* CreateServiceL(TUid aServiceType) const;
   339         CApaAppServiceBase* CreateServiceL(TUid aServiceType) const;
   351 public:
   340 
       
   341 public:
       
   342 
   352         CAppMgmtSrvApp* iParentApp;
   343         CAppMgmtSrvApp* iParentApp;
   353 private:
   344 
       
   345 private:
       
   346 
   354         TInt iSessionCount;
   347         TInt iSessionCount;
   355         CShutdown iShutdown;
   348         CShutdown iShutdown;
   356         CApplicationManagementUtility* iUtility;
   349         CApplicationManagementUtility* iUtility;
   357         CDeliveryComponentStorage *iStorage;
   350         CDeliveryComponentStorage *iStorage;
   358         TBool iInstallInProgress;
   351         TBool iInstallInProgress;
   359 
   352 
   360         Usif::RSoftwareInstall iInstaller;
   353         //SwiUI::RSWInstSilentLauncher iInstaller;
   361         Usif::COpaqueNamedParams *iArgu;
   354         SwiUI::RSWInstLauncher iInstaller;
   362         Usif::COpaqueNamedParams *iResults;
       
   363         SwiUI::TInstallOptionsPckg iInstallOptions;
   355         SwiUI::TInstallOptionsPckg iInstallOptions;
   364         SwiUI::TUninstallOptionsPckg iUninstallOptions;
   356         SwiUI::TUninstallOptionsPckg iUninstallOptions;
   365         SwiUI::TInstallReqPckg iInstallReq;
   357         SwiUI::TInstallReqPckg iInstallReq;
   366         TFileName iAppname;
   358 
   367         RFs iInstallRFs;
   359         RFs iInstallRFs;
   368         RFile iInstallFile;
   360         RFile iInstallFile;
   369         CAMDownloadStore* iDownloadMngr;
   361 
       
   362         CAMDownloadManager* iDownloadMngr;
       
   363 
   370         CAMDownloaddb* iAMServerDB;
   364         CAMDownloaddb* iAMServerDB;
   371         TBool iOMASCOMOEnabled;
   365         TBool iOMASCOMOEnabled;
   372         
   366 
   373         appmgmtdownloadmgr* m_DownloadMngr;
       
   374         QString m_appName;
       
   375         AMWaitProgDialog* m_Dlg;
       
   376         CDeploymentComponent* iComp;
       
   377         HbMainWindow* m_Window;
       
   378         int mUserCancelled;
       
   379         };
   367         };
   380 
   368 
   381     namespace NPolicyConstants
   369     namespace NPolicyConstants
   382         {
   370         {
   383 
   371 
   388             _LIT8( KUse, "Use" );
   376             _LIT8( KUse, "Use" );
   389             }
   377             }
   390         _LIT8( KResourceValue, "ApplicationManagement" );
   378         _LIT8( KResourceValue, "ApplicationManagement" );
   391         }
   379         }
   392 
   380 
   393     class CApplicationManagementSession : public CSession2
   381     class CApplicationManagementSession : public CAknAppServiceBase
   394         {
   382         {
   395 public:
   383 public:
   396         inline CApplicationManagementSession();
   384         inline CApplicationManagementSession();
   397         inline CApplicationManagementSession(const TCertInfo &aInfo);
   385         inline CApplicationManagementSession(const TCertInfo &aInfo);
   398         void CreateL();
   386         void CreateL();
   444                 RComponentIdArray &aArr,TDeploymentComponentState &aState) const;
   432                 RComponentIdArray &aArr,TDeploymentComponentState &aState) const;
   445 
   433 
   446         void GenericAlertSentForIdL(const RMessage2& aMessage) const;
   434         void GenericAlertSentForIdL(const RMessage2& aMessage) const;
   447 
   435 
   448         void CheckStatusNodesValuesL();
   436         void CheckStatusNodesValuesL();
       
   437         
       
   438         void SetSCOMOTargetURI(const TDesC8& aURI) const;
   449 
   439 
   450 private:
   440 private:
   451         void LookupSisRegistryL();
   441         void LookupSisRegistryL();
   452 
   442 
   453         TCertInfo iCertInfo;
   443         TCertInfo iCertInfo;
   454         TBool iTrustAdded;
   444         TBool iTrustAdded;
   455         
       
   456         };
   445         };
   457 
   446 
   458     }
   447     }
   459 #endif //__APPLICATIONMANAGEMENTSERVER_H__
   448 #endif //__APPLICATIONMANAGEMENTSERVER_H__
   460 //  End of File
   449 //  End of File