Nokia N97 SDK
Example Applications Guide

longtapdetectorexcontainer.h

00001 /**
00002  * Copyright (c) 2007 Nokia Corporation.
00003  * This material, including documentation and any related
00004  * computer programs, is protected by
00005  * copyright controlled by Nokia Corporation.
00006  */
00007 
00008 #ifndef __BUTTONEX_CONTAINER_H__
00009 #define __BUTTONEX_CONTAINER_H__
00010 
00011 #include <coecntrl.h>
00012 #include <aknlongtapdetector.h>
00013 
00014 /**
00015  * Container class
00016  */
00017 
00018 class CLongTapDetectorExContainer : public CCoeControl, 
00019                            public MAknLongTapDetectorCallBack
00020     {
00021     
00022 public: // constructor and destructor
00023     
00024    /*
00025     * C++ default constructor 
00026     */
00027     CLongTapDetectorExContainer();
00028     
00029    /*
00030     * Destructor 
00031     */
00032     virtual ~CLongTapDetectorExContainer();
00033     
00034    /*
00035     * Symbian 2nd constructor 
00036     * aParam aRect The rect for LongTapDetector example
00037     */
00038     void ConstructL( const TRect& aRect );
00039     
00040 public: // from CCoeControl
00041     
00042    /*
00043     * From CCoeControl, Draw
00044     * Draws the application area 
00045     * @param aRect Region of the control to be drawn
00046     */
00047     void Draw( const TRect& aRect ) const;
00048 
00049    /*
00050     * From CCoeControl, CountcomponentControls
00051     * Returns the number of controls 
00052     * @return Number of controls
00053     */
00054     TInt CountComponentControls() const;
00055     
00056    /*
00057     * From CCoeControl, ComponentControl
00058     * Returns pointer to a particular component
00059     * @param aIndex Index of the control
00060     * @return Pointer to component control identified by index
00061     */
00062     CCoeControl* ComponentControl( TInt aIndex ) const;
00063     
00064    /* 
00065     * From CCoeControl, HandleResourceChange
00066     * Responds to changes to the size and position of the contents of this control.
00067     */ 
00068     void SizeChanged();
00069     
00070    /* 
00071     * From CCoeControl, HandleResourceChange
00072     * This function gets called whenever a pointer event occurs.
00073     * @param aEvent The pointer event.
00074     */
00075     void HandleResourceChange( TInt aType );
00076 
00077     /* 
00078     * From CCoeControl, HandlePointerEventL
00079     * Handles a change to the control's resources.
00080     * @param aType TA message UID value
00081     */
00082     void HandlePointerEventL( const TPointerEvent& aEvent );
00083 public: // from MAknLongTapDetectorCallBack
00084     void HandleLongTapEventL( const TPoint& aPenEventLocation, 
00085                                       const TPoint& aPenEventScreenLocation );
00086         
00087 private: // data
00088 
00089    /*
00090     * Label for showing messages
00091     */
00092     CEikLabel* iLabel; // Own
00093     
00094    /*
00095     * Background context 
00096     */
00097     CAknsBasicBackgroundControlContext* iBgContext;  // Own
00098 
00099     CAknLongTapDetector* iLongTapDetector;
00100     
00101     TBool iLongTapCallbackReceived;
00102     };
00103 
00104 #endif // __BUTTONEX_CONTAINER_H__

© Nokia 2009

Back to top