|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: View class for playing media in full screen |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <coecntrl.h> |
|
21 |
|
22 #include "BavpViewFullScreen.h" |
|
23 #include "BavpControllerVideo.h" |
|
24 #include "BavpLogger.h" |
|
25 |
|
26 // ================= MEMBER FUNCTIONS ======================= |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CBavpViewFullScreen::CBavpViewFullScreen |
|
30 // C++ default constructor can NOT contain any code, that |
|
31 // might leave. |
|
32 // ----------------------------------------------------------------------------- |
|
33 CBavpViewFullScreen::CBavpViewFullScreen(CBavpControllerVideo* aController) |
|
34 :iNormalController(aController) |
|
35 { |
|
36 } |
|
37 |
|
38 // ----------------------------------------------------------------------------- |
|
39 // CBavpViewFullScreen::ConstructL |
|
40 // Symbian 2nd phase constructor can leave. |
|
41 // ----------------------------------------------------------------------------- |
|
42 void CBavpViewFullScreen::ConstructL() |
|
43 { |
|
44 CreateWindowL(); |
|
45 SetExtent( TPoint(), TSize() ); |
|
46 ActivateL(); |
|
47 SetPointerCapture( ETrue ); |
|
48 ClaimPointerGrab( ETrue ); |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CBavpViewFullScreen::HandlePointerEventL |
|
53 // Handles pointer events, simulate a KeyDown event to revert to normal screen |
|
54 // ----------------------------------------------------------------------------- |
|
55 void CBavpViewFullScreen::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
56 { |
|
57 Log( EFalse, _L("CBavpViewFullScreen::HandlePointerEventL") ); |
|
58 switch (aPointerEvent.iType) |
|
59 { |
|
60 case TPointerEvent::EButton1Down: |
|
61 { |
|
62 //simulate a keyup event |
|
63 TKeyEvent aKeyEvent; |
|
64 aKeyEvent.iCode = 0; |
|
65 aKeyEvent.iModifiers = 0; |
|
66 aKeyEvent.iRepeats = 0; |
|
67 aKeyEvent.iScanCode = EStdKeyDownArrow; |
|
68 //convert back to normal screen |
|
69 iNormalController->HandleKeysL(aKeyEvent, EEventKeyDown); |
|
70 break; |
|
71 } |
|
72 default: |
|
73 break; |
|
74 } |
|
75 |
|
76 |
|
77 } |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CBavpViewFullScreen::NewL() |
|
80 // Two-phased constructor. |
|
81 // ----------------------------------------------------------------------------- |
|
82 CBavpViewFullScreen* CBavpViewFullScreen::NewL(CBavpControllerVideo* aController) |
|
83 { |
|
84 CBavpViewFullScreen* self = new (ELeave) CBavpViewFullScreen(aController); |
|
85 |
|
86 CleanupStack::PushL( self ); |
|
87 self->ConstructL(); |
|
88 CleanupStack::Pop(); |
|
89 |
|
90 return self; |
|
91 } |
|
92 |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // CBavpViewFullScreen::~CBavpViewFullScreen |
|
96 // Destructor |
|
97 // ----------------------------------------------------------------------------- |
|
98 CBavpViewFullScreen::~CBavpViewFullScreen() |
|
99 { |
|
100 // ignore error |
|
101 //release pointer control |
|
102 SetPointerCapture(EFalse); |
|
103 } |
|
104 |
|
105 // ----------------------------------------------------------------------------- |
|
106 // CBavpViewFullScreen::Draw |
|
107 // This method is called by CCoeControl::Draw |
|
108 // ----------------------------------------------------------------------------- |
|
109 void CBavpViewFullScreen::Draw( const TRect& aRect ) const |
|
110 { |
|
111 if ( Window().DisplayMode() == EColor16MA ) |
|
112 { |
|
113 CWindowGc& gc = SystemGc(); |
|
114 gc.SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha ); |
|
115 gc.SetBrushColor( TRgb::Color16MA(0) ); |
|
116 gc.Clear( aRect ); |
|
117 } |
|
118 } |
|
119 |
|
120 // End of File |