iaupdate/IAD/api/src/iaupdateparameters.cpp
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 module contains the implementation of CIAUpdateParameters
       
    15 *                class member functions.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #include <iaupdateparameters.h>
       
    23 
       
    24 
       
    25 EXPORT_C CIAUpdateParameters* CIAUpdateParameters::NewL()
       
    26     {
       
    27     CIAUpdateParameters* self =
       
    28         CIAUpdateParameters::NewLC();
       
    29     CleanupStack::Pop( self );
       
    30     return self;
       
    31     }
       
    32     
       
    33 EXPORT_C CIAUpdateParameters* CIAUpdateParameters::NewLC()
       
    34     {
       
    35     CIAUpdateParameters* self =
       
    36         new( ELeave ) CIAUpdateParameters();
       
    37     CleanupStack::PushL( self );
       
    38     self->ConstructL();
       
    39     return self;
       
    40     }
       
    41 
       
    42 
       
    43 CIAUpdateParameters::CIAUpdateParameters(): 
       
    44 CBase(),
       
    45 iUid( TUid::Null() ),
       
    46 iImportance( 0xffffffff ),
       
    47 iType( 0xffffffff )
       
    48     {
       
    49     
       
    50     }
       
    51 
       
    52 void CIAUpdateParameters::ConstructL()
       
    53     {
       
    54     iSearchCriteria = KNullDesC().AllocL();
       
    55     iCommandLineExecutable = KNullDesC().AllocL();
       
    56     iCommandLineArguments = KNullDesC8().AllocL();
       
    57     }
       
    58                  
       
    59 
       
    60 EXPORT_C CIAUpdateParameters::~CIAUpdateParameters()
       
    61     {
       
    62     delete iSearchCriteria;
       
    63 
       
    64     delete iCommandLineExecutable;
       
    65      
       
    66     delete iCommandLineArguments;
       
    67     }
       
    68 
       
    69 
       
    70 EXPORT_C const TUid& CIAUpdateParameters::Uid() const
       
    71     {
       
    72     return iUid;
       
    73     }
       
    74 
       
    75 EXPORT_C void CIAUpdateParameters::SetUid( const TUid& aUid )
       
    76     {
       
    77     iUid = aUid;
       
    78     }
       
    79 
       
    80 
       
    81 EXPORT_C const TDesC& CIAUpdateParameters::SearchCriteria() const
       
    82     {
       
    83     if ( !iSearchCriteria )
       
    84         {
       
    85         return KNullDesC;
       
    86         }
       
    87     else
       
    88         {
       
    89         return *iSearchCriteria;
       
    90         }
       
    91     }
       
    92 
       
    93 EXPORT_C void CIAUpdateParameters::SetSearchCriteriaL( const TDesC& aSearchCriteria )
       
    94     {
       
    95     HBufC* tmp( aSearchCriteria.AllocL() );
       
    96     delete iSearchCriteria;
       
    97     iSearchCriteria = tmp;
       
    98     }
       
    99 
       
   100 
       
   101 EXPORT_C const TDesC& CIAUpdateParameters::CommandLineExecutable() const
       
   102     {
       
   103     if ( !iCommandLineExecutable  )
       
   104         {
       
   105         return KNullDesC;
       
   106         }
       
   107     else
       
   108         {
       
   109         return *iCommandLineExecutable;
       
   110         }
       
   111     }
       
   112 
       
   113 EXPORT_C void CIAUpdateParameters::SetCommandLineExecutableL( const TDesC& aCommandLineExecutable )
       
   114     {
       
   115     HBufC* tmp( aCommandLineExecutable.AllocL() );
       
   116     delete iCommandLineExecutable;
       
   117     iCommandLineExecutable = tmp;
       
   118     }
       
   119     
       
   120     
       
   121 EXPORT_C const TDesC8& CIAUpdateParameters::CommandLineArguments() const
       
   122     {
       
   123     if ( !iCommandLineArguments  )
       
   124         {
       
   125         return KNullDesC8;
       
   126         }
       
   127     else
       
   128         {
       
   129         return *iCommandLineArguments;
       
   130         }
       
   131     }
       
   132 
       
   133 EXPORT_C void CIAUpdateParameters::SetCommandLineArgumentsL( const TDesC8& aCommandLineArguments )
       
   134     {
       
   135     HBufC8* tmp( aCommandLineArguments.AllocL() );
       
   136     delete iCommandLineArguments;
       
   137     iCommandLineArguments = tmp;
       
   138     }
       
   139 
       
   140 
       
   141 EXPORT_C TBool CIAUpdateParameters::ShowProgress() const
       
   142     {
       
   143     return iShowProgress;
       
   144     }
       
   145 
       
   146 EXPORT_C void CIAUpdateParameters::SetShowProgress( TBool aShowProgress )
       
   147     {
       
   148     iShowProgress = aShowProgress;
       
   149     }
       
   150     
       
   151 EXPORT_C TUint CIAUpdateParameters::Importance() const
       
   152     {
       
   153     return iImportance;	
       
   154     }
       
   155     
       
   156 EXPORT_C void CIAUpdateParameters::SetImportance( TUint aImportance )
       
   157     {
       
   158 	iImportance = aImportance;
       
   159     }
       
   160 
       
   161 EXPORT_C TUint CIAUpdateParameters::Type() const
       
   162     {
       
   163     return iType;	
       
   164     }
       
   165 
       
   166 EXPORT_C void CIAUpdateParameters::SetType( TUint aType )
       
   167     {
       
   168 	iType = aType;
       
   169     }
       
   170 	
       
   171 EXPORT_C TBool CIAUpdateParameters::Refresh() const
       
   172     {
       
   173     return iRefresh;    	
       
   174     } 
       
   175 
       
   176 EXPORT_C void CIAUpdateParameters::SetRefresh( TBool aRefresh )
       
   177     {
       
   178 	iRefresh = aRefresh;
       
   179     }
       
   180