omadm/omadmappui/src/NSmlDMSyncApp.cpp
changeset 0 3ce708148e4d
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Methods for CNSmlDMSyncApp
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "NSmlDMSyncApp.h"
       
    21 #include "NSmlDMSyncDocument.h"
       
    22 #include "NSmlDMSyncDebug.h"
       
    23 #include "NSmlDMSyncAppServer.h"
       
    24 #include <eikstart.h>
       
    25 #include <e32property.h>
       
    26 #include "nsmldmsyncinternalpskeys.h"
       
    27 
       
    28 // ================= OTHER EXPORTED FUNCTIONS ==================================
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CNSmlDMSyncApp::AppDllUid()
       
    32 // Returns application UID
       
    33 // -----------------------------------------------------------------------------
       
    34 //
       
    35 TUid CNSmlDMSyncApp::AppDllUid() const
       
    36     {
       
    37     FLOG( "[OMADM] AppDllUid:" );
       
    38     
       
    39     return KUidSmlSyncApp;
       
    40     }
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CNSmlDMSyncApp::CreateDocumentL()
       
    44 // Creates CNSmlDMSyncDocument object
       
    45 // -----------------------------------------------------------------------------
       
    46 //
       
    47 CApaDocument* CNSmlDMSyncApp::CreateDocumentL()
       
    48     {
       
    49     FLOG( "[OMADM] CNSmlDMSyncApp::CreateDocumentL:" );
       
    50     
       
    51     CNSmlDMSyncDocument* document = CNSmlDMSyncDocument::NewL( *this );
       
    52     TInt Value = -1;
       
    53     static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
       
    54    	static _LIT_SECURITY_POLICY_C1(KAllowWriteDeviceDataPolicy, ECapabilityWriteDeviceData);
       
    55     TInt r1=RProperty::Define(KUidSmlSyncApp,KNSmlDMSyncUiLaunchKey,RProperty::EInt,KAllowAllPolicy,KAllowWriteDeviceDataPolicy);
       
    56     TInt r=RProperty::Get(KUidSmlSyncApp,KNSmlDMSyncUiLaunchKey,Value);
       
    57     if( r != KErrNone)
       
    58     {
       
    59     	User::LeaveIfError(r);
       
    60     	
       
    61     }
       
    62     
       
    63     if ( document )
       
    64         {
       
    65         //Only independent launch	
       
    66         if ( !document->IsServerAlertSync() )
       
    67             {
       
    68             document->StartServerL();
       
    69             }
       
    70         //Not an independent launch,server alert launch with SAN support    
       
    71         else if ( document->SANSupport() )     
       
    72             {
       
    73             document->StartServerL();	
       
    74             }	
       
    75 
       
    76         else if ( Value == 2)    //DM UI launch from CP
       
    77         {
       
    78         document->StartServerL();        
       
    79         }
       
    80 
       
    81         }
       
    82     return document;
       
    83     }
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // NewApplication() 
       
    87 // Constructs CNSmlDMSyncApp
       
    88 // Returns: CApaDocument*: created application object
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 LOCAL_C CApaApplication* NewApplication()
       
    92     {
       
    93     FLOG( "[OMADM] CApaApplication* NewApplication:" );
       
    94     
       
    95     return new CNSmlDMSyncApp;
       
    96     }
       
    97 
       
    98 // -----------------------------------------------------------------------------
       
    99 // E32Main
       
   100 // -----------------------------------------------------------------------------
       
   101 //
       
   102 GLDEF_C TInt E32Main()
       
   103     {
       
   104     FLOG( "[OMADM] E32Main:" );
       
   105     
       
   106     return EikStart::RunApplication( NewApplication );
       
   107     }
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // NewAppServerL() 
       
   111 // 
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 void CNSmlDMSyncApp::NewAppServerL( CApaAppServer*& aAppServer )
       
   115 	{
       
   116 	FLOG( "[OMADM] CNSmlDMSyncApp::NewAppServerL()" );
       
   117 	
       
   118 	aAppServer = new (ELeave) CNSmlDMSyncAppServer;
       
   119 	}
       
   120 
       
   121 // End of File