S60UIExamplePlayContainer.h
上传用户:laixiong
上传日期:2007-03-11
资源大小:2994k
文件大小:4k
源码类别:

Symbian

开发平台:

C/C++

  1. // Copyright (c) 2006 Nokia Corporation.
  2. #ifndef __S60UIEXAMPLE_PLAYCONTAINER_H__
  3. #define __S60UIEXAMPLE_PLAYCONTAINER_H__
  4. #include <aknview.h>
  5. class CS60UIExampleModel;
  6. class CAknNavigationDecorator;
  7. class CAknNavigationControlContainer;
  8. /**
  9. * CS60UIExamplePlayContainer container control class.
  10. * An instance of CS60UIExamplePlayContainer contains the view drawn to the screen
  11. * for CS60UIExamplePlayView
  12. */
  13. class CS60UIExamplePlayContainer : public CCoeControl 
  14.     {
  15.     public:  // Constructors and destructor
  16.         /**
  17.         * NewL.
  18.         * Two-phased constructor.
  19.         * Create a CS60UIExamplePlayContainer object, which will draw itself to aRect.
  20.         * @param aRect The rectangle this view will be drawn to.
  21.         * @return a pointer to the created instance of CS60UIExamplePlayContainer.
  22.         */
  23.         static CS60UIExamplePlayContainer* NewL(const TRect& aRect,
  24.                                                 CS60UIExampleModel& aModel );
  25.         /**
  26.         * NewLC.
  27.         * Two-phased constructor.
  28.         * Create a CS60UIExamplePlayContainer object, which will draw itself to aRect.
  29.         * @param aRect The rectangle this view will be drawn to.
  30.         * @return a pointer to the created instance of CS60UIExamplePlayContainer.
  31.         */
  32.         static CS60UIExamplePlayContainer* NewLC(const TRect& aRect,
  33.                                                  CS60UIExampleModel& aModel );
  34.         /**
  35.         * ConstructL
  36.         * 2nd phase constructor.
  37.         * @param aRect Frame rectangle for container.
  38.         */
  39.         void ConstructL(const TRect& aRect);
  40.         
  41.         virtual ~CS60UIExamplePlayContainer();
  42.     public: // from CoeControl
  43.         
  44.         /**
  45.         * SizeChanged
  46.         * Prepare layout based on screen size
  47.         */
  48.         void SizeChanged();
  49.        /**
  50.         * HandleResourceChange
  51.         * Handle Resource change. In this case a change in screen size is 
  52.         * handled by calling SetRect, and hence SizeChanged
  53.         */
  54.          void HandleResourceChange(TInt aType);
  55.         /**
  56.         * Draw
  57.         * Draw this CS60UIExamplePlayContainer to the screen.
  58.         * @param aRect the rectangle of this view that needs updating
  59.         */
  60.         void Draw(const TRect& aRect) const;
  61.         
  62.         /**
  63.         * OfferKeyEventL()
  64.         * Handles the key events.
  65.         */
  66.         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
  67.                                     TEventCode aType);
  68.     private:
  69.             
  70.         /**
  71.         * CS60UIExamplePlayContainer.
  72.         * C++ default constructor.
  73.         */
  74.         CS60UIExamplePlayContainer(CS60UIExampleModel& aModel);
  75.     public:  //new function
  76.         /**
  77.         * UpdateNaviPane
  78.         * Update the navipane with the level and score
  79.         */
  80.         void UpdateNaviPaneL();
  81.         
  82.     private: //data
  83.         /**
  84.         * iModel
  85.         * Reference to model containing data
  86.         */                                  
  87.         CS60UIExampleModel& iModel;
  88.         /**
  89.         * iNaviPane
  90.         * pointer to navipane (not owned)
  91.         */
  92.         CAknNavigationControlContainer* iNaviPane;
  93.         /**
  94.         * iNaviDecorator
  95.         * navi pane decorator (label with level and score)
  96.         */
  97.         CAknNavigationDecorator* iNaviDecorator;
  98.         /**
  99.         * Bitmap to hold background graphic
  100.         */
  101.         CFbsBitmap* iBkgBitmap;
  102.     };
  103. #endif // __S60UIEXAMPLE_PLAYCONTAINER_H__
  104. // End of File