|
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 the License "Symbian Foundation License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Media plug-in for LAWMO |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef _MEDIAPLUGIN__ |
|
19 #define _MEDIAPLUGIN__ |
|
20 |
|
21 #include <e32base.h> // For CActive, link against: euser.lib |
|
22 #include <e32std.h> // For RTimer, link against: euser.lib |
|
23 #include <mdesession.h> |
|
24 #include <mdequery.h> |
|
25 #include <mdeobjectdef.h> |
|
26 #include <mdeobjectquery.h> |
|
27 #include <mdeconstants.h> |
|
28 #include <mdeitem.h> |
|
29 #include <f32file.h> |
|
30 #include <flogger.h> |
|
31 #include <lawmointerface.h> |
|
32 #include <lawmocallbackinterface.h> |
|
33 |
|
34 // An implementation of the CLAWMOPluginInterface definition |
|
35 class CLAWMOMediaPlugin : public CLAWMOPluginInterface, |
|
36 public MMdESessionObserver, |
|
37 public MMdEQueryObserver |
|
38 { |
|
39 public: |
|
40 // Standardised safe construction which leaves nothing the cleanup stack. |
|
41 static CLAWMOMediaPlugin* NewL(MLawmoPluginWipeObserver* aObserver); |
|
42 // Destructor |
|
43 ~CLAWMOMediaPlugin(); |
|
44 |
|
45 void WipeL (); |
|
46 // Initiate and start a MdsQuery |
|
47 void StartMdsQueryL(); |
|
48 public: // from MMdESessionObserver |
|
49 |
|
50 void HandleSessionOpened( CMdESession& aSession, TInt aError ); |
|
51 void HandleSessionError( CMdESession& aSession, TInt aError ); |
|
52 |
|
53 public: // from MMdEQueryObserver |
|
54 void HandleQueryNewResults(CMdEQuery& aQuery, |
|
55 TInt aFirstNewItemIndex, |
|
56 TInt aNewItemCount); |
|
57 |
|
58 void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError); |
|
59 |
|
60 private: |
|
61 enum TMdsQueryState |
|
62 { |
|
63 EUninitialized, // Uninitialized |
|
64 EInitialized, // Initalized |
|
65 EImage, |
|
66 EVideo, |
|
67 ESession, |
|
68 EError |
|
69 // Error condition |
|
70 }; |
|
71 |
|
72 private: |
|
73 // Construction |
|
74 CLAWMOMediaPlugin(); |
|
75 /** |
|
76 * second phase constructor |
|
77 */ |
|
78 void ConstructL(MLawmoPluginWipeObserver* aObserver); |
|
79 |
|
80 private: |
|
81 TInt iState; // State of the active object |
|
82 CMdESession* iMdeSession; // session to MdE, created before trying to do the query |
|
83 CMdEObjectQuery* iQuery; |
|
84 RFs iRfs; |
|
85 MLawmoPluginWipeObserver* iObserver; |
|
86 }; |
|
87 |
|
88 #endif // _MEDIAPLUGIN__ |