epoc32/include/frmparam.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/frmparam.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/frmparam.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,82 @@
     1.4 -frmparam.h
     1.5 +// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +// FORM global parameters; held in thread-local storage.
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +#ifndef __FRMPARAM_H__
    1.23 +#define __FRMPARAM_H__
    1.24 +
    1.25 +#include <gdi.h>
    1.26 +
    1.27 +
    1.28 +/** 
    1.29 +Specifies the protocol for getting system colours for use in text views. A
    1.30 +class which implements this protocol allows an application (or a thread,
    1.31 +because a pointer to the object is held in thread-local storage) to use system
    1.32 +colours in text views.
    1.33 +
    1.34 +You should create an object of an MFormParam-derived class which implements the
    1.35 +SystemColor() function. Then, pass a pointer to the object to the static
    1.36 +function MFormParam::Set(). The MFormParam-derived object is owned by the
    1.37 +caller of Set(). When system colours are no longer needed, you should cancel
    1.38 +them by calling MFormParam::Set(NULL). It is the caller's responsibility to
    1.39 +cause the text view to be redrawn after system colours are changed.
    1.40 +
    1.41 +CTextLayout uses the colour translation function SystemColor() (if an
    1.42 +MFormParam-derived object is present) to set the pen and brush colours for
    1.43 +drawing components of the text view. It calls MFormParam::Get() before each
    1.44 +draw. This enables an application to introduce system colours, change the
    1.45 +parameter object, or abolish system colours, and redraw everything correctly;
    1.46 +no information is left over from the last draw.
    1.47 +@publishedAll
    1.48 +@released
    1.49 +*/
    1.50 +class MFormParam
    1.51 +
    1.52 +	{
    1.53 +	public:
    1.54 +
    1.55 +	/** Translates 8-bit logical colour indices to physical colours pure
    1.56 +	virtual function.
    1.57 +
    1.58 +	The colour index is stored in a TLogicalRgb object and is returned by
    1.59 +	TLogicalRgb::SystemColorIndex().
    1.60 +
    1.61 +	There are three reserved index values:
    1.62 +
    1.63 +	Zero means the logical colour does not map to a system colour: the logical
    1.64 +	colour is in fact an ordinary TRgb. This function should not normally be
    1.65 +	called with this value.
    1.66 +
    1.67 +	254 and 255 are default foreground and background colours respectively, and
    1.68 +	should be converted to the GUI's standard foreground and background colours
    1.69 +
    1.70 +	The values 1-253 are reserved for the use of the GUI and can be interpreted
    1.71 +	as convenient. These can be interpreted as
    1.72 +	TLogicalColor::EColorWindowBackground upward; this mapping can be done by
    1.73 +	subtracting one from the index number aColorIndex.
    1.74 +
    1.75 +	@param aColorIndex Logical colour index. Between 1 and 255 inclusive.
    1.76 +	@param aDefaultColor The default colour. This is the colour to be used if
    1.77 +	no translation is performed. This allows translation to change certain
    1.78 +	indices but not others, (by passing the default colour back unchanged).
    1.79 +	@return The physical colour which maps to the logical colour index. */
    1.80 +	virtual TRgb SystemColor(TUint aColorIndex,TRgb aDefaultColor) const = 0;
    1.81 +	IMPORT_C virtual void Reserved();
    1.82 +	IMPORT_C static void Set(const MFormParam* aParam);
    1.83 +	IMPORT_C static const MFormParam* Get();
    1.84 +	};
    1.85 +
    1.86 +#endif // __FRMPARAM_H__