|
1 /* |
|
2 * Copyright (c) 2002-2010 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: Base class of sub service handlers. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CSCSERVICEHANDLERBASE_H |
|
20 #define C_CSCSERVICEHANDLERBASE_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <cchclientserver.h> |
|
24 |
|
25 #include "scpsipconnectionobserver.h" |
|
26 #include "scpdefs.h" |
|
27 #include "scpsipconnection.h" |
|
28 |
|
29 class CScpSubService; |
|
30 |
|
31 /** |
|
32 * Base class of sub service handlers. |
|
33 * |
|
34 * @lib sipconnectionprovider.dll |
|
35 */ |
|
36 class CScpServiceHandlerBase : public CBase, |
|
37 public MScpSipConnectionObserver |
|
38 |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Enables service. |
|
44 */ |
|
45 virtual void EnableSubServiceL() = 0; |
|
46 |
|
47 /** |
|
48 * Disables service. |
|
49 */ |
|
50 virtual TInt DisableSubService() = 0; |
|
51 |
|
52 /** |
|
53 * Returns type of sub service (VoIP, Vmbx, Presence). |
|
54 * @return Type of the sub service. |
|
55 */ |
|
56 virtual TCCHSubserviceType SubServiceType() const = 0; |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 virtual ~CScpServiceHandlerBase(); |
|
62 |
|
63 protected: |
|
64 |
|
65 /** |
|
66 * C++ default constructor. |
|
67 */ |
|
68 CScpServiceHandlerBase( CScpSubService& aSubService ); |
|
69 |
|
70 /** |
|
71 * Base construction |
|
72 */ |
|
73 void BaseConstructL(); |
|
74 |
|
75 /** |
|
76 * Registers the sub service's profile |
|
77 * @param aSubService Registered sub service |
|
78 * @return State of the registration |
|
79 */ |
|
80 void RegisterProfileL(); |
|
81 |
|
82 /** |
|
83 * Deregisters the sub service's profile |
|
84 * @param aSubService Deregistered sub service |
|
85 */ |
|
86 void DeregisterProfile(); |
|
87 |
|
88 /** |
|
89 * Instantly force disables sip profile |
|
90 */ |
|
91 void PerformInstantForceSipProfileDisable(); |
|
92 |
|
93 /** |
|
94 * Starts force disable timer |
|
95 * @param aFunction The function to call after the time out |
|
96 */ |
|
97 void StartForcedDisableTimer( TInt (*aFunction)(TAny* aPtr) ); |
|
98 |
|
99 /** |
|
100 * Cancels the disable timer |
|
101 */ |
|
102 void CancelDisableTimer(); |
|
103 |
|
104 private: |
|
105 |
|
106 /** |
|
107 * Handle sip connection event |
|
108 * @param aProfileId Sip profile id |
|
109 * @param aSipEvent Sip event |
|
110 */ |
|
111 virtual void HandleSipConnectionEvent( const TUint32 aProfileId, |
|
112 TScpConnectionEvent aSipEvent ) = 0; |
|
113 |
|
114 /** |
|
115 * From base class MScpSipConnectionObserver |
|
116 * Query is starting to ALR allowed. |
|
117 * Client can start ALR later if needed to do something first |
|
118 * |
|
119 * @return ETrue if allowed. |
|
120 */ |
|
121 virtual TBool IsSipProfileAllowedToStartAlr(); |
|
122 |
|
123 /** |
|
124 * Forced sip profile disable call back |
|
125 * @param aSelf this object |
|
126 */ |
|
127 static TInt ForceSipProfileDisable( TAny* aSelf ); |
|
128 |
|
129 /** |
|
130 * Handles sip profile forced disable timeout |
|
131 * Sends Deregistered event for the subservice |
|
132 * @param aForceDisableSipProfile ETrue when wanted to really |
|
133 * force disable actual sip profile (not just generate event). |
|
134 */ |
|
135 void HandleSipProfileForcedDisable( TBool aForceDisableSipProfile ); |
|
136 |
|
137 protected: |
|
138 |
|
139 /** |
|
140 * Sub service |
|
141 */ |
|
142 CScpSubService& iSubService; |
|
143 |
|
144 private: |
|
145 |
|
146 /** |
|
147 * Disable timer. Owned. |
|
148 */ |
|
149 CPeriodic* iDisableTimer; |
|
150 |
|
151 #ifdef _DEBUG |
|
152 friend class T_CScpServiceManager; |
|
153 friend class T_CScpVmbxHandler; |
|
154 #endif |
|
155 }; |
|
156 |
|
157 #endif // C_CSCSERVICEHANDLERBASE_H |
|
158 |
|
159 // End of File |