connectivitymodules/SeCon/common/conmltask/inc/sconconmltask.h
branchRCL_3
changeset 52 4f0867e42d62
parent 51 8e7494275d3a
child 56 3e6957da2ff8
equal deleted inserted replaced
51:8e7494275d3a 52:4f0867e42d62
     1 /*
       
     2 * Copyright (c) 2005-2010 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:  Header file for ConML tasks
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _SCONCONMLTASK_H_
       
    20 #define _SCONCONMLTASK_H_
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 
       
    25 const TInt KSConTaskPartiallyCompleted( 206 );
       
    26 const TInt KMaxPackageNameLength = 128;
       
    27 
       
    28 enum TSConMethodName
       
    29     {
       
    30     ECancel = 0,
       
    31     EGetDataOwnerStatus,
       
    32     EGetDataSize,
       
    33     EGetStatus,
       
    34     EInstall,
       
    35     EListDataOwners,
       
    36     EListInstalledApps,
       
    37     EListPublicFiles,
       
    38     ERequestData,
       
    39     ESetBURMode,
       
    40     ESetInstParams,
       
    41     ESupplyData,
       
    42     EUninstall,
       
    43     EUpdateDeviceInfo,
       
    44     EReboot,
       
    45     EGetMetadata
       
    46     };
       
    47 
       
    48 enum TSConInstallMode
       
    49     {
       
    50     ESilentInstall = 0,
       
    51     EUnsilentInstall,
       
    52     EUnknown
       
    53     };
       
    54     
       
    55 enum TSConUserPerm
       
    56     {
       
    57     EPermReadOnly = 0,
       
    58     EPermNormal
       
    59     };
       
    60     
       
    61 enum TSConDOType
       
    62     {
       
    63     EActiveDataOwner = 1,
       
    64     EPassiveDataOwner,
       
    65     EHybridDataOwner
       
    66     };
       
    67     
       
    68 enum TSConHasFiles
       
    69     {
       
    70     ENoFiles = 0,
       
    71     EPublicFiles,
       
    72     ESystemFiles,
       
    73     EPublicSystemFiles
       
    74     };
       
    75     
       
    76 enum TSConAppType
       
    77     {
       
    78     ESisApplication = 0,
       
    79     ESisAugmentation,
       
    80     EJavaApplication,
       
    81     EWidgetApplication
       
    82     };
       
    83 
       
    84 enum TSConBurMode
       
    85     {
       
    86     ESConBurNormal = 1,     // 1 BUR mode - normal
       
    87     ESConBurBackupFull,     // 2 BUR mode – backup full
       
    88     ESConBurBackupPartial,  // 3 BUR mode – backup partial
       
    89     ESConBurRestoreFull,    // 4 BUR mode – restore full
       
    90     ESConBurRestorePartial  // 5 BUR mode – restore partial
       
    91     };
       
    92 
       
    93 enum TSConIncType
       
    94     {
       
    95     ESConNoBackup = 0,          // 0   No backup
       
    96     ESConBackupBase = 100,      // 100 Backup – base
       
    97     ESConBackupIncrement = 200  // 200 Backup - increment
       
    98     };
       
    99 
       
   100 enum TSConTransferDataType
       
   101     {
       
   102     ESConRegistrationData = 1,  // 1 RegistrationData
       
   103     ESConPassiveSnapshotData,   // 2 Passive snapshot data
       
   104     ESConPassiveBaseData,       // 3 Passive base data
       
   105     ESConPassiveIncrementalData,// 4 Passive incremental data 
       
   106     ESConActiveSnapshotData,    // 5 Active snapshot data
       
   107     ESConActiveBaseData,        // 6 Active base data
       
   108     ESConActiveIncrementalData, // 7 Active incremental data
       
   109     ESConSystemData,            // 8 System data
       
   110     ESConSystemSnapshotData     // 9 System snapshot data
       
   111     };
       
   112 
       
   113 enum TSConDataOwnerStatus
       
   114     {
       
   115     ESConUnset = 0,         // 0 Unset
       
   116     ESConNotFound,          // 1 Not found
       
   117     ESConReady,             // 2 Ready
       
   118     ESConNotReady,          // 3 Not ready
       
   119     ESConFailed,            // 4 Failed
       
   120     ESConNotConnected,      // 5 Not connected
       
   121     ESConNotImplemented     // 6 Not implemented
       
   122     };
       
   123 
       
   124 
       
   125 
       
   126 
       
   127 //============================================================
       
   128 // class CSConReboot declaration
       
   129 //============================================================  
       
   130 NONSHARABLE_CLASS( CSConReboot ) : public CBase
       
   131     {
       
   132     public:
       
   133         CSConReboot();      
       
   134         ~CSConReboot();
       
   135         CSConReboot* CopyL();
       
   136                     
       
   137         //used only with reply
       
   138         TBool               iComplete;      //task complete
       
   139         TInt                iProgress;      //task progress     
       
   140     };
       
   141 
       
   142 //============================================================
       
   143 // class CSConDataOwner declaration
       
   144 //============================================================  
       
   145 NONSHARABLE_CLASS( CSConDataOwner ) : public CBase
       
   146     {
       
   147     public:
       
   148         CSConDataOwner();
       
   149         ~CSConDataOwner();
       
   150         CSConDataOwner* CopyL();
       
   151     
       
   152     public:
       
   153         //dataowner type
       
   154         TSConDOType                     iType;
       
   155         //unique identifier
       
   156         TUid                            iUid;
       
   157         //drive list
       
   158         TDriveList                      iDriveList;
       
   159         //package name
       
   160         TBuf<KMaxPackageNameLength>     iPackageName;
       
   161         //requires reboot
       
   162         TBool                           iReqReboot;
       
   163         //has files 
       
   164         TSConHasFiles                   iHasFiles;
       
   165         //supports incremental backup
       
   166         TBool                           iSupportsInc;
       
   167         //supports selective backup
       
   168         TBool                           iSupportsSel;
       
   169         //delay to prepare data
       
   170         TBool                           iDelayToPrep;
       
   171         //size
       
   172         TUint                           iSize;
       
   173         //data owner status
       
   174         TSConDataOwnerStatus            iDataOwnStatus;
       
   175         //transfer data type
       
   176         TSConTransferDataType           iTransDataType;
       
   177         //Java hash
       
   178         HBufC*                          iJavaHash;
       
   179     };
       
   180         
       
   181 //============================================================
       
   182 // class CSConUpdateDeviceInfo declaration
       
   183 //============================================================      
       
   184 NONSHARABLE_CLASS( CSConUpdateDeviceInfo ) : public CBase
       
   185     {
       
   186     public:
       
   187         CSConUpdateDeviceInfo();
       
   188         ~CSConUpdateDeviceInfo();
       
   189         CSConUpdateDeviceInfo* CopyL();
       
   190 
       
   191         TBuf8<3>            iVersion;       //version number
       
   192         TBool               iInstallSupp;
       
   193         TBool               iUninstallSupp;
       
   194         TBool               iInstParamsSupp;
       
   195         TBool               iInstAppsSupp;
       
   196         TBool               iDataOwnersSupp;
       
   197         TBool               iSetBURModeSupp;
       
   198         TBool               iGetSizeSupp;
       
   199         TBool               iReqDataSupp;
       
   200         TBool               iSupplyDataSupp;
       
   201         TBool               iRebootSupp;
       
   202         TInt                iMaxObjectSize; //kBytes
       
   203         
       
   204         //used only with reply
       
   205         TBool               iComplete;      //task complete
       
   206         TInt                iProgress;      //task progress     
       
   207     };
       
   208 //============================================================
       
   209 // class CSConInstApp declaration
       
   210 //============================================================      
       
   211 NONSHARABLE_CLASS( CSConInstApp ) : public CBase 
       
   212     {
       
   213     public:
       
   214         CSConInstApp() {};
       
   215         ~CSConInstApp();
       
   216         CSConInstApp* CopyL();
       
   217         
       
   218         TFileName       iName;
       
   219         TFileName       iParentName;
       
   220         TFileName       iVendor;
       
   221         TFileName       iVersion;
       
   222         TInt64          iSize;
       
   223         TSConAppType    iType;
       
   224         TUid            iUid;
       
   225         HBufC*          iWidgetBundleId; // Widget bundle identifier like "com.nokia.widget.HelloWorld"
       
   226     };
       
   227     
       
   228 //============================================================
       
   229 // class CSConListInstApps declaration
       
   230 //============================================================      
       
   231 NONSHARABLE_CLASS( CSConListInstApps ) : public CBase
       
   232     {
       
   233     public:
       
   234         CSConListInstApps();
       
   235         ~CSConListInstApps();
       
   236         CSConListInstApps* CopyL();
       
   237             
       
   238         TBool                   iAllApps;       //list all apps
       
   239         TDriveList              iDriveList;     //drive list
       
   240 
       
   241         //used only with reply
       
   242         TBool               iComplete;      //task complete
       
   243         TInt                iProgress;      //task progress 
       
   244                 
       
   245         RPointerArray<CSConInstApp>     iApps; //installed apps
       
   246     };
       
   247     
       
   248 //============================================================
       
   249 // class CSConGetStatus declaration
       
   250 //============================================================      
       
   251 NONSHARABLE_CLASS( CSConGetStatus ) : public CBase
       
   252     {
       
   253     public:
       
   254         TBool               iAll;           //list all statuses
       
   255         TInt                iTaskId;        //task id
       
   256     };  
       
   257     
       
   258 //============================================================
       
   259 // class CSConFile declaration
       
   260 //============================================================      
       
   261 NONSHARABLE_CLASS( CSConFile ) : public CBase
       
   262     {
       
   263     public:
       
   264         CSConFile();
       
   265         ~CSConFile();
       
   266         CSConFile* CopyL();     
       
   267             
       
   268         TFileName                   iPath;      //file path + name
       
   269         TBuf<KMaxTimeFormatSpec>    iModified;  //modified date
       
   270         TUint                       iSize;      //file size
       
   271         TSConUserPerm               iUserPerm;  //user permission
       
   272     };  
       
   273     
       
   274 //============================================================
       
   275 // class CSConInstall declaration
       
   276 //============================================================      
       
   277 NONSHARABLE_CLASS( CSConInstall ) : public CBase
       
   278     {
       
   279     public:
       
   280         CSConInstall();
       
   281         ~CSConInstall();
       
   282             
       
   283         CSConInstall* CopyL();
       
   284             
       
   285         TFileName           iPath;          //path to file
       
   286         TSConInstallMode    iMode;          //install mode
       
   287         
       
   288         //used only with reply
       
   289         TBool               iComplete;      //task complete
       
   290         TInt                iProgress;      //task progress 
       
   291         HBufC8*             iData;
       
   292     };  
       
   293     
       
   294 //============================================================
       
   295 // class CSConUninstall declaration
       
   296 //============================================================      
       
   297 NONSHARABLE_CLASS( CSConUninstall ) : public CBase
       
   298     {
       
   299     public:
       
   300         CSConUninstall();
       
   301         ~CSConUninstall();
       
   302             
       
   303         CSConUninstall* CopyL();
       
   304             
       
   305         TFileName           iName;          // application name
       
   306         TFileName           iVendor;        // application vendor
       
   307         TUid                iUid;           // application uid
       
   308         TSConAppType    	iType;			// application type
       
   309         TSConInstallMode    iMode;          // install mode
       
   310         
       
   311         //used only with reply
       
   312         TBool               iComplete;      //task complete
       
   313         TInt                iProgress;      //task progress 
       
   314         HBufC8*             iData;
       
   315     };  
       
   316     
       
   317 //============================================================
       
   318 // class CSConListDataOwners declaration
       
   319 //============================================================      
       
   320 NONSHARABLE_CLASS( CSConListDataOwners ) : public CBase
       
   321     {
       
   322     public:
       
   323         CSConListDataOwners();
       
   324         ~CSConListDataOwners();         
       
   325         CSConListDataOwners* CopyL();           
       
   326         void DeleteDataOwners();
       
   327             
       
   328         //used only with reply
       
   329         TBool               iComplete;      //task complete
       
   330         TInt                iProgress;      //task progress 
       
   331         
       
   332         RPointerArray<CSConDataOwner>   iDataOwners;    //data owners
       
   333     };
       
   334     
       
   335 //============================================================
       
   336 // class CSConSetBURMode declaration
       
   337 //============================================================      
       
   338 NONSHARABLE_CLASS( CSConSetBURMode ) : public CBase
       
   339     {
       
   340     public:
       
   341         TDriveList          iDriveList;     //drive list
       
   342         TSConBurMode        iPartialType;   //partial backup type
       
   343         TSConIncType        iIncType;       //incremental backup type
       
   344         
       
   345         CSConSetBURMode();
       
   346         ~CSConSetBURMode();     
       
   347         CSConSetBURMode* CopyL();
       
   348         
       
   349         //used only with reply
       
   350         TBool               iComplete;      //task complete
       
   351         TInt                iProgress;      //task progress 
       
   352     };
       
   353 
       
   354 //============================================================
       
   355 // class CSConGetDataSize declaration
       
   356 //============================================================  
       
   357 NONSHARABLE_CLASS( CSConGetDataSize ) : public CBase
       
   358     {
       
   359     public:
       
   360         CSConGetDataSize();
       
   361         ~CSConGetDataSize();
       
   362         
       
   363         CSConGetDataSize* CopyL();          
       
   364         void DeleteDataOwners();
       
   365             
       
   366     public:
       
   367         RPointerArray<CSConDataOwner> iDataOwners;  //data owners
       
   368         
       
   369         //used only with reply
       
   370         TBool               iComplete;      //task complete
       
   371         TInt                iProgress;      //task progress 
       
   372     };
       
   373     
       
   374 //============================================================
       
   375 // class CSConListPublicFiles declaration
       
   376 //============================================================  
       
   377 NONSHARABLE_CLASS( CSConListPublicFiles ) : public CBase
       
   378     {
       
   379     public:
       
   380         CSConListPublicFiles();
       
   381         ~CSConListPublicFiles();            
       
   382         CSConListPublicFiles* CopyL();
       
   383         
       
   384     public:
       
   385         RPointerArray<CSConFile>        iFiles;         //data owners
       
   386         RPointerArray<CSConDataOwner>   iDataOwners;    //data owners
       
   387         
       
   388         //used only with reply
       
   389         TBool               iComplete;      //task complete
       
   390         TInt                iProgress;      //task progress 
       
   391     };
       
   392     
       
   393 //============================================================
       
   394 // class CSConRequestData declaration
       
   395 //============================================================  
       
   396 NONSHARABLE_CLASS( CSConRequestData ) : public CBase
       
   397     {
       
   398     public:
       
   399         CSConRequestData();         
       
   400         ~CSConRequestData();            
       
   401         CSConRequestData* CopyL();          
       
   402         void DeleteDataAndDataOwner();
       
   403             
       
   404         CSConDataOwner*     iDataOwner;     //data owner
       
   405         HBufC8*             iBackupData;    //backup data
       
   406         TBool               iMoreData;      //more data
       
   407         
       
   408         //used only with reply
       
   409         TBool               iComplete;      //task complete
       
   410         TInt                iProgress;      //task progress 
       
   411     };
       
   412     
       
   413 //============================================================
       
   414 // class CSConGetDataOwnerStatus declaration
       
   415 //============================================================  
       
   416 NONSHARABLE_CLASS( CSConGetDataOwnerStatus ) : public CBase
       
   417     {
       
   418     public:
       
   419         CSConGetDataOwnerStatus();
       
   420         ~CSConGetDataOwnerStatus();         
       
   421         CSConGetDataOwnerStatus* CopyL();
       
   422         void DeleteDataOwners();
       
   423             
       
   424     public:
       
   425         RPointerArray<CSConDataOwner> iDataOwners;  //data owners
       
   426         
       
   427         //used only with reply
       
   428         TBool               iComplete;      //task complete
       
   429         TInt                iProgress;      //task progress 
       
   430     };
       
   431 
       
   432 //============================================================
       
   433 // class CSConSupplyData declaration
       
   434 //============================================================  
       
   435 NONSHARABLE_CLASS( CSConSupplyData ) : public CBase
       
   436     {
       
   437     public:
       
   438         CSConSupplyData();
       
   439         ~CSConSupplyData();         
       
   440         CSConSupplyData* CopyL();
       
   441     public:
       
   442         CSConDataOwner*     iDataOwner;
       
   443         HBufC8*             iRestoreData;   //restore data
       
   444         TBool               iMoreData;      //more data     
       
   445         //used only with reply
       
   446         TBool               iComplete;      //task complete
       
   447         TInt                iProgress;      //task progress 
       
   448     };
       
   449 
       
   450 //============================================================
       
   451 // class CSConGetMetadata declaration
       
   452 //============================================================
       
   453 NONSHARABLE_CLASS( CSConGetMetadata ) : public CBase
       
   454     {
       
   455     public:
       
   456         CSConGetMetadata();
       
   457         ~CSConGetMetadata();            
       
   458         CSConGetMetadata* CopyL();
       
   459     public:
       
   460         TFileName           iFilename;
       
   461         HBufC8*             iData;          //metadata
       
   462         TBool               iMoreData;      //more data     
       
   463         //used only with reply
       
   464         TBool               iComplete;      //task complete
       
   465         TInt                iProgress;      //task progress 
       
   466     };
       
   467 
       
   468 //============================================================
       
   469 // class CSConTask declaration
       
   470 //============================================================  
       
   471 NONSHARABLE_CLASS( CSConTask ): public CBase
       
   472     {
       
   473     public:
       
   474         /**
       
   475         * Two-phase constructor
       
   476         * @return CSConTask instance
       
   477         */
       
   478         static CSConTask* NewL( TSConMethodName aMethod );
       
   479         static CSConTask* NewLC( TSConMethodName aMethod );
       
   480 
       
   481         CSConTask();
       
   482         ~CSConTask();
       
   483         TSConMethodName GetServiceId() const;
       
   484         CSConTask* CopyL() const;
       
   485         TBool GetComplete();
       
   486         void SetCompleteValue( TBool aValue );
       
   487         TBool GetCompleteValue();
       
   488         void SetProgressValue( TInt aValue );
       
   489     private:
       
   490         
       
   491         void ConstructL( TSConMethodName aMethod );                
       
   492     public:
       
   493         //Task
       
   494         //service id
       
   495         TSConMethodName             iMethod;
       
   496         //task number
       
   497         TInt                        iTaskId;            
       
   498         
       
   499         //DeviceInfo -params
       
   500         CSConUpdateDeviceInfo*      iDevInfoParams;
       
   501         //ListInstalledTasks -params
       
   502         CSConListInstApps*          iListAppsParams;
       
   503         //GetStatus -params
       
   504         CSConGetStatus*             iGetStatusParams;
       
   505         //Install -params
       
   506         CSConInstall*               iInstallParams; 
       
   507         //Uninstall -params 
       
   508         CSConUninstall*             iUninstallParams;
       
   509         //SetBURMode -params
       
   510         CSConSetBURMode*            iBURModeParams;
       
   511         //GetDataSize -params
       
   512         CSConGetDataSize*           iGetDataSizeParams;
       
   513         //RequestData -params
       
   514         CSConRequestData*           iRequestDataParams; 
       
   515         //GetDataOwnerStatus -params
       
   516         CSConGetDataOwnerStatus*    iGetDataOwnerParams;
       
   517         //SupplyData -params
       
   518         CSConSupplyData*            iSupplyDataParams;
       
   519         //ListPublicFiles -params
       
   520         CSConListPublicFiles*       iPubFilesParams;
       
   521         //ListDataOwners -params
       
   522         CSConListDataOwners*        iListDataOwnersParams;
       
   523         //Reboot -params
       
   524         CSConReboot*                iRebootParams;
       
   525         //GetMetadata -params
       
   526         CSConGetMetadata*           iGetMetadataParams;
       
   527         
       
   528         TInt                        iCancelTaskId;
       
   529         TBool                       iCancelTaskAll;
       
   530     };
       
   531     
       
   532 //============================================================
       
   533 // class CSConTaskReply declaration
       
   534 //============================================================
       
   535 NONSHARABLE_CLASS( CSConTaskReply ) : public CBase
       
   536     {
       
   537     public:
       
   538         CSConTaskReply();
       
   539         CSConTaskReply( TSConMethodName aMethod );
       
   540         ~CSConTaskReply();
       
   541         void InitializeL( const CSConTask& aTask );   
       
   542         void InitializeL( TSConMethodName aMethod, 
       
   543             TInt aProgress, TBool aComplete );           
       
   544         CSConTaskReply* CopyAndFreeL();
       
   545         void CleanTaskData();
       
   546             
       
   547     public:
       
   548         //task id number
       
   549         TInt                        iTaskId;
       
   550         //method type
       
   551         TSConMethodName             iMethod;
       
   552         
       
   553         //DeviceInfo -params
       
   554         CSConUpdateDeviceInfo*      iDevInfoParams;
       
   555         //ListInstalledTasks -params
       
   556         CSConListInstApps*          iListAppsParams;
       
   557         //GetStatus -params
       
   558         CSConGetStatus*             iGetStatusParams;
       
   559         //Install -params
       
   560         CSConInstall*               iInstallParams;
       
   561         //Uninstall -params
       
   562         CSConUninstall*             iUninstallParams;
       
   563         //SetBURMode -params
       
   564         CSConSetBURMode*            iBURModeParams;
       
   565         //GetDataSize -params
       
   566         CSConGetDataSize*           iGetDataSizeParams;
       
   567         //RequestData -params
       
   568         CSConRequestData*           iRequestDataParams;
       
   569         //GetDataOwnerStatus -params
       
   570         CSConGetDataOwnerStatus*    iGetDataOwnerParams;
       
   571         //SupplyData -params
       
   572         CSConSupplyData*            iSupplyDataParams;
       
   573         //ListPublicFiles -params
       
   574         CSConListPublicFiles*       iPubFilesParams;
       
   575         //ListDataOwners -params
       
   576         CSConListDataOwners*        iListDataOwnersParams;
       
   577         //Reboot -params
       
   578         CSConReboot*                iRebootParams;
       
   579         //GetMetadata -params
       
   580         CSConGetMetadata*           iGetMetadataParams;
       
   581     };      
       
   582     
       
   583 //============================================================
       
   584 // class CSConStatusReply declaration
       
   585 //============================================================
       
   586 NONSHARABLE_CLASS( CSConStatusReply ): public CBase
       
   587     {
       
   588     public:
       
   589         CSConStatusReply();
       
   590         ~CSConStatusReply();
       
   591             
       
   592     public:
       
   593         TBool                           iNoTasks;       //no active tasks
       
   594         RPointerArray<CSConTaskReply>   iTasks;
       
   595     };
       
   596 
       
   597 #endif
       
   598 
       
   599 // End of file
       
   600