uifw/AvKon/src/AknDef.cpp
changeset 0 2f259fa3e83a
child 26 62ef28f7b435
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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 to get the view ID of the
       
    15 *                currently active idle view.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "AknDef.h"
       
    22 #include <vwsdef.h> // TVwsViewId
       
    23 
       
    24 #ifdef RD_IDLE_SEPARATION
       
    25 #include <e32property.h>
       
    26 #include <activeidle2domainpskeys.h>
       
    27 #endif
       
    28 
       
    29 const TInt KPhoneUid( 0x100058B3 );
       
    30 const TInt KActiveIdle2Uid( 0x102750F0 );
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // AknDef::GetPhoneIdleViewId()
       
    34 //
       
    35 // Constructs and returns the view id either from publish subscribe or from a 
       
    36 // hardcoded value. This method replaces a constant definition in akndef.h.
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 EXPORT_C TInt AknDef::GetPhoneIdleViewId(TVwsViewId& aViewId)
       
    40     {
       
    41     TInt uidValue = NULL;
       
    42     TInt retVal = KErrNone;
       
    43 
       
    44 #ifdef RD_IDLE_SEPARATION
       
    45     retVal = RProperty::Get( KPSUidAiInformation, KActiveIdleUid, uidValue );
       
    46     if(retVal == KErrNotFound)
       
    47         {
       
    48         retVal = KErrNone;
       
    49         uidValue = KPhoneUid;
       
    50         }
       
    51 #else
       
    52     uidValue = KPhoneUid;  // Was defined as KAknPhoneIdleViewId in akndef.h.
       
    53 #endif // RD_IDLE_SEPARATION
       
    54 
       
    55     if(retVal == KErrNone)
       
    56         {
       
    57         aViewId = TVwsViewId(TUid::Uid(uidValue), TUid::Uid(uidValue));
       
    58         }
       
    59         
       
    60 #ifdef RD_BOOT_CUSTOMIZABLE_AI
       
    61 
       
    62     // ActiveIdle2 is view-based, so this is a temporary fix
       
    63     // in order to be able to activate idle from app shell with menu-key,
       
    64     // until a proper way for view uid acquisition is made.
       
    65     
       
    66     TInt pluginRangeStart;
       
    67     TInt pluginRangeEnd;
       
    68     
       
    69     RProperty::Get( KPSUidAiInformation, KAIActivePluginRangeStart, pluginRangeStart );
       
    70     RProperty::Get( KPSUidAiInformation, KAIActivePluginRangeEnd, pluginRangeEnd );
       
    71     
       
    72     if ( uidValue >= pluginRangeStart && uidValue <= pluginRangeEnd && pluginRangeEnd )
       
    73         {
       
    74         uidValue = KActiveIdle2Uid;
       
    75         aViewId.iAppUid = TUid::Uid( uidValue );
       
    76         }
       
    77     else if ( uidValue >= pluginRangeStart ) // end UID may not be defined
       
    78         {
       
    79         uidValue = KActiveIdle2Uid;
       
    80         aViewId.iAppUid = TUid::Uid( uidValue );
       
    81         }
       
    82     
       
    83     if ( uidValue == KActiveIdle2Uid )
       
    84         {
       
    85         aViewId.iViewUid = TUid::Uid(1);
       
    86         }
       
    87         
       
    88 #endif // RD_BOOT_CUSTOMIZABLE_AI
       
    89 
       
    90     return retVal; 
       
    91     }
       
    92 
       
    93 //  End of File