|
1 /* |
|
2 * Copyright (c) 2008-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: AIW Share On Ovi command handler ( Works only with ShareOnline application version 4.3 and above ) |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INTERNAL INCLUDES |
|
20 #include "glxcommandhandleraiwshareonovi.h" |
|
21 #include "glxaiwservicehandler.h" |
|
22 |
|
23 // EXTERNAL INCLUDES |
|
24 #include <glxattributecontext.h> |
|
25 #include <glxmedia.h> |
|
26 #include <glxcommandhandlers.hrh> |
|
27 #include <glxuiutilities.rsg> |
|
28 |
|
29 // CONSTANTS AND FORWARD DECLARATIONS |
|
30 const TInt KGlxAiwShareOnOviCommandSpace = 0x00000500; |
|
31 |
|
32 // ----------------------------------------------------------------------------- |
|
33 // NewL |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 EXPORT_C CGlxCommandHandlerAiwShareOnOvi* CGlxCommandHandlerAiwShareOnOvi::NewL( |
|
37 MGlxMediaListProvider* aMediaListProvider, TInt aMenuResource) |
|
38 { |
|
39 CGlxCommandHandlerAiwShareOnOvi* self = new ( ELeave ) |
|
40 CGlxCommandHandlerAiwShareOnOvi(aMediaListProvider, aMenuResource); |
|
41 CleanupStack::PushL( self ); |
|
42 self->ConstructL(); |
|
43 CleanupStack::Pop( self ); |
|
44 return self; |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CGlxCommandHandlerAiwShareOnOvi::DoGetRequiredAttributesL |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 void CGlxCommandHandlerAiwShareOnOvi::DoGetRequiredAttributesL |
|
52 (RArray<TMPXAttribute>& aAttributes, TBool aFilterUsingSelection) const |
|
53 { |
|
54 if (!aFilterUsingSelection || SelectionLength() <= MaxSelectedItems()) |
|
55 { |
|
56 // Add filename attribute to fetch context |
|
57 aAttributes.AppendL(KMPXMediaGeneralUri); |
|
58 } |
|
59 } |
|
60 |
|
61 // ----------------------------------------------------------------------------- |
|
62 // Constructor |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 CGlxCommandHandlerAiwShareOnOvi::CGlxCommandHandlerAiwShareOnOvi( |
|
66 MGlxMediaListProvider* aMediaListProvider, TInt aMenuResource) |
|
67 : CGlxCommandHandlerAiwBase(aMediaListProvider, aMenuResource) |
|
68 { |
|
69 } |
|
70 |
|
71 // ----------------------------------------------------------------------------- |
|
72 // CommandId |
|
73 // ----------------------------------------------------------------------------- |
|
74 // |
|
75 TInt CGlxCommandHandlerAiwShareOnOvi::CommandId() const |
|
76 { |
|
77 return EGlxCmdAiwShareOnOvi; |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // AiwCommandId |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 TInt CGlxCommandHandlerAiwShareOnOvi::AiwCommandId() const |
|
85 { |
|
86 return KAiwCmdUpload; |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // AiwInterestResource |
|
91 // ----------------------------------------------------------------------------- |
|
92 // |
|
93 TInt CGlxCommandHandlerAiwShareOnOvi::AiwInterestResource() const |
|
94 { |
|
95 return R_AIW_SHARE_INTEREST; |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // AppendAiwParameterL |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 TBool CGlxCommandHandlerAiwShareOnOvi::AppendAiwParameterL(const TGlxMedia& aItem, |
|
103 CGlxAiwServiceHandler& aAiwServiceHandler) |
|
104 { |
|
105 return AppendDefaultAiwParameterL( aItem, |
|
106 aAiwServiceHandler, |
|
107 ETrue, // Add the Uri |
|
108 EFalse); // Don't add the Mime Type |
|
109 } |
|
110 |
|
111 // ----------------------------------------------------------------------------- |
|
112 // CommandSpace |
|
113 // ----------------------------------------------------------------------------- |
|
114 // |
|
115 TInt CGlxCommandHandlerAiwShareOnOvi::CommandSpace() const |
|
116 { |
|
117 return KGlxAiwShareOnOviCommandSpace; |
|
118 } |