sysstatemgmt/ssmpolicyplugins/ssmuiswppolicy/src/ssmuiswppolicy.cpp
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2009 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: Implementation of CSsmUiSwpPolicy class.
       
    15 *
       
    16 */
       
    17 
       
    18 #include <ssm/ssmswp.h>
       
    19 
       
    20 #include "ssmuiswppolicy.h"
       
    21 #include "ssmswp.hrh"
       
    22 #include "ssmmapperutility.h"
       
    23 #include "trace.h"
       
    24 
       
    25 /**
       
    26 * SWP ui policy resource file path format : "\private\<SID of SSM>\swpui\"
       
    27 */
       
    28 _LIT( KCommandListPath, "Z:\\private\\2000D75B\\swpui\\" );
       
    29 
       
    30 // ======== MEMBER FUNCTIONS ========
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // CSsmUiSwpPolicy::NewL
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 EXPORT_C MSsmSwpPolicy* CSsmUiSwpPolicy::NewL()
       
    37     {
       
    38     CSsmUiSwpPolicy* self = new( ELeave ) CSsmUiSwpPolicy;
       
    39     CleanupStack::PushL( self );
       
    40     self->BaseConstructL();
       
    41     CleanupStack::Pop( self );
       
    42     return self;
       
    43     }
       
    44 
       
    45 
       
    46 // ---------------------------------------------------------------------------
       
    47 // CSsmUiSwpPolicy::~CSsmUiSwpPolicy
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 CSsmUiSwpPolicy::~CSsmUiSwpPolicy()
       
    51     {
       
    52     FUNC_LOG;
       
    53     }
       
    54 
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // CSsmUiSwpPolicy::GetCommandListPathL
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 void CSsmUiSwpPolicy::GetCommandListPathL( TDes& aCmdListPath )
       
    61     {
       
    62     FUNC_LOG;
       
    63 
       
    64     aCmdListPath = KCommandListPath;
       
    65     iUtil->GetCommandListPath( aCmdListPath );
       
    66     }
       
    67 
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // CSsmUiSwpPolicy::TransitionAllowed
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 MSsmSwpPolicy::TResponse CSsmUiSwpPolicy::TransitionAllowed(
       
    74     const TSsmSwp& aSwp,
       
    75     const RMessagePtr2& aMessage )
       
    76     {
       
    77     FUNC_LOG;
       
    78     INFO_2( "Requested SWP transition: 0x%08x::0x%08x", aSwp.Key(), aSwp.Value() );
       
    79 
       
    80     TResponse response = ENotAllowed;
       
    81     if ( iUtil->CheckCaps( aMessage ) )
       
    82         {
       
    83         if ( aSwp.Value() == ESsmUiPhaseStarted )
       
    84             {
       
    85             response = EAllowed;
       
    86             }
       
    87         else
       
    88             {
       
    89             INFO( "Requested SWP transition not allowed" );
       
    90             }
       
    91         }
       
    92     else
       
    93         {
       
    94         INFO( "Capability Check Failed" );
       
    95         }
       
    96 
       
    97     return response;
       
    98     }
       
    99 
       
   100 
       
   101 // ---------------------------------------------------------------------------
       
   102 // CSsmUiSwpPolicy::CSsmUiSwpPolicy
       
   103 // ---------------------------------------------------------------------------
       
   104 //
       
   105 CSsmUiSwpPolicy::CSsmUiSwpPolicy()
       
   106     {
       
   107     FUNC_LOG;
       
   108     }