uifw/uiklaf/src/LAFEDWIN.CPP
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 1997-1999 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <gulbordr.h>
       
    20 #include <gulcolor.h>
       
    21 #include <gulutil.h>
       
    22 #include <coeinput.h>
       
    23 
       
    24 #include "LAFSTD.H"
       
    25 #include "lafpublc.h"
       
    26 #include "LAFEDWIN.H"
       
    27 #include "lafmain.h"
       
    28 #include "lafcommn.h"
       
    29 
       
    30 #define KDefaultMargin 1
       
    31 
       
    32 /**
       
    33  * Gets the default border for the matched control in aBorder. Called from the constructor of the matched control.
       
    34  */
       
    35 EXPORT_C void LafEdwin::GetDefaultBorder(TGulBorder& aBorder)
       
    36 	{
       
    37 	aBorder=TGulBorder(TGulBorder::ESingleGray);
       
    38 	}
       
    39 
       
    40 /**
       
    41  * Gets the set of border colors for the matched control in aBorderColors. The RGB values of the colors obtained
       
    42  * may depend on the the display mode, the environment color list and the instance of the
       
    43  * matched control aMatchedControl. Called by the matched control from its Draw() method and passed on to the
       
    44  * Draw() method of TGulBorder. 
       
    45  */
       
    46 EXPORT_C void LafEdwin::GetBorderColors(TGulBorder::TColors& aBorderColors, const MLafEnv& aLafEnv, const CCoeControl& aMatchedControl)
       
    47 	{
       
    48 	LafCommonUtils::GetRgbDerivedBorderColors( aBorderColors,
       
    49 			EColorControlSurroundBackground, aLafEnv,aMatchedControl );
       
    50 	}
       
    51 
       
    52 /**
       
    53  * Returns the default flags for the scroll bar for orientation aOrientation.
       
    54  * Called when the matched control creates its scroll bar frame..
       
    55  */
       
    56 EXPORT_C TInt LafEdwin::DefaultScrollBarFlags(TInt /*aOrientation*/)
       
    57 	{
       
    58 	return 0;
       
    59 	}
       
    60 
       
    61 EXPORT_C CLafEdwinCustomDrawBase* LafEdwin::CreateEdwinCustomDrawL(const MLafEnv& aEnv,const CCoeControl& aControl,
       
    62 																		CTextLayout& /*aTextLayout*/)
       
    63 	{
       
    64 	return CLafEdwinCustomDrawBase::NewL(aEnv,aControl);
       
    65 	}
       
    66 
       
    67 /**
       
    68  * Gets the default attributes for the scroll bar for orientation aOrientation in aAttributes.
       
    69  * Called when the matched control creates its scroll bar frame..
       
    70  */
       
    71 EXPORT_C void LafEdwin::GetDefaultScrollBarAttributes(TInt /*aOrientation*/, LafScrollBarFrame::TScrollBarAttributes& aAttributes)
       
    72 	{
       
    73 	aAttributes = LafScrollBarFrame::TScrollBarAttributes();
       
    74 	}
       
    75 
       
    76 /**
       
    77  * Returns the keypresses an edwin is interested in receiving from a FEP
       
    78  */
       
    79 EXPORT_C TInt LafEdwin::InputCapabilities()
       
    80 	{ // static
       
    81 	return TCoeInputCapabilities::EAllText|TCoeInputCapabilities::ENavigation;
       
    82 	}
       
    83 
       
    84 /**
       
    85  * Returns the default margins, for the edwin. Called during construction of the edwin.
       
    86  * The values may be overidden by the app programmer later.
       
    87  */
       
    88 EXPORT_C TMargins8 LafEdwin::Margins()
       
    89 	{//static
       
    90 	TMargins8 margins;
       
    91 	margins.SetAllValuesTo(KDefaultMargin);
       
    92 	return margins;
       
    93 	}
       
    94 
       
    95 EXPORT_C void LafEdwin::GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList)
       
    96 	{ // static
       
    97 	TInt commonAttributes=TCoeColorUse::ENormal|TCoeColorUse::ENeutral;
       
    98 	TCoeColorUse colorUse;
       
    99 	
       
   100 	colorUse.SetLogicalColor(EColorControlDimmedText);
       
   101 	colorUse.SetUse(TCoeColorUse::EFore|TCoeColorUse::EContents|TCoeColorUse::EDimmed|commonAttributes);
       
   102 	aColorUseList.AppendL(colorUse);
       
   103 
       
   104 	colorUse.SetLogicalColor(EColorControlDimmedBackground);
       
   105 	colorUse.SetUse(TCoeColorUse::EBack|TCoeColorUse::EContents|TCoeColorUse::EDimmed|commonAttributes);
       
   106 	aColorUseList.AppendL(colorUse);
       
   107 	
       
   108 	colorUse.SetLogicalColor(EColorControlText);
       
   109 	colorUse.SetUse(TCoeColorUse::EFore|TCoeColorUse::EContents|TCoeColorUse::EActive|commonAttributes);
       
   110 	aColorUseList.AppendL(colorUse);
       
   111 
       
   112 	colorUse.SetLogicalColor(EColorControlBackground);
       
   113 	colorUse.SetUse(TCoeColorUse::EBack|TCoeColorUse::EContents|TCoeColorUse::EActive|commonAttributes);
       
   114 	aColorUseList.AppendL(colorUse);
       
   115 	}
       
   116 
       
   117 /**
       
   118  * Maps aKeyEvent from a specific device harware to standard EPOC key event.
       
   119  *
       
   120  * @since App-Framework_6.1
       
   121  */ 
       
   122 EXPORT_C void LafEdwin::MapKeyEvent(TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/)
       
   123 	{
       
   124 	}
       
   125