appinstall_plat/iaupdate_api/inc/iaupdateparameters.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2007-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:   This file contains the header file of the CIAUpdateParameters class 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IA_UPDATE_PARAMETERS_H
       
    20 #define IA_UPDATE_PARAMETERS_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <e32cmn.h>
       
    24 
       
    25 /**
       
    26  * CIAUpdateParameters defines the update targets. 
       
    27  * The update action will be directed only to the objects 
       
    28  * that qualify at least one of the parameter requirements.
       
    29  *
       
    30  * @see CIAUpdate The operation functions provide more detailed
       
    31  * description about what combinations of the parameter values 
       
    32  * are supported.
       
    33  *
       
    34  * @since S60 v3.2
       
    35  */
       
    36 class CIAUpdateParameters : public CBase
       
    37     {
       
    38 
       
    39 public:
       
    40 
       
    41     enum TUpdateImportance
       
    42         {
       
    43         ETest = 0x1,
       
    44         ENormal = 0x2,
       
    45         ERecommended = 0x4,
       
    46         ECritical = 0x8,
       
    47         EMandatory = 0x10,
       
    48         EHidden = 0x20
       
    49         };
       
    50         
       
    51     enum TUpdateType
       
    52         {
       
    53         ESis  = 0x1,
       
    54         EFota = 0x2,
       
    55         ENsu  = 0x4
       
    56         };
       
    57 
       
    58     /**
       
    59      * @return CIAUpdateParameters* CIAUpdateParameters object
       
    60      * @exception Leaves with system wide error code.
       
    61      *
       
    62      * @since S60 v3.2
       
    63      */
       
    64     IMPORT_C static CIAUpdateParameters* NewL();
       
    65 
       
    66     /**
       
    67      * @see CIAUpdateParameters::NewL
       
    68      */
       
    69     IMPORT_C static CIAUpdateParameters* NewLC();
       
    70 
       
    71 
       
    72     /**
       
    73      * Destructor
       
    74      *
       
    75      * @since S60 v3.2
       
    76      */
       
    77     IMPORT_C virtual ~CIAUpdateParameters();
       
    78 
       
    79 
       
    80     /** 
       
    81      * @return const TUid& Uid describes either package UID or SID.
       
    82      *
       
    83      * @since S60 v3.2
       
    84      */
       
    85     IMPORT_C const TUid& Uid() const;
       
    86 
       
    87     /** 
       
    88      * @param aUid Uid describes either package UID or SID.
       
    89      *
       
    90      * @since S60 v3.2
       
    91      */
       
    92     IMPORT_C void SetUid( const TUid& aUid );
       
    93 
       
    94 
       
    95     /** 
       
    96      * @return const TDesC& When correct updates are searched,
       
    97      * this text is used as a criteria when checking the information 
       
    98      * that is attached to the updates.
       
    99      *
       
   100      * @since S60 v3.2
       
   101      */
       
   102     IMPORT_C const TDesC& SearchCriteria() const;
       
   103 
       
   104     /** 
       
   105      * @param aSearchCriteria When correct updates are searched,
       
   106      * this text is used as a criteria when checking the information 
       
   107      * that is attached to the updates.
       
   108      *
       
   109      * @since S60 v3.2
       
   110      */
       
   111     IMPORT_C void SetSearchCriteriaL( const TDesC& aSearchCriteria );
       
   112 
       
   113 
       
   114     /** 
       
   115      * @return const TDesC& When the updated application
       
   116      * is restarted, the content of this desciptor will be passed
       
   117      * to the application as command line executable.
       
   118      *
       
   119      * @since S60 v3.2
       
   120      */
       
   121     IMPORT_C const TDesC& CommandLineExecutable() const;    
       
   122 
       
   123     /** 
       
   124      * @return aCommandLineExecutable When the update operation finishes,
       
   125      * the content of this desciptor will be used as a command line executable.
       
   126      *
       
   127      * @since S60 v3.2
       
   128      */
       
   129     IMPORT_C void SetCommandLineExecutableL( const TDesC& aCommandLineExecutable );
       
   130 
       
   131 
       
   132     /** 
       
   133      * @return const TDesC8& When the update operation finishes,
       
   134      * the content of this desciptor will be used as a command line arguments
       
   135      * with the command line executable.
       
   136      *
       
   137      * @since S60 v3.2
       
   138      */
       
   139     IMPORT_C const TDesC8& CommandLineArguments() const;    
       
   140 
       
   141     /** 
       
   142      * @param aCommandLineArguments When the update operation finishes,
       
   143      * the content of this desciptor will be used as command line arguments
       
   144      * with the command line executable.
       
   145      *
       
   146      * @since S60 v3.2
       
   147      */
       
   148     IMPORT_C void SetCommandLineArgumentsL( const TDesC8& aCommandLineArguments );
       
   149 
       
   150 
       
   151     /**
       
   152      * If this parameter is set to ETrue,
       
   153      * a ready-made wait dialog with localized texts is
       
   154      * shown if CIAUpdate::CheckUpdates operation takes longer
       
   155      * time to complete. This happens e.g. if the updates are 
       
   156      * refreshed from the server.
       
   157      *
       
   158      * @return TBool If ETrue, a wait dialog is shown when
       
   159      * CIAUpdate::CheckUpdates operation is started. If EFalse,
       
   160      * the dialog is not shown.
       
   161      *
       
   162      * @see CIAUpdate::CheckUpdates
       
   163      *
       
   164      * @since S60 v3.2
       
   165      */
       
   166     IMPORT_C TBool ShowProgress() const;
       
   167 
       
   168     /**
       
   169      * If this parameter is set to ETrue,
       
   170      * a ready-made wait dialog with localized texts is
       
   171      * shown if CIAUpdate::CheckUpdates operation takes longer
       
   172      * time to complete. This happens e.g. if the updates are 
       
   173      * refreshed from the server.
       
   174      *
       
   175      * @param aShowProgress If ETrue, a wait dialog is shown when
       
   176      * CIAUpdate::CheckUpdates operation is started. If EFalse,
       
   177      * the dialog is not shown.
       
   178      *
       
   179      * @see CIAUpdate::CheckUpdates
       
   180      *
       
   181      * @since S60 v3.2     
       
   182      */
       
   183     IMPORT_C void SetShowProgress( TBool aShowProgress );
       
   184 
       
   185 
       
   186     IMPORT_C TUint Importance() const;
       
   187 		
       
   188     // aImportance acts as a importance filter to the found IAD packages. It has no meaning with found FOTA or NSU packages.
       
   189     // If aImportance is not set, all importance types are valid.
       
   190     // See TUpdateImportance for possible values.
       
   191     IMPORT_C void SetImportance( TUint aImportance );
       
   192 
       
   193     IMPORT_C TUint Type() const;
       
   194 
       
   195     // aType acts as a type filter to the found update packages. 
       
   196     // If aType is not set, all package types are valid.
       
   197     // See TUpdateType for possible values. Combination of 
       
   198     IMPORT_C void SetType( TUint aType );
       
   199 	
       
   200     IMPORT_C TBool Refresh() const;
       
   201 	
       
   202     // If refresh is set on, metadata cache is refreshed from the server when calling
       
   203     // CIAUpdate::CheckUpdates operation. This option should not be set by normal applications.
       
   204     // It is meant for IAUpdate background checker, and caller SID is used to control this. 
       
   205     IMPORT_C void SetRefresh( TBool aRefresh );
       
   206 	
       
   207 
       
   208 private:
       
   209 
       
   210     /**
       
   211      * Constructor is private because this class is not meant for
       
   212      * inheritance.
       
   213      *
       
   214      * @see CIAUpdateParameters::NewL
       
   215      *
       
   216      * @since S60 v3.2
       
   217      */
       
   218     CIAUpdateParameters();
       
   219 
       
   220     /**
       
   221      * @see CIAUpdateParameters::NewL
       
   222      *
       
   223      * @since S60 v3.2
       
   224      */
       
   225     void ConstructL();
       
   226 
       
   227 
       
   228     // Prevent these
       
   229     CIAUpdateParameters( const CIAUpdateParameters& aObject );
       
   230     CIAUpdateParameters& operator =( const CIAUpdateParameters& aObject );
       
   231 
       
   232 
       
   233 private: // data
       
   234 
       
   235     TUid iUid;
       
   236     HBufC* iSearchCriteria;
       
   237     HBufC* iCommandLineExecutable;
       
   238     HBufC8* iCommandLineArguments;
       
   239     TBool iShowProgress;
       
   240     
       
   241     TUint iImportance;
       
   242     TUint iType;
       
   243     TBool iRefresh;
       
   244 
       
   245 };
       
   246 
       
   247 #endif // IA_UPDATE_PARAMETERS_H