fotaapplication/fotaserver/FotaServer/src/FotaSrvDocument.cpp
branchRCL_3
changeset 25 b183ec05bd8c
parent 24 13d7c31c74e0
child 26 19bba8228ff0
equal deleted inserted replaced
24:13d7c31c74e0 25:b183ec05bd8c
     1 /*
       
     2 * Copyright (c) 2005 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:   Fotaserver document class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <StringLoader.h>
       
    22 #include <collate.h>
       
    23 #include <featmgr.h>
       
    24 #include <fotaserver.rsg>
       
    25 #include "FotaSrvDocument.h"
       
    26 #include "FotaSrvUI.h"
       
    27 #include "FotaSrvDebug.h"
       
    28 #include <e32property.h>
       
    29 #include "FotaServer.h"
       
    30 // ================= MEMBER FUNCTIONS =======================
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // Desctructor
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 CFotaSrvDocument::~CFotaSrvDocument()
       
    37     {
       
    38     TInt err = RProperty::Delete(TUid::Uid(KFotaServerUid), KFotaDownloadActive);
       
    39     }
       
    40 
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // CFotaSrvDocument::ConstructL
       
    44 // 2nd phase constructor
       
    45 // ---------------------------------------------------------------------------
       
    46 //
       
    47 void CFotaSrvDocument::ConstructL()
       
    48     {
       
    49     TInt err1(KErrNone);
       
    50     _LIT_SECURITY_POLICY_C1( KReadPolicy, ECapabilityReadDeviceData );
       
    51     _LIT_SECURITY_POLICY_C1( KWritePolicy, ECapabilityDiskAdmin );
       
    52     TInt err  = RProperty::Define( TUid::Uid(KFotaServerUid),
       
    53                 KFotaDownloadActive,
       
    54                 RProperty::EInt,KReadPolicy,KWritePolicy); 
       
    55     if(err==0)
       
    56         {
       
    57         err1 =  RProperty::Set( TUid::Uid(KFotaServerUid),KFotaDownloadActive,KErrNotFound ); 
       
    58         }
       
    59         FLOG(_L(" [FotaServer] CFotaSrvDocument::ConstructL  : error in setting rproperty: %d %d"), err,err1);
       
    60 	//iEikEnv = CEikonEnv::Static();	
       
    61     
       
    62     }
       
    63 
       
    64 // ---------------------------------------------------------------------------
       
    65 // CFotaSrvDocument::NewL
       
    66 // Two-phased constructor.
       
    67 // ---------------------------------------------------------------------------
       
    68 //
       
    69 CFotaSrvDocument* CFotaSrvDocument::NewL( CAknApplication& aApp )
       
    70     {
       
    71     FLOG( _L( "[FotaServer] CFotaSrvDocument::NewL:" ) );
       
    72 
       
    73 	CFotaSrvDocument* self = new (ELeave) CFotaSrvDocument( aApp );
       
    74     CleanupStack::PushL( self );
       
    75     self->ConstructL();
       
    76     CleanupStack::Pop();  //self
       
    77     return self;
       
    78 	}
       
    79 
       
    80  
       
    81 // ---------------------------------------------------------------------------
       
    82 // CFotaSrvDocument::CreateAppUiL
       
    83 // ---------------------------------------------------------------------------
       
    84 //
       
    85 CEikAppUi* CFotaSrvDocument::CreateAppUiL()
       
    86     {
       
    87     FLOG( _L( "[FotaServer] CFotaSrvDocument::CreateAppUiL:" ) );
       
    88     return new (ELeave) CFotaSrvUi;
       
    89 	}
       
    90 
       
    91 
       
    92 // End of File