|
1 /* |
|
2 * Copyright (c) 2005 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMCENATSTATE_H |
|
21 #define CMCENATSTATE_H |
|
22 |
|
23 #include <e32base.h> |
|
24 |
|
25 class TMceNatStateTransitionEvent; |
|
26 |
|
27 //state indexes |
|
28 typedef TUint TMceNatStateIndex; |
|
29 |
|
30 const TMceNatStateIndex KMceNatStateInitializing = 0; |
|
31 const TMceNatStateIndex KMceNatStateIdle = 1; |
|
32 const TMceNatStateIndex KMceNatStateCreateOffer = 2; |
|
33 const TMceNatStateIndex KMceNatStateCreateAnswer = 3; |
|
34 const TMceNatStateIndex KMceNatStateDecodeOffer = 4; |
|
35 const TMceNatStateIndex KMceNatStateDecodeAnswer = 5; |
|
36 const TMceNatStateIndex KMceNatStateWait = 6; |
|
37 const TMceNatStateIndex KMceNatStateConnected = 7; |
|
38 const TMceNatStateIndex KMceNatStateCreateOfferRequested = 8; |
|
39 |
|
40 /** |
|
41 * MCE SIP state transition handler |
|
42 * |
|
43 * @lib |
|
44 * @since |
|
45 */ |
|
46 class MMceNatStateTransitionHandler |
|
47 { |
|
48 |
|
49 public: |
|
50 |
|
51 /** |
|
52 * Hanldes state transition message and executes |
|
53 * necessary actions |
|
54 * @param aEvent atransition event |
|
55 */ |
|
56 virtual void EntryL( TMceNatStateTransitionEvent& aEvent ) = 0; |
|
57 |
|
58 /** |
|
59 * Resolves state to which current state exit |
|
60 * @param aEvent atransition event |
|
61 */ |
|
62 virtual void ExitL( TMceNatStateTransitionEvent& aEvent ) = 0; |
|
63 |
|
64 }; |
|
65 |
|
66 /** |
|
67 * MCE SIP state machine |
|
68 * |
|
69 * @lib |
|
70 * @since |
|
71 */ |
|
72 class CMceNatState : public CBase |
|
73 { |
|
74 |
|
75 public: // Constructors and destructor |
|
76 |
|
77 /** |
|
78 * Destructor. |
|
79 */ |
|
80 virtual ~CMceNatState(); |
|
81 |
|
82 |
|
83 public: // New functions |
|
84 |
|
85 /** |
|
86 * Checks if state accepts event |
|
87 * @param aEvent atransition event |
|
88 */ |
|
89 virtual TBool Accept( TMceNatStateTransitionEvent& aEvent ) = 0; |
|
90 |
|
91 /** |
|
92 * Returns transition handler |
|
93 * @return transition handler |
|
94 */ |
|
95 virtual MMceNatStateTransitionHandler& TransitionHandler() = 0; |
|
96 |
|
97 |
|
98 protected: // Constructors and destructor |
|
99 |
|
100 /** |
|
101 * Constructor |
|
102 */ |
|
103 CMceNatState(); |
|
104 |
|
105 }; |
|
106 |
|
107 #endif // CMCENATSTATE_H |
|
108 |
|
109 // End of File |