|
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 launching operations |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __AUDIOMESSAGELAUNCHOPERATION_H |
|
21 #define __AUDIOMESSAGELAUNCHOPERATION_H |
|
22 |
|
23 #include "audiomessageoperation.h" |
|
24 #include "audiomessagedocument.h" |
|
25 |
|
26 class CMsgImageControl; |
|
27 class CAudioMessageRecorder; |
|
28 |
|
29 /** |
|
30 * class for application launching |
|
31 * |
|
32 * @lib audiomessage.exe |
|
33 * @since S60 v3.1 |
|
34 */ |
|
35 class CAudioMessageLaunchOperation : public CAudioMessageOperation |
|
36 { |
|
37 protected: |
|
38 enum TAmsLaunchState |
|
39 { |
|
40 EAmsLaunchInitialize = 0, |
|
41 EAmsCheckAttach, |
|
42 EAmsHandleAudio, |
|
43 EAmsLaunchPrepareContent, |
|
44 EAmsLaunchAddNeededSmil, |
|
45 EAmsLaunchUnInitialize, |
|
46 EAmsLaunchPrepareBody, |
|
47 EAmsLaunchEnd, |
|
48 EAmsLaunchErrorReport |
|
49 }; |
|
50 |
|
51 public: // New methods |
|
52 /** |
|
53 * Sets icon in body. |
|
54 * @param aType EAudioInsert/EAudioInserted |
|
55 */ |
|
56 void DoPrepareBodyL( TAmsRecordIconStatus aType ); |
|
57 |
|
58 /** |
|
59 * Factory method that creates this object. |
|
60 * |
|
61 * @param aControlObserver for imagecontrol use |
|
62 * @param aOperationObserver for appui use |
|
63 * @param aDocument |
|
64 * @param aView |
|
65 * @param aAppUi |
|
66 * @return Pointer to instance in cleanup stack |
|
67 */ |
|
68 static CAudioMessageLaunchOperation* NewL( |
|
69 MAmsOperationObserver& aOperationObserver, |
|
70 CAudioMessageDocument& aDocument, |
|
71 CMsgEditorView& aView ); |
|
72 |
|
73 /** |
|
74 * Destructor |
|
75 */ |
|
76 virtual ~CAudioMessageLaunchOperation(); |
|
77 |
|
78 /** |
|
79 * Initializes the iLaunchState,then completes |
|
80 */ |
|
81 void Launch(); |
|
82 |
|
83 /** |
|
84 * Sets the mimetypes and content location. |
|
85 * Stores headers, checks is smil exists |
|
86 */ |
|
87 void DoPrepareContentL(); |
|
88 |
|
89 /** |
|
90 * Gets the framesize |
|
91 */ |
|
92 TSize FrameSize(); |
|
93 |
|
94 // From CActive |
|
95 protected: |
|
96 void DoCancel(); |
|
97 void RunL(); |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * Constructor. |
|
103 */ |
|
104 CAudioMessageLaunchOperation( |
|
105 MAmsOperationObserver& aOperationObserver, |
|
106 CAudioMessageDocument& aDocument, |
|
107 CMsgEditorView& aView ); |
|
108 |
|
109 /** |
|
110 * Called by RunL. |
|
111 * Calls different functions according to iLaunchStep |
|
112 */ |
|
113 void DoLaunchStepL(); |
|
114 |
|
115 /** |
|
116 * Calls DoPrepareBodyL with argument |
|
117 */ |
|
118 void DoPrepareBodyL(); |
|
119 |
|
120 /** |
|
121 * initialize, sets store and makes some checks |
|
122 */ |
|
123 void DoInitializeL(); |
|
124 |
|
125 /** |
|
126 * checks is smil in message |
|
127 * @return ETrue there is. |
|
128 */ |
|
129 TBool SmilExists(); |
|
130 |
|
131 /** |
|
132 * sets smil flag |
|
133 * @param aSel ETrue/EFalse. |
|
134 */ |
|
135 void SetSmilExists(TBool aSel); |
|
136 void DoHandleAudioL( ); |
|
137 |
|
138 protected: |
|
139 |
|
140 |
|
141 CMsgEditorView& iView; |
|
142 |
|
143 /** |
|
144 * current insertion/deletion state |
|
145 */ |
|
146 TInt iLaunchState; |
|
147 |
|
148 /** |
|
149 * smilexist bit |
|
150 */ |
|
151 TBool iSmilExist; |
|
152 |
|
153 /** |
|
154 * control for main audio clip icon |
|
155 * Own. |
|
156 */ |
|
157 CMsgImageControl* iImageControl; |
|
158 |
|
159 //TFileName iContentLocationFileName; |
|
160 |
|
161 }; |
|
162 |
|
163 #endif // __AUDIOMESSEAGELAUNCHOPERATION_H |
|
164 |
|
165 |