imageeditor/plugins/DrawPlugin/src/CustomerComponet.cpp
author srilekhas
Tue, 14 Sep 2010 17:23:22 +0100
changeset 18 ef7741bd05bf
parent 12 18b321db4884
permissions -rw-r--r--
Image editor- changes to fix Unfrozen export errors.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     1
/*
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     2
 ============================================================================
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     3
 Name		: CustomerComponet.cpp
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     4
 Author	  : henry
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     5
 Version	 : 1.0
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     6
 Copyright   : Your copyright notice
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     7
 Description : CCustomerComponet implementation
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     8
 ============================================================================
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
     9
 */
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    10
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    11
#include "CustomerComponet.h"
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    12
#include "gdi.h"
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    13
#include <eikdef.h>
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    14
#include "imageditorfilterdraw.mbg"
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    15
#include <eikenv.h>
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    16
#include <akniconutils.h>
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    17
#include <aknnotewrappers.h>
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    18
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    19
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    20
// Default constructer
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    21
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    22
//
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    23
CCustomerComponet::CCustomerComponet()
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    24
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    25
	// No implementation required
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    26
	}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    27
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    28
CCustomerComponet::~CCustomerComponet()
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    29
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    30
	if (iMenu)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    31
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    32
		delete iMenu;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    33
		iMenu = NULL;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    34
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    35
	if (iRight)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    36
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    37
		delete iRight;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    38
		iRight = NULL;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    39
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    40
	if (iLeft)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    41
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    42
		delete iLeft;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    43
		iLeft = NULL;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    44
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    45
	if (iTop)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    46
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    47
		delete iTop;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    48
		iTop = NULL;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    49
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    50
	if (iBottom)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    51
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    52
		delete iBottom;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    53
		iBottom = NULL;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    54
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    55
	if (iMenuMask)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    56
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    57
		delete iMenuMask;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    58
		iMenuMask = NULL;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    59
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    60
	if (iRightMask)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    61
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    62
		delete iRightMask;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    63
		iRightMask = NULL;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    64
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    65
	if (iLeftMask)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    66
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    67
		delete iLeftMask;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    68
		iLeftMask = NULL;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    69
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    70
	if (iTopMask)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    71
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    72
		delete iTopMask;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    73
		iTopMask = NULL;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    74
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    75
	if (iBottomMask)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    76
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    77
		delete iBottomMask;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    78
		iBottomMask = NULL;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    79
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    80
	}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    81
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    82
// NewLC
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    83
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    84
//
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    85
CCustomerComponet* CCustomerComponet::NewLC(TRect & aRect, CCoeControl* aParent)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    86
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    87
	CCustomerComponet* self = new (ELeave) CCustomerComponet();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    88
	CleanupStack::PushL(self);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    89
	self->ConstructL(aRect, aParent);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    90
	return self;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    91
	}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    92
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    93
// NewL
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    94
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    95
//
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    96
CCustomerComponet* CCustomerComponet::NewL(TRect & aRect, CCoeControl* aParent)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    97
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    98
	CCustomerComponet* self = CCustomerComponet::NewLC(aRect, aParent);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
    99
	CleanupStack::Pop(); // self;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   100
	return self;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   101
	}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   102
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   103
// ConstructL()
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   104
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   105
//
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   106
void CCustomerComponet::ConstructL(TRect & aRect, CCoeControl* aParent)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   107
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   108
	SetContainerWindowL(*aParent);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   109
	EnableDragEvents();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   110
	SetRect(aRect);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   111
	TRgb color = KRgbBlue;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   112
	//Set transparent effect
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   113
	if (KErrNone == Window().SetTransparencyAlphaChannel())
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   114
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   115
		color.SetAlpha(0);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   116
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   117
	Window().SetBackgroundColor(color);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   118
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   119
	iDrawDirection = EFalse;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   120
	
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   121
	//Load pictures and mask
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   122
	_LIT(iconFileName, "\\resource\\apps\\imageditorfilterdraw.mbm");
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   123
	TFileName iconFile(iconFileName);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   124
	//Menu
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   125
	AknIconUtils::CreateIconL(iMenu, iMenuMask, iconFileName,
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   126
			EMbmImageditorfilterdraw15a, EMbmImageditorfilterdrawMenumask);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   127
	//Right
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   128
	AknIconUtils::CreateIconL(iRight, iRightMask, iconFileName,
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   129
			EMbmImageditorfilterdrawRight, EMbmImageditorfilterdrawRightmask);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   130
	//Left
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   131
	AknIconUtils::CreateIconL(iLeft, iLeftMask, iconFileName,
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   132
			EMbmImageditorfilterdrawLeft, EMbmImageditorfilterdrawLeftmask);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   133
	//Top
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   134
	AknIconUtils::CreateIconL(iTop, iTopMask, iconFileName,
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   135
			EMbmImageditorfilterdrawTop, EMbmImageditorfilterdrawTopmask);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   136
	//Bottom
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   137
	AknIconUtils::CreateIconL(iBottom, iBottomMask, iconFileName,
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   138
			EMbmImageditorfilterdrawBottom, EMbmImageditorfilterdrawBottommask);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   139
	
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   140
	ActivateL();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   141
	}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   142
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   143
// Draw
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   144
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   145
//
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   146
void CCustomerComponet::Draw(const TRect& aRect) const
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   147
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   148
	CWindowGc& gc = SystemGc();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   149
	gc.Clear(aRect);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   150
	//Create rect for showing pictures.
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   151
	TRect menuRect, topRect, bottomRect, rightRect, leftRect;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   152
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   153
	menuRect = aRect;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   154
	//get the width of the rect
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   155
	TInt wx = aRect.iBr.iX - aRect.iTl.iX;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   156
	// get the height of the screen
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   157
	TInt hy = aRect.iBr.iY - aRect.iTl.iY;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   158
	//Set top rect.
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   159
	topRect.SetRect(TPoint(wx / 3 + aRect.iTl.iX, aRect.iTl.iY), TPoint(
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   160
			(wx / 3) * 2 + aRect.iTl.iX, hy / 3 + aRect.iTl.iY));
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   161
	//Set bottom rect
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   162
	bottomRect.SetRect(TPoint((wx/3)+aRect.iTl.iX,(hy/3)*2+aRect.iTl.iY),
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   163
			TPoint((wx/3)*2+aRect.iTl.iX,aRect.iBr.iY));
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   164
	//set right rect.
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   165
	rightRect.SetRect(TPoint(aRect.iTl.iX,hy/3+aRect.iTl.iY), TPoint(wx/3+aRect.iTl.iX,(hy/3)*2+aRect.iTl.iY));
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   166
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   167
	//set left  rect.
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   168
	leftRect.SetRect(TPoint((wx/3)*2+aRect.iTl.iX,hy/3+aRect.iTl.iY),
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   169
			TPoint(aRect.iBr.iX,(hy/3)*2+aRect.iTl.iY));
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   170
	//Set set size for pictures
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   171
	
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   172
	AknIconUtils::SetSize(iMenu, aRect.Size(), EAspectRatioPreserved);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   173
	AknIconUtils::SetSize(iMenuMask, aRect.Size(), EAspectRatioPreserved);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   174
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   175
	AknIconUtils::SetSize(iTop, topRect.Size(), EAspectRatioPreserved);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   176
	AknIconUtils::SetSize(iTopMask, topRect.Size(), EAspectRatioPreserved);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   177
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   178
	AknIconUtils::SetSize(iBottom, bottomRect.Size(), EAspectRatioPreserved);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   179
	AknIconUtils::SetSize(iBottomMask, bottomRect.Size(), EAspectRatioPreserved);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   180
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   181
	AknIconUtils::SetSize(iRight, rightRect.Size(), EAspectRatioPreserved);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   182
	AknIconUtils::SetSize(iRightMask, rightRect.Size(), EAspectRatioPreserved);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   183
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   184
	AknIconUtils::SetSize(iLeft, leftRect.Size(), EAspectRatioPreserved);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   185
	AknIconUtils::SetSize(iLeftMask, leftRect.Size(), EAspectRatioPreserved);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   186
	
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   187
	//Draw menu
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   188
	gc.DrawBitmapMasked(menuRect, iMenu, TRect(TPoint(0, 0),
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   189
			iMenu->SizeInPixels()), iMenuMask, ETrue);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   190
	//if the user press the menu bottom show direction rect.
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   191
	if (iDrawDirection)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   192
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   193
		gc.DrawBitmapMasked(topRect, iTop, TRect(TPoint(0, 0),
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   194
				iTop->SizeInPixels()), iTopMask, ETrue);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   195
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   196
		gc.DrawBitmapMasked(bottomRect, iBottom, TRect(TPoint(0, 0),
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   197
				iBottom->SizeInPixels()), iBottomMask, ETrue);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   198
		gc.DrawBitmapMasked(leftRect, iRight, TRect(TPoint(0, 0),
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   199
				iRight->SizeInPixels()), iRightMask, ETrue);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   200
		gc .DrawBitmapMasked(rightRect, iLeft, TRect(TPoint(0, 0),
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   201
				iLeft->SizeInPixels()), iLeftMask, ETrue);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   202
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   203
	}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   204
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   205
// SetRect
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   206
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   207
//
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   208
void CCustomerComponet::SetRect(TRect& aRect)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   209
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   210
	DrawNow(aRect);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   211
	}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   212
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   213
// SizeChanged()
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   214
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   215
//
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   216
void CCustomerComponet::SizeChanged()
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   217
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   218
//Nothing done here.
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   219
	}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   220
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   221
// HandlePointerEventL()
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   222
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   223
//
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   224
void CCustomerComponet::HandlePointerEventL(const TPointerEvent& aPointerEvent)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   225
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   226
	switch (aPointerEvent.iType)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   227
		{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   228
		
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   229
		case TPointerEvent::EButton1Down:
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   230
			{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   231
			iDrawDirection = ETrue;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   232
			iButtonFlag = ETrue;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   233
			iPointerObserver->HandlePointerNotify(this);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   234
			DrawNow();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   235
			}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   236
			break;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   237
		case TPointerEvent::EButton1Up:
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   238
			{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   239
			iDrawDirection = EFalse;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   240
			iButtonFlag = EFalse;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   241
			iPointerObserver->HandlePointerNotify(this);
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   242
			DrawNow();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   243
			}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   244
			break;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   245
		case TPointerEvent::EDrag:
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   246
			{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   247
			DrawNow();
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   248
			}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   249
			break;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   250
		default:
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   251
			break;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   252
		}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   253
	}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   254
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   255
// SetHandlePointerObserver()
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   256
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   257
//
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   258
void CCustomerComponet::SetHandlePointerObserver(
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   259
		MHandlePointerObserver* aHandlePointerObserver)
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   260
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   261
	iPointerObserver = aHandlePointerObserver;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   262
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   263
	}
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   264
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   265
// GetButtonType()
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   266
// ---------------------------------------------------------------------------
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   267
//
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   268
TBool CCustomerComponet::GetButtonType()
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   269
	{
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   270
	return iButtonFlag;
18b321db4884 *m enhance
qifeima <>
parents:
diff changeset
   271
	}