|
1 /* |
|
2 * Copyright (c) 2006-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 : StopUserAgent.h |
|
16 * Part of : TransactionUser |
|
17 * Version : SIP/6.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 #ifndef STOPUSERAGENT_H |
|
29 #define STOPUSERAGENT_H |
|
30 |
|
31 // INCLUDES |
|
32 #include <e32base.h> |
|
33 |
|
34 #include "SipStackServerDefs.h" |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class CTransactionStore; |
|
38 |
|
39 |
|
40 // CLASS DECLARATION |
|
41 /** |
|
42 * This class is used for stopping a UA, in case a leave occurs. |
|
43 */ |
|
44 class TStopUserAgent |
|
45 { |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Constructor |
|
50 * @param aTransactionId TransactionId of the UA |
|
51 * @param aStore TransactionStore |
|
52 * @param aReason Reason for stopping |
|
53 */ |
|
54 TStopUserAgent(TTransactionId aTransactionId, |
|
55 CTransactionStore& aStore, |
|
56 TInt aReason); |
|
57 |
|
58 /** |
|
59 * Returns a TCleanupItem which can be pushed into CleanupStack. If leave |
|
60 * occurs, cleanup operation is invoked. |
|
61 * @return TCleanupItem |
|
62 */ |
|
63 TCleanupItem CleanupItem(); |
|
64 |
|
65 /** |
|
66 * When CleanupStack destroys the TCleanupItem, this function is called. |
|
67 * If the UA exists, it is stopped. |
|
68 * |
|
69 * @pre aStopUserAgent != NULL |
|
70 * @param aStopUserAgent Pointer to a TStopUserAgent containing the |
|
71 * information required by the cleanup operation. Ownership is not |
|
72 * transferred. |
|
73 */ |
|
74 static void StopIfFound(TAny* aStopUserAgent); |
|
75 |
|
76 private: // Data |
|
77 |
|
78 // TransactionId used for searching the UA |
|
79 TTransactionId iTransactionId; |
|
80 |
|
81 // UA is searched from this store |
|
82 CTransactionStore& iStore; |
|
83 |
|
84 // Reason for the stop |
|
85 TInt iReason; |
|
86 }; |
|
87 |
|
88 #endif // end of STOPUSERAGENT_H |
|
89 |
|
90 // End of File |