|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Declares the CSimSysAgent class. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalAll |
|
21 */ |
|
22 |
|
23 #ifndef __CSIMPUBSUB_H__ |
|
24 #define __CSIMPUBSUB_H__ |
|
25 |
|
26 #if !defined(__E32BASE_H__) |
|
27 #include <e32base.h> |
|
28 #endif |
|
29 |
|
30 #include <e32property.h> |
|
31 |
|
32 //forward declarations |
|
33 class MPSSimObserver; |
|
34 |
|
35 /** |
|
36 class CSimPubSub |
|
37 |
|
38 Requests notification of changes to call status using Publish&Subscribe |
|
39 |
|
40 This class is a replica of CSimSysAgent but uses the Publish&Subscribe notification mechanism instead of SysAgent |
|
41 |
|
42 The class is a simple active object derived state machine. |
|
43 */ |
|
44 class CSimPubSub : public CActive |
|
45 { |
|
46 public: |
|
47 class TPubSubProperty |
|
48 /** |
|
49 Capture the uids required to subscribe to a property. |
|
50 */ |
|
51 { |
|
52 public: |
|
53 TPubSubProperty(); |
|
54 TPubSubProperty(TUid aCategory, TInt aKey, TInt aType); |
|
55 TBool operator==(const TPubSubProperty& aProperty) const; |
|
56 public: |
|
57 TUid iCategory; |
|
58 TInt iKey; |
|
59 TInt iType; |
|
60 }; |
|
61 |
|
62 public: |
|
63 static CSimPubSub* NewL(MPSSimObserver* aPSSimCallBack, const TPubSubProperty aProperty); |
|
64 ~CSimPubSub(); |
|
65 void Start(); |
|
66 |
|
67 protected: |
|
68 void RunL(); |
|
69 void DoCancel(); |
|
70 |
|
71 private: |
|
72 CSimPubSub(MPSSimObserver* aPSSimCallBack, const TPubSubProperty aProperty); |
|
73 void ConstructL(); |
|
74 |
|
75 |
|
76 private: |
|
77 const CSimPubSub::TPubSubProperty iProperty; |
|
78 MPSSimObserver* iPSSimCallBack; |
|
79 RProperty iSubscribe; |
|
80 }; |
|
81 |
|
82 class MPSSimObserver |
|
83 { |
|
84 public: |
|
85 // Callback when a call event has occurred. |
|
86 virtual void SimPSEvent(const CSimPubSub::TPubSubProperty aProperty, TInt aStatus)=0; |
|
87 }; |
|
88 |
|
89 #endif // !defined __CSIMPUBSUB_H__ |