|
1 /* |
|
2 * Copyright (c) 2002-2004 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: Implementation of CProEngPubSubObserverBase. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "CProEngPubSubObserverBase.h" |
|
22 #include "ProfileEnginePrivatePSKeys.h" |
|
23 |
|
24 // ============================ MEMBER FUNCTIONS =============================== |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // CProEngPubSubObserverBase::CProEngPubSubObserverBase |
|
28 // ----------------------------------------------------------------------------- |
|
29 // |
|
30 CProEngPubSubObserverBase::CProEngPubSubObserverBase( TUint32 aPubSubKey ) |
|
31 : CProEngObserverBase( aPubSubKey ) |
|
32 { |
|
33 iAttatched = EFalse; |
|
34 } |
|
35 |
|
36 // Destructor |
|
37 CProEngPubSubObserverBase::~CProEngPubSubObserverBase() |
|
38 { |
|
39 Cancel(); |
|
40 iProperty.Close(); |
|
41 } |
|
42 |
|
43 // ----------------------------------------------------------------------------- |
|
44 // CProEngPubSubObserverBase::RequestNotification |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 TInt CProEngPubSubObserverBase::RequestNotification() |
|
48 { |
|
49 TInt err = KErrNone; |
|
50 |
|
51 if ( !iAttatched ) |
|
52 { |
|
53 err = iProperty.Attach( KPSUidProfileEngine, iKey ); |
|
54 if ( err == KErrNone ) |
|
55 { |
|
56 iAttatched = ETrue; |
|
57 } |
|
58 } |
|
59 |
|
60 if( err == KErrNone ) |
|
61 { |
|
62 iProperty.Subscribe( iStatus ); |
|
63 SetActive(); |
|
64 } |
|
65 |
|
66 return err; |
|
67 } |
|
68 |
|
69 // ----------------------------------------------------------------------------- |
|
70 // CProEngPubSubObserverBase::DoCancel |
|
71 // ----------------------------------------------------------------------------- |
|
72 // |
|
73 void CProEngPubSubObserverBase::DoCancel() |
|
74 { |
|
75 iProperty.Cancel(); |
|
76 } |
|
77 |
|
78 // End of File |
|
79 |