|
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 |
|
21 #ifndef CMCEOUTREFER_H |
|
22 #define CMCEOUTREFER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <mceoutevent.h> |
|
26 #include <mcerefer.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CSIPProfile; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Class for mobile originated MCE refers. |
|
35 * |
|
36 * CMceOutRefer represents outgoing request to remote terminal to perform an action. |
|
37 * This request may or may not also implicitically generate an event. This is |
|
38 * indicated by type while instantiating the class. If event is generated, instance |
|
39 * of CMceOutEvent is returned in ReferL function call. This will lead to notifications |
|
40 * send by remote terminal received through MMceEventObserver::NotifyReceived() function. |
|
41 * |
|
42 * The refer is finally terminated by the remote endpoint. |
|
43 * |
|
44 * If for any reason instance of this class is deleted while in active state, |
|
45 * refer is automatically terminated by MCE server. |
|
46 * |
|
47 * @lib mceclient.lib |
|
48 */ |
|
49 class CMceOutRefer: public CMceRefer |
|
50 { |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 * @param aManager, reference to event manager |
|
56 * @param aProfile, reference to used SIP profile |
|
57 * @param aRecipient, recipient of the refer. |
|
58 * @param aReferTo, value placed into refer-to header. |
|
59 * @param aType, type of the refer. |
|
60 * @param aOriginator, originator of the refer. |
|
61 */ |
|
62 IMPORT_C static CMceOutRefer* NewL( |
|
63 CMceManager& aManager, |
|
64 CSIPProfile& aProfile, |
|
65 const TDesC8& aRecipient, |
|
66 const TDesC8& aReferTo, |
|
67 TType aType = ENoSuppression, |
|
68 HBufC8* aOriginator = 0 ); |
|
69 |
|
70 /** |
|
71 * Two-phased constructor. Should be used when refer is associated |
|
72 * to existing event. This guarantees that refer is sent |
|
73 * to same remote terminal with the event. |
|
74 * @param aEvent, reference to bound event. |
|
75 * @param aReferTo, value placed into refer-to header. |
|
76 * @param aType, type of the refer. |
|
77 */ |
|
78 IMPORT_C static CMceOutRefer* NewL( |
|
79 CMceEvent& aEvent, |
|
80 const TDesC8& aReferTo, |
|
81 TType aType = ENoSuppression ); |
|
82 |
|
83 /** |
|
84 * Two-phased constructor. Should be used when refer is associated |
|
85 * to existing session. This guarantees that refer is sent |
|
86 * to same remote terminal with the session. |
|
87 * @param aSession, reference to bound session |
|
88 * @param aReferTo, value placed into refer-to header. |
|
89 * @param aType, type of the refer. |
|
90 */ |
|
91 IMPORT_C static CMceOutRefer* NewL( |
|
92 CMceSession& aSession, |
|
93 const TDesC8& aReferTo, |
|
94 TType aType = ENoSuppression ); |
|
95 |
|
96 /** |
|
97 * Two-phased constructor. Should be used when refer is associated |
|
98 * to existing refer. This guarantees that refers are sent |
|
99 * to same remote terminal. |
|
100 * @param aRefer, reference to bound refer |
|
101 * @param aReferTo, value placed into refer-to header. |
|
102 * @param aType, type of the refer. |
|
103 */ |
|
104 IMPORT_C static CMceOutRefer* NewL( |
|
105 CMceRefer& aRefer, |
|
106 const TDesC8& aReferTo, |
|
107 TType aType = ENoSuppression ); |
|
108 |
|
109 /** |
|
110 * Destructor. |
|
111 */ |
|
112 IMPORT_C ~CMceOutRefer(); |
|
113 |
|
114 |
|
115 public: // New functions |
|
116 |
|
117 /** |
|
118 * Refers to ongoing session. |
|
119 * @pre State() == CMceRefer::EIdle |
|
120 * @post State() == CMCRefer::EPending |
|
121 * @param aHeaders, SIP headers to be added. Ownership is |
|
122 * transferred. |
|
123 * @param aContentType, content type of the body. Ownership is |
|
124 * transferred. |
|
125 * @param aContent, content to be added in a body. Ownership is transferred. |
|
126 */ |
|
127 IMPORT_C CMceOutEvent* ReferL( |
|
128 CDesC8Array* aHeaders = 0, |
|
129 HBufC8* aContentType = 0, |
|
130 HBufC8* aContent = 0 ); |
|
131 |
|
132 public: // Functions from base class |
|
133 |
|
134 /** |
|
135 * Returns truth value, is the refer in-refer or not. |
|
136 * @return TBool, EFalse. |
|
137 */ |
|
138 TBool IsInRefer() const; |
|
139 |
|
140 private: |
|
141 |
|
142 /** |
|
143 * C++ default constructor. |
|
144 * @param aManager, reference to event manager. |
|
145 * @param aProfileId, id of the sip profile used for the event, |
|
146 * @param aDialogId, the ID of the dialog this REFER |
|
147 * is created into |
|
148 * @param aType |
|
149 */ |
|
150 CMceOutRefer( CMceManager& aManager, |
|
151 TUint32 aProfileId, |
|
152 TUint32 aDialogId, |
|
153 TType aType ); |
|
154 |
|
155 /** |
|
156 * second-phase constructor |
|
157 */ |
|
158 void ConstructL(const TDesC8& aRecipient, |
|
159 const TDesC8& aReferTo, |
|
160 TType aType, |
|
161 HBufC8* aOriginator ); |
|
162 /** |
|
163 * second-phase constructor |
|
164 */ |
|
165 void ConstructL(const TDesC8& aRecipient, |
|
166 const TDesC8& aReferTo, |
|
167 TType aType, |
|
168 const TDesC8& aOriginator ); |
|
169 |
|
170 }; |
|
171 |
|
172 #endif |