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

Symbian

开发平台:

C/C++

  1. // Copyright (c) 2006 Nokia Corporation.
  2. // INCLUDE FILES
  3. #include "S60ClientServLabAppUi.h"
  4. #include "S60ClientServLabContainer.h" 
  5. #include <S60ClientServerLab.rsg>
  6. #include "s60ClientServerLab.hrh"
  7. #include <avkon.hrh>
  8. // ================= MEMBER FUNCTIONS =======================
  9. //
  10. // ----------------------------------------------------------
  11. // CS60ClientServLabAppUi::ConstructL()
  12. // ?implementation_description
  13. // ----------------------------------------------------------
  14. //
  15. void CS60ClientServLabAppUi::ConstructL()
  16.     {
  17.     BaseConstructL();
  18.     iAppContainer = new (ELeave) CS60ClientServLabContainer;
  19.     iAppContainer->SetMopParent(this);
  20.     iAppContainer->ConstructL( ClientRect() );
  21.     AddToStackL( iAppContainer );
  22.     }
  23. // ----------------------------------------------------
  24. // CS60ClientServLabAppUi::~CS60ClientServLabAppUi()
  25. // Destructor
  26. // Frees reserved resources
  27. // ----------------------------------------------------
  28. //
  29. CS60ClientServLabAppUi::~CS60ClientServLabAppUi()
  30.     {
  31.     if (iAppContainer)
  32.         {
  33.         RemoveFromStack( iAppContainer );
  34.         delete iAppContainer;
  35.         }
  36.    }
  37. // ------------------------------------------------------------------------------
  38. // CS60ClientServLabAppUi::::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
  39. //  This function is called by the EIKON framework just before it displays
  40. //  a menu pane. Its default implementation is empty, and by overriding it,
  41. //  the application can set the state of menu items dynamically according
  42. //  to the state of application data.
  43. // ------------------------------------------------------------------------------
  44. //
  45. void CS60ClientServLabAppUi::DynInitMenuPaneL(
  46.     TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
  47.     {
  48.     }
  49. // ----------------------------------------------------
  50. // CS60ClientServLabAppUi::HandleKeyEventL(
  51. //     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
  52. // ?implementation_description
  53. // ----------------------------------------------------
  54. //
  55. TKeyResponse CS60ClientServLabAppUi::HandleKeyEventL(
  56.     const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
  57.     {
  58.     return EKeyWasNotConsumed;
  59.     }
  60. // ----------------------------------------------------
  61. // CS60ClientServLabAppUi::HandleCommandL(TInt aCommand)
  62. // ?implementation_description
  63. // ----------------------------------------------------
  64. //
  65. void CS60ClientServLabAppUi::HandleCommandL(TInt aCommand)
  66.     {
  67.     switch ( aCommand )
  68.         {
  69.         case EAknSoftkeyBack:
  70.         case EEikCmdExit:
  71.             Exit();
  72.             break;
  73.         case ES60ClientServLabCmdWriteFile:
  74.             iAppContainer->WriteFileL();
  75.             break;
  76.         default:
  77.             break;      
  78.         }
  79.     }
  80. // -----------------------------------------------------------------------------
  81. // CS60ClientServLabAppUi::HandleScreenDeviceChangedL
  82. // Handle change in screen resolution.
  83. // -----------------------------------------------------------------------------
  84. //
  85. void CS60ClientServLabAppUi::HandleScreenDeviceChangedL()
  86.     {
  87.     CAknAppUi::HandleScreenDeviceChangedL();
  88.     // Reposition the view
  89.     if ( iAppContainer )
  90.         {
  91.         iAppContainer->SetRect(ClientRect());
  92.         }
  93.     }
  94.     
  95. // End of File