|
1 /* |
|
2 * Copyright (c) 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: Collection observer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MMPXCOLLECTIONOBSERVER_H |
|
20 #define MMPXCOLLECTIONOBSERVER_H |
|
21 |
|
22 #include<mpxcollectionframeworkdefs.h> |
|
23 #include <mpxmessage2.h> |
|
24 #include <mpxcommand.h> |
|
25 |
|
26 class MDesCArray; |
|
27 class TMPXCollectionMessage; |
|
28 class CMPXCollectionPlaylist; |
|
29 class MMPXCollectionFindObserver; |
|
30 |
|
31 /******************************************************************************** |
|
32 * |
|
33 * Note: |
|
34 * |
|
35 * ** remove TMPXCollectionMessage and associated funtions |
|
36 * |
|
37 * ** remove null implementations |
|
38 * |
|
39 *********************************************************************************/ |
|
40 |
|
41 NONSHARABLE_CLASS(MMPXCollectionMediaObserver) |
|
42 { |
|
43 public: |
|
44 /** |
|
45 * Handle extended media properties. |
|
46 * |
|
47 * @since S60 3.2.3 |
|
48 * @param aMedia media |
|
49 * @param aError error code |
|
50 */ |
|
51 virtual void HandleCollectionMediaL(const CMPXMedia& aMedia, |
|
52 TInt aError) = 0; |
|
53 }; |
|
54 |
|
55 /** |
|
56 * Interface for receiving data asynchronously |
|
57 */ |
|
58 NONSHARABLE_CLASS(MMPXCollectionObserver) : public MMPXCollectionMediaObserver |
|
59 { |
|
60 public: |
|
61 |
|
62 /** |
|
63 * |
|
64 * |
|
65 * Handle collection message |
|
66 * NOTE: only one of HandleCollectionMessage callback can be implemented |
|
67 * |
|
68 * @param aMessage collection message |
|
69 * @deprecated please implement HandleCollectionMessage(CMPXMessage* aMsg, TInt aErr) |
|
70 */ |
|
71 virtual void HandleCollectionMessageL(const CMPXMessage& /*aMsg*/) {/* */} |
|
72 |
|
73 |
|
74 /** |
|
75 * Handle collection message. |
|
76 * NOTE: only one of HandleCollectionMessage callback can be implemented |
|
77 * |
|
78 * @since S60 3.2.3 |
|
79 * @param aMessage collection message, ownership not transferred. |
|
80 * Please check aMsg is not NULL before using it. If aErr is not |
|
81 * KErrNone, plugin might still call back with more info in the aMsg. |
|
82 * @param aErr system error code |
|
83 */ |
|
84 virtual void HandleCollectionMessage(CMPXMessage* aMsg, TInt /*aErr*/) |
|
85 { |
|
86 // Note change into pure virtual when all clients updated |
|
87 // Temp solution, aMsg will be a dummy object if aErr |
|
88 // TO BE REMOVED when above HandlePlaybackMessage is removed. |
|
89 TRAP_IGNORE(HandleCollectionMessageL(*aMsg)); |
|
90 } |
|
91 |
|
92 /** |
|
93 * Handles the collection entries being opened. Typically called |
|
94 * when client has Open()'d a folder. |
|
95 * |
|
96 * @since S60 3.2.3 |
|
97 * @param aEntries collection entries opened |
|
98 * @param aIndex focused entry |
|
99 * @param aComplete ETrue no more entries. EFalse more entries |
|
100 * expected |
|
101 * @param aError error code |
|
102 */ |
|
103 virtual void HandleOpenL(const CMPXMedia& aEntries, |
|
104 TInt aIndex,TBool aComplete,TInt aError) = 0; |
|
105 |
|
106 /** |
|
107 * Handles the item being opened. Typically called |
|
108 * when client has Open()'d an item. Client typically responds by |
|
109 * 'playing' the item via the playlist. |
|
110 * |
|
111 * @since S60 3.2.3 |
|
112 * @param aPlaylist collection playlist |
|
113 * @param aError error code |
|
114 */ |
|
115 virtual void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError) = 0; |
|
116 |
|
117 /** |
|
118 * Handle completion of a asynchronous command. |
|
119 * Note: All clients should implement this callback. |
|
120 * |
|
121 * @since S60 3.2.3 |
|
122 * @param aCommandResult result of the command, NULL if error |
|
123 * @param aError error code |
|
124 */ |
|
125 virtual void HandleCommandComplete(CMPXCommand* /*aCommandResult*/, |
|
126 TInt /*aError*/) {}; |
|
127 }; |
|
128 |
|
129 NONSHARABLE_CLASS(MMPXCollectionFindObserver) |
|
130 { |
|
131 public: |
|
132 /** |
|
133 * Handle callback for "find" operation. |
|
134 * |
|
135 * @since S60 3.2.3 |
|
136 * @param aEntries CMPXMedia to be returned |
|
137 * @param aComplete ETrue no more entries. EFalse more entries |
|
138 * expected |
|
139 * @param aError error code |
|
140 */ |
|
141 virtual void HandleFindAllL(const CMPXMedia& aResults, |
|
142 TBool aComplete,TInt aError) = 0; |
|
143 }; |
|
144 |
|
145 NONSHARABLE_CLASS(MMPXCollectionRemoveObserver) |
|
146 { |
|
147 public: |
|
148 /** |
|
149 * Handles removing a collection path. |
|
150 * Calls back with the list of file paths that were deleted. |
|
151 * This callback is only applicable for local file storage plugins. |
|
152 * |
|
153 * @since S60 3.2.3 |
|
154 * @param aUriArray list of files that were deleted |
|
155 * @param aError error code |
|
156 */ |
|
157 virtual void HandleRemoveL(MDesCArray& aUriArray, TInt aError) = 0; |
|
158 }; |
|
159 |
|
160 #endif // MMPXCOLLECTIONOBSERVER_H |