|
Nokia N97 SDK Example Applications Guide |
00001 /* 00002 * ============================================================================ 00003 * Name : tactileexamplesquare.h 00004 * Part of : Tactile Example 00005 * Interface : N/A 00006 * Description : Declares the custom control 00007 * Version : 00008 * 00009 * Copyright (c) 2008 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================ 00014 */ 00015 00016 #ifndef __TACTILEEXAMPLESQUARE_H__ 00017 #define __TACTILEEXAMPLESQUARE_H__ 00018 00019 // INCLUDE FILES 00020 #include <coecntrl.h> 00021 00022 // FORWARD DECLARATIONS 00023 class MTouchFeedback; 00024 00025 00026 // CLASS DECLARATION 00027 00028 /** 00029 * CTactileExampleSquare control class. 00030 * 00031 */ 00032 class CTactileExampleSquare : public CCoeControl, MCoeControlHitTest 00033 { 00034 public: 00035 00036 /** 00037 * First phase of two-phased constructor 00038 * 00039 * return the created CTactileExampleSquare object 00040 */ 00041 static CTactileExampleSquare* NewL( 00042 const TRect& aRect, const CCoeControl* aParent ); 00043 00044 /** 00045 * Destructor. 00046 */ 00047 virtual ~CTactileExampleSquare(); 00048 00049 /** 00050 * Enables/disables tactile feedback for this control 00051 * @param aEnabled Use ETrue to enable feedback and EFalse 00052 * to disable feedback 00053 */ 00054 void EnableFeedback( TBool aEnabled ); 00055 00056 00057 // from base class MCoeControlHitTest 00058 00059 /** 00060 * From MCoeControlHitTest. 00061 * Tests whether a pointer event occurred inside the control's hit region 00062 * @param aPoint The position of the pointer event 00063 * @param aControl 00064 */ 00065 TBool HitRegionContains( const TPoint& aPoint, const CCoeControl& /*aControl*/ ) const; 00066 00067 00068 protected: 00069 00070 // from base class CCoeControl 00071 00072 /** 00073 * From CCoeControl. 00074 * Draw this CTactileExampleSquare custom control to the screen. 00075 * @param aRect the rectangle of this control that needs updating 00076 */ 00077 void Draw( const TRect& aRect ) const; 00078 00079 /** 00080 * From CCoeControl. 00081 * Called by framework whenever the application 00082 * calls SetPosition() on the control. 00083 */ 00084 void PositionChanged(); 00085 00086 /** 00087 * From CCoeControl. 00088 * Called by framework whenever the application 00089 * calls SizeChanged() on the control. 00090 */ 00091 void SizeChanged(); 00092 00093 00094 private: 00095 00096 CTactileExampleSquare(); 00097 00098 /** 00099 * Second phase of constructor. 00100 */ 00101 void ConstructL( const TRect& aRect, const CCoeControl* aParent ); 00102 00103 00104 private: // Data 00105 00106 /** 00107 * Pointer to touch feedback instance 00108 * Not own. 00109 */ 00110 MTouchFeedback* iFeedback; 00111 }; 00112 00113 #endif // __TACTILEEXAMPLESQUARE_H__ 00114 // End of File
|
© Nokia 2009 |