idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 13 Oct 2010 14:18:30 +0300
branchRCL_3
changeset 102 ba63c83f4716
parent 88 3321d3e205b6
permissions -rw-r--r--
Revision: 201039 Kit: 201041
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
83
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  Focus appearance drawer
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
// System includes
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
#include <AknsDrawUtils.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
#include <AknsUtils.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include <AknsItemID.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
// User includes
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include "xncontroladapter.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include "xnproperty.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include "xnappuiadapter.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include "xnuiengine.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include "xneditmode.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#include "xnnode.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include "xninactivitymonitor.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#include "xnfocuscontrol.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
// Constants
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
const TInt KSkinGfxInnerRectShrink( 5 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
// ============================ LOCAL FUNCTIONS ================================
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
// ============================ MEMBER FUNCTIONS ===============================
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
// CXnFocusControl::NewL()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
// Two-phased constructor.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
CXnFocusControl* CXnFocusControl::NewL( CXnAppUiAdapter& aAppUiAdapter )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
    CXnFocusControl* self = CXnFocusControl::NewLC( aAppUiAdapter );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
    CleanupStack::Pop( self );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
    return self;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
// CXnFocusControl::NewLC()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
// Two-phased constructor.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
CXnFocusControl* CXnFocusControl::NewLC( CXnAppUiAdapter& aAppUiAdapter )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
    CXnFocusControl* self = new ( ELeave ) CXnFocusControl( aAppUiAdapter );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
    CleanupStack::PushL( self );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
    self->ConstructL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
    return self;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
// CXnFocusControl::~CXnFocusControl()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
// C++ default destructor.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
CXnFocusControl::~CXnFocusControl()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
// CXnFocusControl::CXnFocusControl()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
// C++ default constructor.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
CXnFocusControl::CXnFocusControl( CXnAppUiAdapter& aAppUiAdapter )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
    : iAppUiAdapter( aAppUiAdapter )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
    {    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
// CXnFocusControl::ConstructL()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
// 2nd phase constructor
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
void CXnFocusControl::ConstructL()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
    {   
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
// CXnFocusControl::MakeVisible()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
// 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
void CXnFocusControl::MakeVisible( TBool aVisible )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
    TRAP_IGNORE( DoMakeVisibleL( aVisible ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
// CXnFocusControl::DoMakeVisibleL()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
// 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
void CXnFocusControl::DoMakeVisibleL( TBool aVisible )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
    if ( aVisible != iVisible )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
        if ( !aVisible )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
            {
102
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   114
            iVisible = aVisible;
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   115
            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   116
            iRefused = EFalse;
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   117
            
83
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
            CXnNode* node( iAppUiAdapter.UiEngine().FocusedNode() ); 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
                                   
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
            if ( node )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
                {
102
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   122
                node->HideTooltipsL();
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   123
                                    
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   124
                CXnControlAdapter* control( node->Control() );
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   125
                
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   126
                if  ( control && control->RefusesFocusLoss() )
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   127
                    {
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   128
                    // Need to keep drawing focus appearance
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   129
                    iRefused = ETrue;
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   130
                    
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   131
                    node->UnsetStateL( 
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   132
                        XnPropertyNames::style::common::KPressedDown );
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   133
                    }
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   134
                else
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   135
                    {
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   136
                    node->UnsetStateL(  
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   137
                        XnPropertyNames::style::common::KFocus );                    
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   138
                    }
83
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
                                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
                iAppUiAdapter.UiEngine().RenderUIL();                
102
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   141
                }    
83
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
            }
102
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   143
        else
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   144
            {
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   145
            iRefused = EFalse;
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   146
            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   147
            iVisible = aVisible;
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   148
            }              
83
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
        }        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
// CXnFocusControl::IsVisible()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
// 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
TBool CXnFocusControl::IsVisible() const
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
    return iVisible;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
// CXnFocusControl::Draw()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
// 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
void CXnFocusControl::Draw( const TRect& aRect, CWindowGc& aGc ) const
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
    TInt state( iAppUiAdapter.UiEngine().EditMode()->EditState() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
    // Don't draw focus appearance when shooting dragging widget in edit mode
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
    if ( state == CXnEditMode::EShootContent )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
    
102
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   177
    if ( IsVisible() || iRefused ) 
83
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
        {                                       
102
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   179
        CXnNode* node( iAppUiAdapter.UiEngine().FocusedNode() );
83
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
        
102
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   181
        if ( node )
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   182
            {            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   183
            CXnProperty* prop( NULL );
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   184
            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   185
            TRAP_IGNORE( prop = node->GetPropertyL( 
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   186
                XnPropertyNames::common::KFocusAppearance ) );
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   187
                                            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   188
            if ( prop && prop->StringValue() == XnPropertyNames::KNone )
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   189
                {
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   190
                // Current element refuses to draw focus appearance
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   191
                return;
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   192
                }
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   193
            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   194
            TRect innerRect( aRect );            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   195
            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   196
            innerRect.Shrink( 
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   197
                KSkinGfxInnerRectShrink, KSkinGfxInnerRectShrink );
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   198
            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   199
            MAknsSkinInstance* skin( AknsUtils::SkinInstance() );
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   200
                 
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   201
            if ( node->IsStateSet( XnPropertyNames::style::common::KPressedDown ) )
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   202
                {
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   203
                AknsDrawUtils::DrawFrame( skin, aGc, aRect, innerRect,
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   204
                    KAknsIIDQsnFrHomePressed, KAknsIIDDefault );                
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   205
                }            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   206
            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   207
            if ( node->IsStateSet( XnPropertyNames::style::common::KFocus ) )
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   208
                {
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   209
                AknsDrawUtils::DrawFrame( skin, aGc, aRect, innerRect, 
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   210
                    KAknsIIDQsnFrHome, KAknsIIDDefault );                
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   211
                }            
ba63c83f4716 Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 88
diff changeset
   212
            }       
83
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
// End of file
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217