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