31 * |
30 * |
32 * @lib peservicehandling.lib |
31 * @lib peservicehandling.lib |
33 * @since S60 v5.0 |
32 * @since S60 v5.0 |
34 */ |
33 */ |
35 NONSHARABLE_CLASS( CPEServiceHandling ): public CBase, |
34 NONSHARABLE_CLASS( CPEServiceHandling ): public CBase, |
36 public MCchServiceStatusObserver, |
|
37 public MPEServiceHandling |
35 public MPEServiceHandling |
38 { |
36 { |
39 |
37 |
40 public: // Constructors and destructor |
38 public: // Constructors and destructor |
41 |
39 |
42 /** |
40 /** |
43 * Two-phased constructor. |
41 * Two-phased constructor. |
44 */ |
42 */ |
45 IMPORT_C static CPEServiceHandling* NewL( MPEPhoneModelInternal& aModel ); |
43 IMPORT_C static CPEServiceHandling* NewL( MPEPhoneModelInternal& aModel ); |
46 |
44 |
47 /** |
45 /** |
48 * Two-phased constructor. |
46 * Two-phased constructor. |
49 */ |
47 */ |
50 IMPORT_C static CPEServiceHandling* NewLC( MPEPhoneModelInternal& aModel ); |
48 IMPORT_C static CPEServiceHandling* NewLC( MPEPhoneModelInternal& aModel ); |
51 |
49 |
52 /** |
50 /** |
53 * Destructors. |
51 * Destructors. |
54 */ |
52 */ |
55 IMPORT_C virtual ~CPEServiceHandling(); |
53 IMPORT_C virtual ~CPEServiceHandling(); |
56 |
54 |
57 public: // from MPEServiceHandling |
55 public: // from MPEServiceHandling |
58 |
56 |
59 /** |
57 /** |
60 * From MPEServiceHandling. |
58 * From MPEServiceHandling. |
61 * Enables service defined by the given identifier. |
59 * Enables service defined by the given identifier. |
62 * This function does the service enabling and service status error checking. |
60 * This function does the service enabling and service status error checking. |
63 * If service is enabled successfully, send message |
61 * If service is enabled successfully, send message |
64 * (EPEMessageServiceEnabled) to PhoneEngine. |
62 * (EPEMessageServiceEnabled) to PhoneEngine. |
65 * |
63 * |
66 * @since S60 5.0 |
64 * @since S60 5.0 |
67 * @param aServiceId Identifier of the service. |
65 * @param aServiceId Identifier of the service. |
68 */ |
66 */ |
69 void EnableServiceL( TInt aServiceId ); |
67 void EnableServiceL( TInt aServiceId ); |
70 |
68 |
71 /** |
69 /** |
72 * From MPEServiceHandling. |
70 * From MPEServiceHandling. |
73 * Cancel current service. |
71 * Cancel current service. |
74 */ |
72 */ |
75 void CancelServiceEnabling() const; |
73 void CancelServiceEnabling() const; |
76 |
74 |
77 /** |
75 /** |
78 * From MPEServiceHandling. |
76 * From MPEServiceHandling. |
79 * Disable service. |
77 * Disable service. |
80 */ |
78 */ |
81 void DisableService() const; |
79 void DisableService() const; |
82 |
80 |
83 public: // from MCchServiceStatusObserver |
81 private: // Constructors |
84 |
|
85 /** |
|
86 * From MCchServiceStatusObserver. |
|
87 * Signaled when service status or error changes. |
|
88 * |
|
89 * @param aServiceId Identifier of the service. |
|
90 * @param aType Service type. |
|
91 * @param aServiceStatus Service status. |
|
92 */ |
|
93 void ServiceStatusChanged( TInt aServiceId, |
|
94 const TCCHSubserviceType aType, |
|
95 const TCchServiceStatus& aServiceStatus ); |
|
96 private: // Constructors |
|
97 |
82 |
98 /** |
83 /** |
99 * C++ default constructor. |
84 * C++ default constructor. |
100 */ |
85 */ |
101 CPEServiceHandling( MPEPhoneModelInternal& aModel ); |
86 CPEServiceHandling( MPEPhoneModelInternal& aModel ); |
102 |
87 |
103 /** |
88 /** |
104 * By default Symbian 2nd phase constructor is private. |
89 * By default Symbian 2nd phase constructor is private. |
105 */ |
90 */ |
106 void ConstructL(); |
91 void ConstructL(); |
107 |
92 |
108 private: // functions |
93 private: // data |
109 |
94 |
110 /** |
95 /** |
111 * Enable service, if not already enabled. |
96 * PhoneModel. |
112 * |
97 * Not own. |
113 * @param aState Service state. |
|
114 * @param aService Service. |
|
115 * @return Error code. |
|
116 */ |
98 */ |
117 TInt EnableServiceIfNeeded( const TCCHSubserviceState& aState, |
99 MPEPhoneModelInternal& iModel; |
118 CCchService& aService ); |
100 |
119 /** |
101 /** |
120 * Sends ServiceHandlingError message to PhoneEngine and saves |
102 * Current service identifier. |
121 * errorcode to member variable. |
103 */ |
122 * |
104 TInt iCurrentServiceId; |
123 * @param aErrorCode, Cch errorcode. |
|
124 */ |
|
125 void SendErrorMessage( TInt aErrorCode ); |
|
126 |
|
127 private: // data |
|
128 |
|
129 /** |
|
130 * CCH client. |
|
131 * Own. |
|
132 */ |
|
133 CCch* iCchClient; |
|
134 |
|
135 /** |
|
136 * PhoneModel. |
|
137 * Not own. |
|
138 */ |
|
139 MPEPhoneModelInternal& iModel; |
|
140 |
|
141 /** |
|
142 * Current service identifier. |
|
143 */ |
|
144 TInt iCurrentServiceId; |
|
145 }; |
105 }; |
146 |
106 |
147 #endif // C_PESERVICEHANDLING_H |
107 #endif // C_PESERVICEHANDLING_H |