connectivitymodules/SeCon/common/conmltask/inc/sconconmltask.h
changeset 0 d0791faffa3f
child 18 453dfc402455
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     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:  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     };
       
   226     
       
   227 //============================================================
       
   228 // class CSConListInstApps declaration
       
   229 //============================================================      
       
   230 NONSHARABLE_CLASS( CSConListInstApps ) : public CBase
       
   231     {
       
   232     public:
       
   233         CSConListInstApps();
       
   234         ~CSConListInstApps();
       
   235         CSConListInstApps* CopyL();
       
   236             
       
   237         TBool                   iAllApps;       //list all apps
       
   238         TDriveList              iDriveList;     //drive list
       
   239 
       
   240         //used only with reply
       
   241         TBool               iComplete;      //task complete
       
   242         TInt                iProgress;      //task progress 
       
   243                 
       
   244         RPointerArray<CSConInstApp>     iApps; //installed apps
       
   245     };
       
   246     
       
   247 //============================================================
       
   248 // class CSConGetStatus declaration
       
   249 //============================================================      
       
   250 NONSHARABLE_CLASS( CSConGetStatus ) : public CBase
       
   251     {
       
   252     public:
       
   253         TBool               iAll;           //list all statuses
       
   254         TInt                iTaskId;        //task id
       
   255     };  
       
   256     
       
   257 //============================================================
       
   258 // class CSConFile declaration
       
   259 //============================================================      
       
   260 NONSHARABLE_CLASS( CSConFile ) : public CBase
       
   261     {
       
   262     public:
       
   263         CSConFile();
       
   264         ~CSConFile();
       
   265         CSConFile* CopyL();     
       
   266             
       
   267         TFileName                   iPath;      //file path + name
       
   268         TBuf<KMaxTimeFormatSpec>    iModified;  //modified date
       
   269         TUint                       iSize;      //file size
       
   270         TSConUserPerm               iUserPerm;  //user permission
       
   271     };  
       
   272     
       
   273 //============================================================
       
   274 // class CSConInstall declaration
       
   275 //============================================================      
       
   276 NONSHARABLE_CLASS( CSConInstall ) : public CBase
       
   277     {
       
   278     public:
       
   279         CSConInstall();
       
   280         ~CSConInstall();
       
   281             
       
   282         CSConInstall* CopyL();
       
   283             
       
   284         TFileName           iPath;          //path to file
       
   285         TSConInstallMode    iMode;          //install mode
       
   286         
       
   287         //used only with reply
       
   288         TBool               iComplete;      //task complete
       
   289         TInt                iProgress;      //task progress 
       
   290     };  
       
   291     
       
   292 //============================================================
       
   293 // class CSConUninstall declaration
       
   294 //============================================================      
       
   295 NONSHARABLE_CLASS( CSConUninstall ) : public CBase
       
   296     {
       
   297     public:
       
   298         CSConUninstall();
       
   299         ~CSConUninstall();
       
   300             
       
   301         CSConUninstall* CopyL();
       
   302             
       
   303         TFileName           iName;          // application name
       
   304         TFileName           iVendor;        // application vendor
       
   305         TUid                iUid;           // application uid
       
   306         TSConAppType    	iType;			// application type
       
   307         TSConInstallMode    iMode;          // install mode
       
   308         
       
   309         //used only with reply
       
   310         TBool               iComplete;      //task complete
       
   311         TInt                iProgress;      //task progress 
       
   312     };  
       
   313     
       
   314 //============================================================
       
   315 // class CSConListDataOwners declaration
       
   316 //============================================================      
       
   317 NONSHARABLE_CLASS( CSConListDataOwners ) : public CBase
       
   318     {
       
   319     public:
       
   320         CSConListDataOwners();
       
   321         ~CSConListDataOwners();         
       
   322         CSConListDataOwners* CopyL();           
       
   323         void DeleteDataOwners();
       
   324             
       
   325         //used only with reply
       
   326         TBool               iComplete;      //task complete
       
   327         TInt                iProgress;      //task progress 
       
   328         
       
   329         RPointerArray<CSConDataOwner>   iDataOwners;    //data owners
       
   330     };
       
   331     
       
   332 //============================================================
       
   333 // class CSConSetBURMode declaration
       
   334 //============================================================      
       
   335 NONSHARABLE_CLASS( CSConSetBURMode ) : public CBase
       
   336     {
       
   337     public:
       
   338         TDriveList          iDriveList;     //drive list
       
   339         TSConBurMode        iPartialType;   //partial backup type
       
   340         TSConIncType        iIncType;       //incremental backup type
       
   341         
       
   342         CSConSetBURMode();
       
   343         ~CSConSetBURMode();     
       
   344         CSConSetBURMode* CopyL();
       
   345         
       
   346         //used only with reply
       
   347         TBool               iComplete;      //task complete
       
   348         TInt                iProgress;      //task progress 
       
   349     };
       
   350 
       
   351 //============================================================
       
   352 // class CSConGetDataSize declaration
       
   353 //============================================================  
       
   354 NONSHARABLE_CLASS( CSConGetDataSize ) : public CBase
       
   355     {
       
   356     public:
       
   357         CSConGetDataSize();
       
   358         ~CSConGetDataSize();
       
   359         
       
   360         CSConGetDataSize* CopyL();          
       
   361         void DeleteDataOwners();
       
   362             
       
   363     public:
       
   364         RPointerArray<CSConDataOwner> iDataOwners;  //data owners
       
   365         
       
   366         //used only with reply
       
   367         TBool               iComplete;      //task complete
       
   368         TInt                iProgress;      //task progress 
       
   369     };
       
   370     
       
   371 //============================================================
       
   372 // class CSConListPublicFiles declaration
       
   373 //============================================================  
       
   374 NONSHARABLE_CLASS( CSConListPublicFiles ) : public CBase
       
   375     {
       
   376     public:
       
   377         CSConListPublicFiles();
       
   378         ~CSConListPublicFiles();            
       
   379         CSConListPublicFiles* CopyL();
       
   380         
       
   381     public:
       
   382         RPointerArray<CSConFile>        iFiles;         //data owners
       
   383         RPointerArray<CSConDataOwner>   iDataOwners;    //data owners
       
   384         
       
   385         //used only with reply
       
   386         TBool               iComplete;      //task complete
       
   387         TInt                iProgress;      //task progress 
       
   388     };
       
   389     
       
   390 //============================================================
       
   391 // class CSConRequestData declaration
       
   392 //============================================================  
       
   393 NONSHARABLE_CLASS( CSConRequestData ) : public CBase
       
   394     {
       
   395     public:
       
   396         CSConRequestData();         
       
   397         ~CSConRequestData();            
       
   398         CSConRequestData* CopyL();          
       
   399         void DeleteDataAndDataOwner();
       
   400             
       
   401         CSConDataOwner*     iDataOwner;     //data owner
       
   402         HBufC8*             iBackupData;    //backup data
       
   403         TBool               iMoreData;      //more data
       
   404         
       
   405         //used only with reply
       
   406         TBool               iComplete;      //task complete
       
   407         TInt                iProgress;      //task progress 
       
   408     };
       
   409     
       
   410 //============================================================
       
   411 // class CSConGetDataOwnerStatus declaration
       
   412 //============================================================  
       
   413 NONSHARABLE_CLASS( CSConGetDataOwnerStatus ) : public CBase
       
   414     {
       
   415     public:
       
   416         CSConGetDataOwnerStatus();
       
   417         ~CSConGetDataOwnerStatus();         
       
   418         CSConGetDataOwnerStatus* CopyL();
       
   419         void DeleteDataOwners();
       
   420             
       
   421     public:
       
   422         RPointerArray<CSConDataOwner> iDataOwners;  //data owners
       
   423         
       
   424         //used only with reply
       
   425         TBool               iComplete;      //task complete
       
   426         TInt                iProgress;      //task progress 
       
   427     };
       
   428 
       
   429 //============================================================
       
   430 // class CSConSupplyData declaration
       
   431 //============================================================  
       
   432 NONSHARABLE_CLASS( CSConSupplyData ) : public CBase
       
   433     {
       
   434     public:
       
   435         CSConSupplyData();
       
   436         ~CSConSupplyData();         
       
   437         CSConSupplyData* CopyL();
       
   438     public:
       
   439         CSConDataOwner*     iDataOwner;
       
   440         HBufC8*             iRestoreData;   //restore data
       
   441         TBool               iMoreData;      //more data     
       
   442         //used only with reply
       
   443         TBool               iComplete;      //task complete
       
   444         TInt                iProgress;      //task progress 
       
   445     };
       
   446 
       
   447 //============================================================
       
   448 // class CSConGetMetadata declaration
       
   449 //============================================================
       
   450 NONSHARABLE_CLASS( CSConGetMetadata ) : public CBase
       
   451     {
       
   452     public:
       
   453         CSConGetMetadata();
       
   454         ~CSConGetMetadata();            
       
   455         CSConGetMetadata* CopyL();
       
   456     public:
       
   457         TFileName           iFilename;
       
   458         HBufC8*             iData;          //metadata
       
   459         TBool               iMoreData;      //more data     
       
   460         //used only with reply
       
   461         TBool               iComplete;      //task complete
       
   462         TInt                iProgress;      //task progress 
       
   463     };
       
   464 
       
   465 //============================================================
       
   466 // class CSConTask declaration
       
   467 //============================================================  
       
   468 NONSHARABLE_CLASS( CSConTask ): public CBase
       
   469     {
       
   470     public:
       
   471         /**
       
   472         * Two-phase constructor
       
   473         * @return CSConTask instance
       
   474         */
       
   475         static CSConTask* NewL( TSConMethodName aMethod );
       
   476         static CSConTask* NewLC( TSConMethodName aMethod );
       
   477 
       
   478         CSConTask();
       
   479         ~CSConTask();
       
   480         TSConMethodName GetServiceId() const;
       
   481         CSConTask* CopyL() const;
       
   482         TBool GetComplete();
       
   483         void SetCompleteValue( TBool aValue );
       
   484         TBool GetCompleteValue();
       
   485         void SetProgressValue( TInt aValue );
       
   486     private:
       
   487         
       
   488         void ConstructL( TSConMethodName aMethod );                
       
   489     public:
       
   490         //Task
       
   491         //service id
       
   492         TSConMethodName             iMethod;
       
   493         //task number
       
   494         TInt                        iTaskId;            
       
   495         
       
   496         //DeviceInfo -params
       
   497         CSConUpdateDeviceInfo*      iDevInfoParams;
       
   498         //ListInstalledTasks -params
       
   499         CSConListInstApps*          iListAppsParams;
       
   500         //GetStatus -params
       
   501         CSConGetStatus*             iGetStatusParams;
       
   502         //Install -params
       
   503         CSConInstall*               iInstallParams; 
       
   504         //Uninstall -params 
       
   505         CSConUninstall*             iUninstallParams;
       
   506         //SetBURMode -params
       
   507         CSConSetBURMode*            iBURModeParams;
       
   508         //GetDataSize -params
       
   509         CSConGetDataSize*           iGetDataSizeParams;
       
   510         //RequestData -params
       
   511         CSConRequestData*           iRequestDataParams; 
       
   512         //GetDataOwnerStatus -params
       
   513         CSConGetDataOwnerStatus*    iGetDataOwnerParams;
       
   514         //SupplyData -params
       
   515         CSConSupplyData*            iSupplyDataParams;
       
   516         //ListPublicFiles -params
       
   517         CSConListPublicFiles*       iPubFilesParams;
       
   518         //ListDataOwners -params
       
   519         CSConListDataOwners*        iListDataOwnersParams;
       
   520         //Reboot -params
       
   521         CSConReboot*                iRebootParams;
       
   522         //GetMetadata -params
       
   523         CSConGetMetadata*           iGetMetadataParams;
       
   524         
       
   525         TInt                        iCancelTaskId;
       
   526         TBool                       iCancelTaskAll;
       
   527     };
       
   528     
       
   529 //============================================================
       
   530 // class CSConTaskReply declaration
       
   531 //============================================================
       
   532 NONSHARABLE_CLASS( CSConTaskReply ) : public CBase
       
   533     {
       
   534     public:
       
   535         CSConTaskReply();
       
   536         CSConTaskReply( TSConMethodName aMethod );
       
   537         ~CSConTaskReply();
       
   538         void InitializeL( const CSConTask& aTask );   
       
   539         void InitializeL( TSConMethodName aMethod, 
       
   540             TInt aProgress, TBool aComplete );           
       
   541         CSConTaskReply* CopyAndFreeL();
       
   542         void CleanTaskData();
       
   543             
       
   544     public:
       
   545         //task id number
       
   546         TInt                        iTaskId;
       
   547         //method type
       
   548         TSConMethodName             iMethod;
       
   549         
       
   550         //DeviceInfo -params
       
   551         CSConUpdateDeviceInfo*      iDevInfoParams;
       
   552         //ListInstalledTasks -params
       
   553         CSConListInstApps*          iListAppsParams;
       
   554         //GetStatus -params
       
   555         CSConGetStatus*             iGetStatusParams;
       
   556         //Install -params
       
   557         CSConInstall*               iInstallParams;
       
   558         //Uninstall -params
       
   559         CSConUninstall*             iUninstallParams;
       
   560         //SetBURMode -params
       
   561         CSConSetBURMode*            iBURModeParams;
       
   562         //GetDataSize -params
       
   563         CSConGetDataSize*           iGetDataSizeParams;
       
   564         //RequestData -params
       
   565         CSConRequestData*           iRequestDataParams;
       
   566         //GetDataOwnerStatus -params
       
   567         CSConGetDataOwnerStatus*    iGetDataOwnerParams;
       
   568         //SupplyData -params
       
   569         CSConSupplyData*            iSupplyDataParams;
       
   570         //ListPublicFiles -params
       
   571         CSConListPublicFiles*       iPubFilesParams;
       
   572         //ListDataOwners -params
       
   573         CSConListDataOwners*        iListDataOwnersParams;
       
   574         //Reboot -params
       
   575         CSConReboot*                iRebootParams;
       
   576         //GetMetadata -params
       
   577         CSConGetMetadata*           iGetMetadataParams;
       
   578     };      
       
   579     
       
   580 //============================================================
       
   581 // class CSConStatusReply declaration
       
   582 //============================================================
       
   583 NONSHARABLE_CLASS( CSConStatusReply ): public CBase
       
   584     {
       
   585     public:
       
   586         CSConStatusReply();
       
   587         ~CSConStatusReply();
       
   588             
       
   589     public:
       
   590         TBool                           iNoTasks;       //no active tasks
       
   591         RPointerArray<CSConTaskReply>   iTasks;
       
   592     };
       
   593 
       
   594 #endif
       
   595 
       
   596 // End of file
       
   597