|
1 /* |
|
2 * Copyright (c) 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 * |
|
16 */ |
|
17 |
|
18 #ifndef GLXCOMMANDHANDLERNEWMEDIA_H |
|
19 #define GLXCOMMANDHANDLERNEWMEDIA_H |
|
20 |
|
21 #include <glxmpxcommandhandler.h> |
|
22 #include <glxmediaid.h> |
|
23 |
|
24 #ifdef BUILD_COMMONCOMMANDHANDLERS |
|
25 #define GLX_COMMONCOMMANDHANDLERS_EXPORT Q_DECL_EXPORT |
|
26 #else |
|
27 #define GLX_COMMONCOMMANDHANDLERS_EXPORT Q_DECL_IMPORT |
|
28 #endif |
|
29 |
|
30 class HbInputDialog; |
|
31 |
|
32 class GLX_COMMONCOMMANDHANDLERS_EXPORT GlxCommandHandlerNewMedia : public GlxMpxCommandHandler |
|
33 { |
|
34 Q_OBJECT |
|
35 public: |
|
36 GlxCommandHandlerNewMedia(); |
|
37 ~GlxCommandHandlerNewMedia(); |
|
38 |
|
39 TInt ExecuteLD(TGlxMediaId& aNewMediaId,QString& aTitle); |
|
40 |
|
41 private: |
|
42 QString CompletionTextL() const; |
|
43 QString ProgressTextL() const; |
|
44 |
|
45 protected: // From MGlxMediaListObserver |
|
46 /// See @ref MGlxMediaListObserver::HandleItemAddedL |
|
47 void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList); |
|
48 void HandleError(TInt aError); |
|
49 void HandleErrorL(TInt aErrorCode); |
|
50 protected: // from GlxMpxCommandHandler |
|
51 |
|
52 CMPXCommand* CreateCommandL(TInt aCommandId, MGlxMediaList& aMediaList, TBool& aConsume) const ; |
|
53 |
|
54 void DoHandleCommandCompleteL(TAny* aSessionId, CMPXCommand* aCommandResult, |
|
55 TInt aError, MGlxMediaList* aList); |
|
56 |
|
57 private: |
|
58 QString GenerateNewMediaItemTitleL(QString newMediaTilte,MGlxMediaList& aMediaList) const; |
|
59 public: |
|
60 /** |
|
61 * Id of new media |
|
62 */ |
|
63 TGlxMediaId iNewMediaId; |
|
64 |
|
65 /** |
|
66 * Active scheduler wait object. (Owned) |
|
67 */ |
|
68 CActiveSchedulerWait* iSchedulerWait; |
|
69 |
|
70 /** |
|
71 * Error set by DoHandleCommandCompleteL() |
|
72 */ |
|
73 mutable TInt iNewMediaCreationError; |
|
74 |
|
75 mutable HBufC* iNewMediaItemTitle; |
|
76 private: |
|
77 bool mShowConfirmation; |
|
78 |
|
79 }; |
|
80 |
|
81 |
|
82 |
|
83 #endif // GLXCOMMANDHANDLERNEWMEDIA_H |