|
1 /* |
|
2 * Copyright (c) 2002 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 "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: TelephonyAudioRouting Test Application |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include <coemain.h> |
|
20 #include "myplayerappview.h" |
|
21 |
|
22 // ============================ MEMBER FUNCTIONS =============================== |
|
23 |
|
24 // ----------------------------------------------------------------------------- |
|
25 // CMyPlayerAppView::NewL() |
|
26 // Two-phased constructor. |
|
27 // ----------------------------------------------------------------------------- |
|
28 // |
|
29 CMyPlayerAppView* CMyPlayerAppView::NewL(const TRect& aRect) |
|
30 { |
|
31 CMyPlayerAppView* self = CMyPlayerAppView::NewLC(aRect); |
|
32 CleanupStack::Pop(self); |
|
33 return self; |
|
34 } |
|
35 |
|
36 // ----------------------------------------------------------------------------- |
|
37 // CMyPlayerAppView::NewLC() |
|
38 // Two-phased constructor. |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 CMyPlayerAppView* CMyPlayerAppView::NewLC(const TRect& aRect) |
|
42 { |
|
43 CMyPlayerAppView* self = new (ELeave) CMyPlayerAppView; |
|
44 CleanupStack::PushL(self); |
|
45 self->ConstructL(aRect); |
|
46 return self; |
|
47 } |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CMyPlayerAppView::ConstructL() |
|
51 // Symbian 2nd phase constructor can leave. |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 void CMyPlayerAppView::ConstructL(const TRect& aRect) |
|
55 { |
|
56 // Create a window for this application view |
|
57 CreateWindowL(); |
|
58 |
|
59 // Set the windows size |
|
60 SetRect(aRect); |
|
61 |
|
62 // Activate the window, which makes it ready to be drawn |
|
63 ActivateL(); |
|
64 } |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // CMyPlayerAppView::CMyPlayerAppView() |
|
68 // C++ default constructor can NOT contain any code, that might leave. |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 CMyPlayerAppView::CMyPlayerAppView() |
|
72 { |
|
73 // No implementation required |
|
74 } |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // CMyPlayerAppView::~CMyPlayerAppView() |
|
78 // Destructor. |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 CMyPlayerAppView::~CMyPlayerAppView() |
|
82 { |
|
83 // No implementation required |
|
84 } |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // CMyPlayerAppView::Draw() |
|
88 // Draws the display. |
|
89 // ----------------------------------------------------------------------------- |
|
90 // |
|
91 void CMyPlayerAppView::Draw(const TRect& /*aRect*/) const |
|
92 { |
|
93 // Get the standard graphics context |
|
94 CWindowGc& gc = SystemGc(); |
|
95 |
|
96 // Gets the control's extent |
|
97 TRect drawRect(Rect()); |
|
98 |
|
99 // Clears the screen |
|
100 gc.Clear(drawRect); |
|
101 |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // CMyPlayerAppView::SizeChanged() |
|
106 // Called by framework when the view size is changed. |
|
107 // ----------------------------------------------------------------------------- |
|
108 // |
|
109 void CMyPlayerAppView::SizeChanged() |
|
110 { |
|
111 DrawNow(); |
|
112 } |
|
113 |
|
114 // ----------------------------------------------------------------------------- |
|
115 // CMyPlayerAppView::HandlePointerEventL() |
|
116 // Called by framework to handle pointer touch events. |
|
117 // Note: although this method is compatible with earlier SDKs, |
|
118 // it will not be called in SDKs without Touch support. |
|
119 // ----------------------------------------------------------------------------- |
|
120 // |
|
121 void CMyPlayerAppView::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
122 { |
|
123 |
|
124 // Call base class HandlePointerEventL() |
|
125 CCoeControl::HandlePointerEventL(aPointerEvent); |
|
126 } |
|
127 |
|
128 // End of File |