|
1 /* |
|
2 * Copyright (c) 2007-2009 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: |
|
15 * Name : sipprflregistrationinprogressstate.h |
|
16 * Part of : sip profile fsm |
|
17 * Version : %version: 2.1.1 % |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 #ifndef CSIPPRFLREGISTRATIONINPROGRESSSTATE_H |
|
29 #define CSIPPRFLREGISTRATIONINPROGRESSSTATE_H |
|
30 |
|
31 // INCLUDES |
|
32 #include "sipprflstatebase.h" |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CSIPConcreteProfile; |
|
36 |
|
37 // CLASS DECLARATION |
|
38 /** |
|
39 * Reacts to events that are possible in "Registration in Progress" state. |
|
40 * Profile is in this state when |
|
41 * the REGISTER has been sent to the remote SIP server. |
|
42 */ |
|
43 class CSIPPrflRegistrationInProgressState: public CSIPPrflStateBase |
|
44 { |
|
45 public:// Constructors and destructor |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * @param aUser user for the state machine |
|
49 */ |
|
50 IMPORT_C static CSIPPrflRegistrationInProgressState* NewL( |
|
51 MSIPProfileFSMUser& aUser); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 IMPORT_C ~CSIPPrflRegistrationInProgressState(); |
|
57 |
|
58 public://new functions |
|
59 |
|
60 CSIPConcreteProfile::TStatus ConcreteProfileState() const; |
|
61 |
|
62 /** |
|
63 * Links states |
|
64 * @param aRegister Requested "Register Requested" state |
|
65 * @param aInitState "Init" state |
|
66 * @param aRegisteredState "Registered" state |
|
67 */ |
|
68 IMPORT_C void LinkStates( |
|
69 CSIPPrflStateBase& aRegisterRequested, |
|
70 CSIPPrflStateBase& aInitState, |
|
71 CSIPPrflStateBase& aRegisteredState, |
|
72 CSIPPrflStateBase& aRegisterDelayRequestedState); |
|
73 |
|
74 /** |
|
75 * A SIP response creating a registration binding or an error response |
|
76 * that is related to an refreshed registration binding |
|
77 * has been received from the network. |
|
78 * In case of suspended connection and error response the profile is moved |
|
79 * to "Register Requested" state. |
|
80 * In case of active connection and >=300 response the profile is moved |
|
81 * to "Init" state. |
|
82 * In case of active connection and 2xx response the profile is moved |
|
83 * to "Registered" state. |
|
84 * @param aTransaction contains response elements. |
|
85 */ |
|
86 void ResponseReceived( |
|
87 MSIPProfileContext& aContext, |
|
88 CSIPClientTransaction& aTransaction); |
|
89 |
|
90 /** |
|
91 * An asynchronous error has occurred in the stack related |
|
92 * to the request indicated by the given transaction. |
|
93 * The profile is moved to "Init" state. |
|
94 * @param aContext a profile context |
|
95 * @param aError error code |
|
96 */ |
|
97 void ErrorOccured( |
|
98 MSIPProfileContext& aContext, |
|
99 TInt aError); |
|
100 |
|
101 /** |
|
102 * Connection state has changed. |
|
103 * In case of inactive connection the profile is moved to "Register |
|
104 * Requested" state Or |
|
105 * In case of UnAvailable connection report error to client and move profile to "Init" state |
|
106 * @param aContext a profile context |
|
107 * @param aState indicates the current connection state |
|
108 */ |
|
109 void ConnectionStateChanged( |
|
110 MSIPProfileContext& aContext, |
|
111 CSIPConnection::TState aState); |
|
112 |
|
113 /** |
|
114 * In this state register is always pending. |
|
115 * @returns ETrue |
|
116 */ |
|
117 TBool IsRegisterPending() const; |
|
118 |
|
119 private: |
|
120 /** |
|
121 * Constructor. |
|
122 */ |
|
123 CSIPPrflRegistrationInProgressState(MSIPProfileFSMUser& aUser); |
|
124 |
|
125 private: // Data |
|
126 |
|
127 CSIPPrflStateBase* iRegisterRequestedState; |
|
128 CSIPPrflStateBase* iInitState; |
|
129 CSIPPrflStateBase* iRegisteredState; |
|
130 CSIPPrflStateBase* iRegisterDelayRequestedState; |
|
131 }; |
|
132 |
|
133 #endif // CSIPPRFLREGISTRATIONINPROGRESSSTATE_H |