|
1 /* |
|
2 * Copyright (c) 2005-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 "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: Provide interface for the client requestin availability class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "musavaavailabilitystub.h" |
|
20 #include "musunittesting.h" |
|
21 #include "musavasettingsimp.h" |
|
22 #include "musavaobserver.h" |
|
23 #include "musavaavailability.h" |
|
24 #include "muslogger.h" |
|
25 |
|
26 #include <e32base.h> |
|
27 |
|
28 // ------------------------------------------------------------------------- |
|
29 // Two-phased constructor. |
|
30 // ------------------------------------------------------------------------- |
|
31 // |
|
32 CMusAvaAvailabilityStub* CMusAvaAvailabilityStub::NewL( |
|
33 MMusAvaAvailabilityObserver& aObserver, |
|
34 CMusAvaSettingsImp& aSettings ) |
|
35 { |
|
36 CMusAvaAvailabilityStub* self = |
|
37 CMusAvaAvailabilityStub::NewLC( |
|
38 aObserver, |
|
39 aSettings ); |
|
40 CleanupStack::Pop( self ); |
|
41 return self; |
|
42 } |
|
43 |
|
44 // ------------------------------------------------------------------------- |
|
45 // Two-phased constructor. |
|
46 // ------------------------------------------------------------------------- |
|
47 // |
|
48 CMusAvaAvailabilityStub* CMusAvaAvailabilityStub::NewLC( |
|
49 MMusAvaAvailabilityObserver& aObserver, |
|
50 CMusAvaSettingsImp& aSettings ) |
|
51 { |
|
52 CMusAvaAvailabilityStub* self = |
|
53 new( ELeave ) CMusAvaAvailabilityStub( |
|
54 aObserver, |
|
55 aSettings ); |
|
56 CleanupStack::PushL( self ); |
|
57 self->ConstructL(); |
|
58 return self; |
|
59 } |
|
60 |
|
61 // ------------------------------------------------------------------------- |
|
62 // Destructor. |
|
63 // ------------------------------------------------------------------------- |
|
64 // |
|
65 CMusAvaAvailabilityStub::~CMusAvaAvailabilityStub() |
|
66 { |
|
67 |
|
68 } |
|
69 |
|
70 // ------------------------------------------------------------------------- |
|
71 // Starts the loopy execution. |
|
72 // ------------------------------------------------------------------------- |
|
73 // |
|
74 void CMusAvaAvailabilityStub::DoExecuteL() |
|
75 { |
|
76 if ( iExecuteLeave != 0 ) |
|
77 { |
|
78 User::Leave( iExecuteLeave ); |
|
79 } |
|
80 else if ( iExecuteError) |
|
81 { |
|
82 iObserver.AvailabilityChanged( |
|
83 (MMusAvaObserver::TAvailabilityName)iNameStub, |
|
84 (MMusAvaObserver::TAvailabilityStatus)iStatusStub ); |
|
85 } |
|
86 else |
|
87 { |
|
88 iObserver.AvailabilityError( |
|
89 (MMusAvaObserver::TAvailabilityName)iNameStub, |
|
90 (MMusAvaObserver::TAvailabilityStatus)iStatusStub ); |
|
91 } |
|
92 } |
|
93 |
|
94 |
|
95 // ------------------------------------------------------------------------- |
|
96 // |
|
97 // ------------------------------------------------------------------------- |
|
98 // |
|
99 MMusAvaObserver::TAvailabilityName CMusAvaAvailabilityStub::Name() |
|
100 { |
|
101 return iNameStub; |
|
102 } |
|
103 |
|
104 // ------------------------------------------------------------------------- |
|
105 // Constructor function. |
|
106 // ------------------------------------------------------------------------- |
|
107 // |
|
108 CMusAvaAvailabilityStub::CMusAvaAvailabilityStub( |
|
109 MMusAvaAvailabilityObserver& aObserver, |
|
110 CMusAvaSettingsImp& aSettings) |
|
111 :CMusAvaAvailability( aObserver ), |
|
112 iSettings( aSettings ) |
|
113 { |
|
114 } |
|
115 |
|
116 |
|
117 // ------------------------------------------------------------------------- |
|
118 // Second phase constructor. |
|
119 // ------------------------------------------------------------------------- |
|
120 // |
|
121 void CMusAvaAvailabilityStub::ConstructL() |
|
122 { |
|
123 |
|
124 } |
|
125 |