1 /* |
|
2 * Copyright (c) 2005 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: CSysApProfileObserver implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "SysApProfileObserver.h" |
|
21 #include "SysApAppUi.h" |
|
22 |
|
23 // ========================== MEMBER FUNCTIONS ================================ |
|
24 |
|
25 // ---------------------------------------------------------------------------- |
|
26 // CSysApProfileObserver* CSysApProfileObserver::NewL() |
|
27 // ---------------------------------------------------------------------------- |
|
28 |
|
29 CSysApProfileObserver* CSysApProfileObserver::NewL( CSysApAppUi& aSysApAppUi ) |
|
30 { |
|
31 TRACES( RDebug::Print( _L("CSysApProfileObserver::NewL" ) ) ); |
|
32 CSysApProfileObserver* self = new ( ELeave ) CSysApProfileObserver( aSysApAppUi ); |
|
33 CleanupStack::PushL( self ); |
|
34 self->ConstructL(); |
|
35 CleanupStack::Pop(); //self |
|
36 return self; |
|
37 } |
|
38 |
|
39 // ---------------------------------------------------------------------------- |
|
40 // CSysApProfileObserver::CSysApProfileObserver( CSysApAppUi& aSysApAppUi ) |
|
41 // ---------------------------------------------------------------------------- |
|
42 |
|
43 CSysApProfileObserver::CSysApProfileObserver( CSysApAppUi& aSysApAppUi ) |
|
44 : iSysApAppUi( aSysApAppUi ) |
|
45 { |
|
46 TRACES( RDebug::Print( _L("CSysApProfileObserver::CSysApProfileObserver" ) ) ); |
|
47 } |
|
48 |
|
49 // ---------------------------------------------------------------------------- |
|
50 // CSysApProfileObserver::~CSysApProfileObserver() |
|
51 // ---------------------------------------------------------------------------- |
|
52 |
|
53 CSysApProfileObserver::~CSysApProfileObserver() |
|
54 { |
|
55 TRACES( RDebug::Print( _L("~CSysApProfileObserver") ) ); |
|
56 delete iHandler; |
|
57 } |
|
58 |
|
59 // ---------------------------------------------------------------------------- |
|
60 // CSysApProfileObserver::ConstructL() |
|
61 // ---------------------------------------------------------------------------- |
|
62 |
|
63 void CSysApProfileObserver::ConstructL() |
|
64 { |
|
65 TRACES( RDebug::Print( _L("CSysApProfileObserver::ConstructL()") ) ); |
|
66 iHandler = CProfileChangeNotifyHandler::NewL( this ); |
|
67 } |
|
68 |
|
69 // ---------------------------------------------------------------------------- |
|
70 // CSysApProfileObserver::HandleActiveProfileEventL() |
|
71 // ---------------------------------------------------------------------------- |
|
72 void CSysApProfileObserver::HandleActiveProfileEventL( TProfileEvent aProfileEvent, TInt aProfileId ) |
|
73 { |
|
74 TRACES( RDebug::Print( _L("CSysApProfileObserver::HandleActiveProfileEventL(): aProfileId=%d"), aProfileId ) ); |
|
75 if ( aProfileEvent == EProfileNewActiveProfile ) |
|
76 { |
|
77 iSysApAppUi.HandleProfileChangedL( aProfileId ); |
|
78 } |
|
79 else if ( aProfileEvent == EProfileActiveProfileModified ) |
|
80 { |
|
81 iSysApAppUi.CheckSilentModeL(); |
|
82 } |
|
83 } |
|
84 |
|
85 // End of File |
|
86 |
|