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