|
1 /* |
|
2 * Copyright (c) 2002-2007 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 * Starts force disable timer |
|
90 * @param aFunction The function to call after the time out |
|
91 */ |
|
92 void StartForcedDisableTimer( TInt (*aFunction)(TAny* aPtr) ); |
|
93 |
|
94 /** |
|
95 * Cancels the disable timer |
|
96 */ |
|
97 void CancelDisableTimer(); |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * Handle sip connection event |
|
103 * @param aProfileId Sip profile id |
|
104 * @param aSipEvent Sip event |
|
105 */ |
|
106 virtual void HandleSipConnectionEvent( const TUint32 aProfileId, |
|
107 TScpConnectionEvent aSipEvent ) = 0; |
|
108 |
|
109 /** |
|
110 * Forced sip profile disable call back |
|
111 * @param aSelf this object |
|
112 */ |
|
113 static TInt ForceSipProfileDisable( TAny* aSelf ); |
|
114 |
|
115 /** |
|
116 * Handles sip profile forced disable timeout |
|
117 * Sends Deregistered event for the subservice |
|
118 */ |
|
119 void HandleSipProfileForcedDisable(); |
|
120 |
|
121 protected: |
|
122 |
|
123 /** |
|
124 * Sub service |
|
125 */ |
|
126 CScpSubService& iSubService; |
|
127 |
|
128 private: |
|
129 |
|
130 /** |
|
131 * Disable timer. Owned. |
|
132 */ |
|
133 CPeriodic* iDisableTimer; |
|
134 |
|
135 #ifdef _DEBUG |
|
136 friend class T_CScpServiceManager; |
|
137 friend class T_CScpVmbxHandler; |
|
138 #endif |
|
139 }; |
|
140 |
|
141 #endif // C_CSCSERVICEHANDLERBASE_H |
|
142 |
|
143 // End of File |