HdmiOutput.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Copyright (c) 2011 Nokia Corporation.
  3. */
  4. /*
  5. ============================================================================
  6. Name : HdmiOutput.h
  7. Author : jarnoh
  8. Version : 1.0
  9. Description : Provides HDMI output window and callback when HDMI is plugged in
  10. ============================================================================
  11. */
  12. #ifndef HDMIOUTPUT_H
  13. #define HDMIOUTPUT_H
  14. // INCLUDES
  15. #include <e32std.h>
  16. #include <e32base.h>
  17. #include <w32std.h>
  18. #include <coedef.h>
  19. // CAccMonitor API
  20. #include <AccMonitor.h>
  21. // CLASS DECLARATION
  22. class CHdmiOutput;
  23. class MHdmiOutputCallback
  24. {
  25. public:
  26. virtual void OutputChanged(CHdmiOutput *self)=0;
  27. };
  28. /**
  29. * CHdmiOutput
  30. *
  31. */
  32. class CHdmiOutput : public CBase, public MAccMonitorObserver
  33. {
  34. public:
  35. // Constructors and destructor
  36. /**
  37. * Destructor.
  38. */
  39. ~CHdmiOutput();
  40. /**
  41. * Two-phased constructor.
  42. */
  43. static CHdmiOutput* NewL();
  44. /**
  45. * Two-phased constructor.
  46. */
  47. static CHdmiOutput* NewLC();
  48. public:
  49. TBool IsHdmiConnected();
  50. RWindow *HdmiWindow();
  51. // MAccMonitorObserver
  52. private:
  53. virtual void ConnectedL(CAccMonitorInfo *aAccessoryInfo);
  54. virtual void DisconnectedL(CAccMonitorInfo *aAccessoryInfo);
  55. virtual void AccMonitorObserverError(TInt aError);
  56. private:
  57. virtual void CreateWindow();
  58. virtual void DestroyWindow();
  59. private:
  60. /**
  61. * Constructor for performing 1st stage construction
  62. */
  63. CHdmiOutput();
  64. /**
  65. * EPOC default constructor for performing 2nd stage construction
  66. */
  67. void ConstructL();
  68. CAccMonitor *iAccMonitor;
  69. RWsSession iWsSession;
  70. CWsScreenDevice *iScreenDevice;
  71. RWindowGroup *iWindowGroup;
  72. RWindow *iWindow;
  73. TBool iHdmiEnabled;
  74. public:
  75. MHdmiOutputCallback *iCallback;
  76. };
  77. #endif // HDMIOUTPUT_H