|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CSENDASSENDER_H__ |
|
17 #define __CSENDASSENDER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <msvapi.h> |
|
21 |
|
22 #if (defined SYMBIAN_USER_PROMPT_SERVICE) |
|
23 #include <ups/upsclient.h> |
|
24 using namespace UserPromptService; |
|
25 #endif |
|
26 |
|
27 class MSendAsSenderObserver; |
|
28 class CBaseMtm; |
|
29 class CMsvOperation; |
|
30 class CMsvEntrySelection; |
|
31 |
|
32 /** |
|
33 Objects of this class are used to track the progress of a send operation. |
|
34 They are created and owned by CSendAsMessage sub-session objects. |
|
35 |
|
36 When a background send is requested, ownership is transferred to the sendas |
|
37 server. This allows the session to be closed before the background send |
|
38 operation has completed. |
|
39 |
|
40 @internalComponent |
|
41 @released |
|
42 */ |
|
43 class CSendAsSender : public CActive |
|
44 { |
|
45 public: |
|
46 static CSendAsSender* NewL(MSendAsSenderObserver& aObserver); |
|
47 virtual ~CSendAsSender(); |
|
48 // |
|
49 void SendMessage(); |
|
50 void SendMessage(const TSecurityInfo& aSecurityInfo, const TUid& aNotifierUid); |
|
51 |
|
52 #if (defined SYMBIAN_USER_PROMPT_SERVICE) |
|
53 void SendMessageL(const RMessage2 aMessage, TBool aHasCapability); |
|
54 #endif |
|
55 // |
|
56 void SetClientMtm(CBaseMtm& aClientMtm); |
|
57 void ProgressL(TMsvSendOperationProgress& aProgress); |
|
58 void FinalProgress(TMsvSendOperationProgress& aProgress); |
|
59 private: |
|
60 CSendAsSender(MSendAsSenderObserver& aObserver); |
|
61 void ConstructL(); |
|
62 // |
|
63 void SetEntrySelectionL(); |
|
64 // |
|
65 void InvokeMoveOperationL(); |
|
66 void InvokeSendOperationL(); |
|
67 void InvokeConfirmOperationL(); |
|
68 // |
|
69 void DeleteOperation(); |
|
70 void Complete(TInt aError); |
|
71 // methods from CActive |
|
72 virtual void RunL(); |
|
73 virtual void DoCancel(); |
|
74 virtual TInt RunError(TInt aError); |
|
75 |
|
76 private: |
|
77 enum TSendAsSenderState |
|
78 { |
|
79 ESenderIdle =0, |
|
80 ESenderStartingConfirmedSend, |
|
81 ESenderStartingUnconfirmedSend, |
|
82 ESenderConfirming, |
|
83 ESenderMoving, |
|
84 ESenderSending, |
|
85 ESenderDone, |
|
86 ESenderAuthoriseSend |
|
87 }; |
|
88 private: |
|
89 MSendAsSenderObserver* iObserver; |
|
90 TSendAsSenderState iState; |
|
91 // |
|
92 RNotifier iNotifier; |
|
93 TUid iNotifierUid; |
|
94 HBufC8* iBuffer; |
|
95 TPckgBuf<TInt> iNotifierResult; |
|
96 CBaseMtm* iClientMtm; |
|
97 CMsvOperation* iOperation; |
|
98 CMsvEntrySelection* iSelection; |
|
99 TMsvSendOperationProgress iFinalProgress; |
|
100 TSecurityInfo iSecurityInfo; |
|
101 TMsvEntry iEntry; |
|
102 |
|
103 /** For interaction with the UPS Server */ |
|
104 #if (defined SYMBIAN_USER_PROMPT_SERVICE) |
|
105 RUpsSession iUpsSession; |
|
106 RUpsSubsession iUpsSubsession; |
|
107 TUpsDecision iDecision; |
|
108 #endif |
|
109 }; |
|
110 |
|
111 #endif // __CSENDASSENDER_H__ |