|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Class that handles saving operations |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #ifndef __AUDIOMESSAGESAVEOPERATION_H |
|
23 #define __AUDIOMESSAGESAVEOPERATION_H |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <e32std.h> |
|
27 #include <mmsmsventry.h> |
|
28 |
|
29 #include "audiomessageoperation.h" |
|
30 #include "audiomessagedocument.h" |
|
31 |
|
32 |
|
33 /** |
|
34 * class for saving |
|
35 * |
|
36 * @lib audiomessage.exe |
|
37 * @since S60 v3.1 |
|
38 */ |
|
39 class CAudioMessageSaveOperation : public CAudioMessageOperation |
|
40 { |
|
41 protected: |
|
42 enum TAmsSaveState |
|
43 { |
|
44 EAmsSaveCheck, |
|
45 EAmsSaveFinalize, |
|
46 EAmsSaveEnd |
|
47 }; |
|
48 |
|
49 public: // New methods |
|
50 |
|
51 /** |
|
52 * Factory method that creates this object. |
|
53 * |
|
54 * @param aAddressCtrl |
|
55 * @param aObserver for appui use |
|
56 * @param aDocument |
|
57 * @param aView |
|
58 * @return Pointer to instance in cleanup stack |
|
59 */ |
|
60 static CAudioMessageSaveOperation* NewL( |
|
61 CMsgAddressControl& aAddressCtrl, |
|
62 MAmsOperationObserver& aObserver, |
|
63 CAudioMessageDocument& aDocument, |
|
64 CMsgEditorView& aView ); |
|
65 |
|
66 /** |
|
67 * Destructor |
|
68 */ |
|
69 virtual ~CAudioMessageSaveOperation(); |
|
70 |
|
71 /** |
|
72 * Initializes the iSaveState, then completes |
|
73 */ |
|
74 void Save(); |
|
75 |
|
76 // From CActive |
|
77 protected: |
|
78 void DoCancel(); |
|
79 void RunL(); |
|
80 |
|
81 private: |
|
82 /** |
|
83 * Constructor. |
|
84 */ |
|
85 CAudioMessageSaveOperation( |
|
86 CMsgAddressControl& aAddressCtrl, |
|
87 MAmsOperationObserver& aObserver, |
|
88 CAudioMessageDocument& aDocument, |
|
89 CMsgEditorView& aView ); |
|
90 |
|
91 |
|
92 /** |
|
93 * Called by RunL. |
|
94 * Calls different functions according to iSaveStep |
|
95 */ |
|
96 void DoSaveStepL(); |
|
97 |
|
98 /** |
|
99 * Inserts addresses from address control to clientMtm |
|
100 */ |
|
101 void DoSaveChecksL(); |
|
102 |
|
103 /** |
|
104 * finalize, some checks for recipients |
|
105 */ |
|
106 void DoFinalizeSaveL(); |
|
107 |
|
108 /** |
|
109 * ETrue if ok |
|
110 */ |
|
111 TBool CheckDiskSpaceL(); |
|
112 |
|
113 /** |
|
114 * Removes characters from string that confuses address |
|
115 * control or clientMtm. Note that function does not make diffrence |
|
116 * whether string is phone number or email address. |
|
117 * |
|
118 * @param aString |
|
119 * @return ETrue, chars were removed, EFalse otherwise |
|
120 */ |
|
121 TBool RemoveIllegalAddrChars( TDes& aString ); |
|
122 |
|
123 /** |
|
124 * Check that character is not something that confuses address |
|
125 * control or clientMtm. |
|
126 * |
|
127 * @param aChar |
|
128 * @return ETrue, char is legal, EFalse otherwise |
|
129 */ |
|
130 TBool IsValidAddrChar( const TChar& aChar ); |
|
131 |
|
132 protected: // data |
|
133 |
|
134 CMsgEditorView& iView; |
|
135 CMsgAddressControl& iAddressCtrl; |
|
136 TAmsSaveState iSaveState; |
|
137 |
|
138 }; |
|
139 |
|
140 |
|
141 #endif // __AUDIOMESSAGESAVEOPERATION_H |