|
1 /* |
|
2 * Copyright (c) 2007 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: gsIndicatorPlugin plugin implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "GSindicatorpluginimplementation.h" |
|
22 |
|
23 |
|
24 #include <coemain.h> // CCoeEnv |
|
25 #include <coeaui.h> // CCoeAppUi |
|
26 #include <gsfwviewuids.h> |
|
27 #include <data_caging_path_literals.hrh> // KDC_RESOURCE_FILES_DIR |
|
28 #include <gslauncher.h> |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 |
|
33 // ======== MEMBER FUNCTIONS ======== |
|
34 |
|
35 // --------------------------------------------------------------------------- |
|
36 // CGSIndicatorPluginImplementation::CGSIndicatorPluginImplementation |
|
37 // C++ default constructor can NOT contain any code, that |
|
38 // might leave. |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 CGSIndicatorPluginImplementation::CGSIndicatorPluginImplementation() |
|
42 { |
|
43 } |
|
44 |
|
45 // --------------------------------------------------------------------------- |
|
46 // CGSIndicatorPluginImplementation::ConstructL |
|
47 // Symbian 2nd phase constructor can leave. |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 void CGSIndicatorPluginImplementation::ConstructL() |
|
51 { |
|
52 iTimer = CPeriodic::NewL(CActive::EPriorityStandard); |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // CGSIndicatorPluginImplementation::NewL |
|
57 // Two-phased constructor. |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 CGSIndicatorPluginImplementation* CGSIndicatorPluginImplementation::NewL() |
|
61 { |
|
62 CGSIndicatorPluginImplementation* self = |
|
63 new( ELeave ) CGSIndicatorPluginImplementation; |
|
64 CleanupStack::PushL( self ); |
|
65 self->ConstructL(); |
|
66 CleanupStack::Pop( self ); |
|
67 return self; |
|
68 } |
|
69 |
|
70 |
|
71 // Destructor |
|
72 CGSIndicatorPluginImplementation::~CGSIndicatorPluginImplementation() |
|
73 { |
|
74 if ( iTimer ) |
|
75 { |
|
76 iTimer->Cancel(); |
|
77 delete iTimer; |
|
78 } |
|
79 } |
|
80 |
|
81 |
|
82 // --------------------------------------------------------------------------- |
|
83 // CGSIndicatorPluginImplementation::HandleIndicatorTapL |
|
84 // --------------------------------------------------------------------------- |
|
85 // |
|
86 void CGSIndicatorPluginImplementation::HandleIndicatorTapL( const TInt /*aUid */) |
|
87 { |
|
88 if ( iTimer->IsActive() ) |
|
89 { |
|
90 iTimer->Cancel(); |
|
91 } |
|
92 iTimer->Start(10, 10, TCallBack(Tick, this)); |
|
93 // Launch connection view |
|
94 // CGSLauncher* l = CGSLauncher::NewLC(); |
|
95 // l->LaunchGSViewL ( KGSConPluginUid, TUid::Uid(0), KNullDesC8 ); |
|
96 // CleanupStack::PopAndDestroy(l); |
|
97 } |
|
98 |
|
99 TInt CGSIndicatorPluginImplementation::Tick(TAny* aObject) |
|
100 { |
|
101 return static_cast<CGSIndicatorPluginImplementation*>(aObject)->DoTick(); |
|
102 } |
|
103 |
|
104 TInt CGSIndicatorPluginImplementation::DoTick() |
|
105 { |
|
106 if ( iTimer ) |
|
107 { |
|
108 iTimer->Cancel(); |
|
109 } |
|
110 |
|
111 // Launch connection view |
|
112 CGSLauncher* l = CGSLauncher::NewLC(); |
|
113 TInt error = KErrNone; |
|
114 TRAP(error, l->LaunchGSViewL ( KGSConPluginUid, TUid::Uid(0), KNullDesC8 )); |
|
115 CleanupStack::PopAndDestroy(l); |
|
116 return error; |
|
117 } |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 // End of File |