uifw/AknGlobalUI/akncustcmds/src/akncapserverstart.cpp
changeset 0 2f259fa3e83a
child 9 0aa5fbdfbc30
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     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 : Implementation of CAknCapServerStart class.
       
    15 *
       
    16 */
       
    17 #include <AknCapServerClient.h>
       
    18 #include <AknSkinsInternalCRKeys.h>
       
    19 #include <centralrepository.h>
       
    20 #include <palette.h>
       
    21 
       
    22 #include "akncapserverstart.h"
       
    23 
       
    24 // ======== LOCAL FUNCTIONS ========
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // SetColorPalette
       
    28 //
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 static void SetColorPaletteL()
       
    32     {
       
    33     CRepository* repository = CRepository::NewLC( KCRUidPersonalisation );
       
    34     TInt scheme( 0 );
       
    35     User::LeaveIfError( repository->Get( KPslnColorPalette, scheme ) );
       
    36     DynamicPalette::SetColor256Util((DynamicPalette::TIndex)scheme);
       
    37     CleanupStack::PopAndDestroy( repository );
       
    38     }
       
    39 
       
    40 
       
    41 // ======== MEMBER FUNCTIONS ========
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // CAknCapServerStart::NewL
       
    45 //
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 CAknCapServerStart* CAknCapServerStart::NewL()
       
    49 	{
       
    50 	CAknCapServerStart* self = new ( ELeave ) CAknCapServerStart;
       
    51 	return self;
       
    52 	}
       
    53 
       
    54 
       
    55 // ---------------------------------------------------------------------------
       
    56 // Destructor
       
    57 //
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 CAknCapServerStart::~CAknCapServerStart()
       
    61     {
       
    62     }
       
    63 
       
    64 
       
    65 // ---------------------------------------------------------------------------
       
    66 // CAknCapServerStart::Initialize
       
    67 //
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 TInt CAknCapServerStart::Initialize( CSsmCustomCommandEnv* /*aCmdEnv*/ )
       
    71     {
       
    72     return KErrNone;
       
    73     }
       
    74 
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // CAknCapServerStart::Execute
       
    78 //
       
    79 // ---------------------------------------------------------------------------
       
    80 //
       
    81 void CAknCapServerStart::Execute(
       
    82     const TDesC8& /*aParams*/,
       
    83     TRequestStatus& aRequest )
       
    84     {
       
    85     aRequest = KRequestPending;
       
    86 
       
    87     TRAP_IGNORE( SetColorPaletteL() );
       
    88     TRAPD( err, RAknUiServer::StartAknCapserverL() );
       
    89     RDebug::Print( _L( "RAknUiServer::StartAknCapserverL leave code %d" ), err );
       
    90 
       
    91     TRequestStatus* request = &aRequest;
       
    92     User::RequestComplete( request, err );
       
    93     }
       
    94 
       
    95 
       
    96 // ---------------------------------------------------------------------------
       
    97 // CAknCapServerStart::ExecuteCancel
       
    98 //
       
    99 // ---------------------------------------------------------------------------
       
   100 //
       
   101 void CAknCapServerStart::ExecuteCancel()
       
   102     {
       
   103     // Nothing to do.
       
   104     }
       
   105 
       
   106 
       
   107 // ---------------------------------------------------------------------------
       
   108 // CAknCapServerStart::Release
       
   109 //
       
   110 // ---------------------------------------------------------------------------
       
   111 //
       
   112 void CAknCapServerStart::Release()
       
   113     {
       
   114 	delete this;
       
   115     }
       
   116 
       
   117 
       
   118 // ---------------------------------------------------------------------------
       
   119 // CAknCapServerStart::Close
       
   120 //
       
   121 // ---------------------------------------------------------------------------
       
   122 //
       
   123 void CAknCapServerStart::Close()
       
   124     {
       
   125     // Nothing to do.
       
   126     }
       
   127 
       
   128 
       
   129 // ---------------------------------------------------------------------------
       
   130 // First phase constructor
       
   131 //
       
   132 // ---------------------------------------------------------------------------
       
   133 //
       
   134 CAknCapServerStart::CAknCapServerStart()
       
   135     {
       
   136     }
       
   137