Nokia N97 SDK
Example Applications Guide

CTactileExampleSquare Class Reference

#include <tactileexamplesquare.h>

Inheritance diagram for CTactileExampleSquare:

List of all members.

Detailed Description

CTactileExampleSquare control class.

Definition at line 32 of file tactileexamplesquare.h.


Public Member Functions

virtual  ~CTactileExampleSquare ()
void  EnableFeedback (TBool aEnabled)
TBool  HitRegionContains (const TPoint &aPoint, const CCoeControl &) const

Static Public Member Functions

static CTactileExampleSquare *  NewL (const TRect &aRect, const CCoeControl *aParent)

Protected Member Functions

void  Draw (const TRect &aRect) const
void  PositionChanged ()
void  SizeChanged ()

Private Member Functions

  CTactileExampleSquare ()
void  ConstructL (const TRect &aRect, const CCoeControl *aParent)

Private Attributes

MTouchFeedback *  iFeedback


Constructor & Destructor Documentation

CTactileExampleSquare::~CTactileExampleSquare (   )  [virtual]
 

Destructor.

Definition at line 44 of file tactileexamplesquare.cpp.

References iFeedback.

00045     {
00046     if ( iFeedback )
00047         {
00048         iFeedback->RemoveFeedbackForControl( this );
00049         }
00050     }


Member Function Documentation

CTactileExampleSquare * CTactileExampleSquare::NewL (  const TRect &  aRect,
const CCoeControl *  aParent
)  [static]
 

First phase of two-phased constructor

return the created CTactileExampleSquare object

Definition at line 29 of file tactileexamplesquare.cpp.

References ConstructL().

Referenced by CTactileExampleAppView::ConstructL().

00031     {
00032     CTactileExampleSquare* self = new ( ELeave ) CTactileExampleSquare;
00033     CleanupStack::PushL( self );
00034     self->ConstructL( aRect, aParent );
00035     CleanupStack::Pop( self );
00036     return self;
00037     }

void CTactileExampleSquare::EnableFeedback (  TBool  aEnabled  ) 
 

Enables/disables tactile feedback for this control

Parameters:
aEnabled  Use ETrue to enable feedback and EFalse to disable feedback

Definition at line 57 of file tactileexamplesquare.cpp.

References iFeedback.

Referenced by CTactileExampleAppView::HandleControlEventL(), and CTactileExampleAppView::HandleResourceChange().

00058     {
00059     iFeedback->EnableFeedbackForControl( this, aEnabled );
00060     }

TBool CTactileExampleSquare::HitRegionContains (  const TPoint &  aPoint,
const CCoeControl & 
)  const
 

From MCoeControlHitTest. Tests whether a pointer event occurred inside the control's hit region

Parameters:
aPoint  The position of the pointer event
aControl 

Definition at line 68 of file tactileexamplesquare.cpp.

00070     {
00071     return IsVisible() ? Rect().Contains( aPoint ) : EFalse;
00072     }

void CTactileExampleSquare::Draw (  const TRect &  aRect  )  const [protected]
 

From CCoeControl. Draw this CTactileExampleSquare custom control to the screen.

Parameters:
aRect  the rectangle of this control that needs updating

Definition at line 80 of file tactileexamplesquare.cpp.

00081     {
00082     CWindowGc& gc = SystemGc();
00083     gc.SetPenStyle( CGraphicsContext::ENullPen );
00084     gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
00085     gc.SetBrushColor( KRgbRed );
00086     gc.DrawRect( Rect() );
00087     }

void CTactileExampleSquare::PositionChanged (   )  [protected]
 

From CCoeControl. Called by framework whenever the application calls SetPosition() on the control.

Definition at line 95 of file tactileexamplesquare.cpp.

References iFeedback.

00096     {
00097     iFeedback->ChangeFeedbackArea( this, 0, Rect() );
00098     }

void CTactileExampleSquare::SizeChanged (   )  [protected]
 

From CCoeControl. Called by framework whenever the application calls SizeChanged() on the control.

Definition at line 106 of file tactileexamplesquare.cpp.

References iFeedback.

00107     {
00108     iFeedback->SetFeedbackArea( this, 0, Rect(),
00109         ETouchFeedbackBasic, ETouchEventStylusDown );
00110     }

void CTactileExampleSquare::ConstructL (  const TRect &  aRect,
const CCoeControl *  aParent
)  [private]
 

Second phase of constructor.

Definition at line 127 of file tactileexamplesquare.cpp.

References iFeedback.

Referenced by NewL().

00129     {
00130     // Get a pointer to touch feedback instance
00131     iFeedback = MTouchFeedback::Instance();
00132     User::LeaveIfNull( iFeedback );
00133 
00134     SetContainerWindowL( *aParent );
00135     SetRect( aRect );
00136     
00137     // Set hit tester to be object itself
00138     SetHitTest( this );
00139 
00140     // Set feedback area for this control
00141     iFeedback->SetFeedbackArea( this, 0, Rect(),
00142         ETouchFeedbackBasic, ETouchEventStylusDown );
00143 
00144     ActivateL();
00145     }


Member Data Documentation

MTouchFeedback* CTactileExampleSquare::iFeedback [private]
 

Pointer to touch feedback instance Not own.

Definition at line 110 of file tactileexamplesquare.h.

Referenced by ConstructL(), EnableFeedback(), PositionChanged(), SizeChanged(), and ~CTactileExampleSquare().


The documentation for this class was generated from the following files:

© Nokia 2009

Back to top