1.1 --- a/epoc32/include/coeccntx.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,119 +0,0 @@
1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// 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.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -#ifndef __COECCNTX_H__
1.20 -#define __COECCNTX_H__
1.21 -
1.22 -#include <e32std.h>
1.23 -#include <e32base.h>
1.24 -#include <w32std.h>
1.25 -
1.26 -/** Interface to allow sharing of graphics settings between controls.
1.27 -
1.28 -The interface provides functions to set the graphics context of a control
1.29 -before drawing. If a control has its iContext member set, the UI Control Framework
1.30 -calls functions defined by this interface when a control is about to be drawn.
1.31 -Developers must implement PrepareContext(), which is called by the framework,
1.32 -to initialise the control's window with the required graphics settings.
1.33 -
1.34 -To use control contexts, a control should inherit from an MCoeControlContext-derived
1.35 -class. To share the context between controls, this control should then be
1.36 -set as the context for all controls that wish to share it. This is done by
1.37 -setting the iContext member of each of the controls, using CCoeControl::SetControlContext()
1.38 -and CCoeControl::CopyControlContextFrom().
1.39 -
1.40 -@publishedAll
1.41 -@released */
1.42 -class MCoeControlContext
1.43 - {
1.44 -public:
1.45 - IMPORT_C virtual void ActivateContext(CWindowGc& aGc,RDrawableWindow& aWindow) const;
1.46 - IMPORT_C virtual void ResetContext(CWindowGc& aGc) const;
1.47 - IMPORT_C virtual void PrepareContext(CWindowGc& aGc) const;
1.48 -protected:
1.49 - IMPORT_C MCoeControlContext();
1.50 -
1.51 -private:
1.52 - IMPORT_C virtual void MCoeControlContext_Reserved1();
1.53 - IMPORT_C virtual void MCoeControlContext_Reserved2();
1.54 -
1.55 -private:
1.56 - TInt iMCoeControlContext_Reserved1;
1.57 - };
1.58 -
1.59 -/** Brush and pen graphics context.
1.60 -
1.61 -This class allows an MCoeControlContext to be instantiated and used to set
1.62 -brush and pen properties before drawing a control.
1.63 -
1.64 -@publishedAll
1.65 -@released */
1.66 -class CCoeBrushAndPenContext : public CBase, public MCoeControlContext
1.67 - {
1.68 -public:
1.69 - IMPORT_C static CCoeBrushAndPenContext* NewL();
1.70 - //
1.71 - IMPORT_C void SetBrushStyle(CWindowGc::TBrushStyle aBrushStyle);
1.72 - IMPORT_C void SetBrushColor(TRgb aColor);
1.73 - IMPORT_C void SetBrushBitmap(const CFbsBitmap& aBitmap);
1.74 - IMPORT_C void SetPenColor(TRgb aColor);
1.75 - //
1.76 - IMPORT_C CWindowGc::TBrushStyle BrushStyle() const;
1.77 - IMPORT_C TRgb BrushColor() const;
1.78 - IMPORT_C const CFbsBitmap& BrushBitmap() const;
1.79 - IMPORT_C TRgb PenColor() const;
1.80 -protected: // from MCoeControlContext
1.81 - IMPORT_C void PrepareContext(CWindowGc& aGc) const;
1.82 -private:
1.83 - CCoeBrushAndPenContext();
1.84 -private:
1.85 - CWindowGc::TBrushStyle iBrushStyle;
1.86 - TRgb iBrushColor;
1.87 - const CFbsBitmap* iBitmap;
1.88 - TRgb iPenColor;
1.89 - };
1.90 -
1.91 -
1.92 -/** Protocol for sharing brush settings used in graphics operations.
1.93 -
1.94 -It can be used to set brush and pen properties before drawing a control.
1.95 -
1.96 -The mixin provides a default implementation of a control context. It implements
1.97 -PrepareContext() to initialise brush settings used in graphics operations.
1.98 -Its data members are public so that the brush style, brush colour and brush
1.99 -pattern can be set by application code.
1.100 -
1.101 -@publishedAll
1.102 -@deprecated */
1.103 -class MCoeControlBrushContext : public MCoeControlContext
1.104 - {
1.105 -public:
1.106 - /** Cause vtable & typeinfo to be exported */
1.107 - IMPORT_C MCoeControlBrushContext();
1.108 -protected: // from MCoeControlContext
1.109 - IMPORT_C void PrepareContext(CWindowGc& aGc) const;
1.110 -public:
1.111 - /** Brush style. (Not required if iBitmap is set.) */
1.112 - CWindowGc::TBrushStyle iBrushStyle;
1.113 - /** Brush colour. (Not required if iBitmap is set.) */
1.114 - TRgb iBrushColor;
1.115 - /** Brush pattern. */
1.116 - const CFbsBitmap* iBitmap;
1.117 -
1.118 -private:
1.119 - TInt iMCoeControlBrushContext_Reserved1;
1.120 - };
1.121 -
1.122 -#endif