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

Symbian

开发平台:

C/C++

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