|
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: The source file of the CClockNitzPlugin class. |
|
15 * |
|
16 */ |
|
17 |
|
18 // User includes |
|
19 #include "clocknitzplugin.h" |
|
20 #include "clocknitzpluginimpl.h" |
|
21 #include "clockpluginobserver.h" |
|
22 #include "clock_debug.h" |
|
23 |
|
24 // --------------------------------------------------------- |
|
25 // CClockNitzPlugin::NewL |
|
26 // rest of the details are commented in the header |
|
27 // --------------------------------------------------------- |
|
28 // |
|
29 CClockNitzPlugin* CClockNitzPlugin::NewL() |
|
30 { |
|
31 __PRINTS( "CClockNitzPlugin::NewL - Entry" ); |
|
32 |
|
33 CClockNitzPlugin* self = new ( ELeave ) CClockNitzPlugin; |
|
34 CleanupStack::PushL( self ); |
|
35 |
|
36 self->ConstructL(); |
|
37 |
|
38 CleanupStack::Pop(); |
|
39 |
|
40 __PRINTS( "CClockNitzPlugin::NewL - Exit" ); |
|
41 |
|
42 return self; |
|
43 } |
|
44 |
|
45 // --------------------------------------------------------- |
|
46 // CClockNitzPlugin::~CClockNitzPlugin |
|
47 // rest of the details are commented in the header |
|
48 // --------------------------------------------------------- |
|
49 // |
|
50 CClockNitzPlugin::~CClockNitzPlugin() |
|
51 { |
|
52 __PRINTS( "CClockNitzPlugin::~CClockNitzPlugin - Entry" ); |
|
53 |
|
54 if( iNitzPluginImpl ) |
|
55 { |
|
56 delete iNitzPluginImpl; |
|
57 iNitzPluginImpl = NULL; |
|
58 } |
|
59 |
|
60 __PRINTS( "CClockNitzPlugin::~CClockNitzPlugin - Exit" ); |
|
61 } |
|
62 |
|
63 // --------------------------------------------------------- |
|
64 // CClockNitzPlugin::ConstructL |
|
65 // rest of the details are commented in the header |
|
66 // --------------------------------------------------------- |
|
67 // |
|
68 void CClockNitzPlugin::ConstructL() |
|
69 { |
|
70 __PRINTS( "CClockNitzPlugin::ConstructL - Entry" ); |
|
71 |
|
72 if( !iNitzPluginImpl ) |
|
73 { |
|
74 iNitzPluginImpl = CClockNitzPluginImpl::NewL( this ); |
|
75 } |
|
76 |
|
77 __PRINTS( "CClockNitzPlugin::ConstructL - Exit" ); |
|
78 } |
|
79 |
|
80 // --------------------------------------------------------- |
|
81 // CClockNitzPlugin::GetTimeInformationL |
|
82 // rest of the details are commented in the header |
|
83 // --------------------------------------------------------- |
|
84 // |
|
85 void CClockNitzPlugin::GetTimeInformationL( TInterfaceAttribute aInterfaceAttribute, |
|
86 STimeAttributes* aTimeAttributes ) |
|
87 { |
|
88 __PRINTS( "CClockNitzPlugin::GetTimeInformationL - Entry" ); |
|
89 |
|
90 __PRINT( "TInterfaceAttribute: %d", aInterfaceAttribute ); |
|
91 |
|
92 if( iNitzPluginImpl ) |
|
93 { |
|
94 // Get the time information from the plugin implementation |
|
95 iNitzPluginImpl->GetTimeInformationL( aInterfaceAttribute, aTimeAttributes ); |
|
96 } |
|
97 |
|
98 __PRINTS( "CClockNitzPlugin::GetTimeInformationL - Exit" ); |
|
99 } |
|
100 |
|
101 |
|
102 // --------------------------------------------------------- |
|
103 // CClockNitzPlugin::NotifyOnTimeChange |
|
104 // rest of the details are commented in the header |
|
105 // --------------------------------------------------------- |
|
106 // |
|
107 void CClockNitzPlugin::NotifyOnTimeChange( TInterfaceAttribute aInterfaceAttribute ) |
|
108 { |
|
109 __PRINTS( "CClockNitzPlugin::NotifyOnTimeChange - Entry" ); |
|
110 |
|
111 __PRINT( "TInterfaceAttribute: %d", aInterfaceAttribute ); |
|
112 |
|
113 if( iNitzPluginImpl ) |
|
114 { |
|
115 // Subscribe with the NITZ listener for notifications |
|
116 iNitzPluginImpl->NotifyOnNITZInfoChange( aInterfaceAttribute ); |
|
117 } |
|
118 |
|
119 __PRINTS( "CClockNitzPlugin::NotifyOnTimeChange - Exit" ); |
|
120 } |
|
121 |
|
122 // --------------------------------------------------------- |
|
123 // CClockNitzPlugin::GetPluginUid |
|
124 // rest of the details are commented in the header |
|
125 // --------------------------------------------------------- |
|
126 // |
|
127 TInt CClockNitzPlugin::GetPluginUid() |
|
128 { |
|
129 __PRINTS( "CClockNitzPlugin::GetPluginUid - Entry" ); |
|
130 |
|
131 __PRINT( "Plugin id: %x", KNitzPluginId ); |
|
132 |
|
133 __PRINTS( "CClockNitzPlugin::GetPluginUid - Exit" ); |
|
134 |
|
135 return KNitzPluginId; |
|
136 } |
|
137 |
|
138 // --------------------------------------------------------- |
|
139 // CClockNitzPlugin::NotifyNITZInfoChangeL |
|
140 // rest of the details are commented in the header |
|
141 // --------------------------------------------------------- |
|
142 // |
|
143 void CClockNitzPlugin::NotifyNITZInfoChangeL() |
|
144 { |
|
145 __PRINTS( "CClockNitzPlugin::NotifyNITZInfoChangeL - Entry" ); |
|
146 |
|
147 if( iObserver ) |
|
148 { |
|
149 // Notify the observer that the time has been changed |
|
150 iObserver->NotifyTimeChangeL( *this ); |
|
151 } |
|
152 |
|
153 __PRINTS( "CClockNitzPlugin::NotifyNITZInfoChangeL - Exit" ); |
|
154 } |
|
155 |
|
156 // End of file |