|
1 /* |
|
2 * Copyright (c) 2006-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: MetadataEngine query adapter for CLF |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CCLFQUERYADAPTER_H |
|
20 #define C_CCLFQUERYADAPTER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <CLFContentListing.hrh> |
|
25 #include <CLFContentListing.h> |
|
26 #include <bamdesca.h> |
|
27 #include <mdesession.h> |
|
28 #include <mdeobjectquery.h> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CMdEObject; |
|
32 class CMdEProperty; |
|
33 class CMdEPropertyDefSet; |
|
34 |
|
35 /** |
|
36 * Wraps MdE functionality for Content Listing Framework |
|
37 * |
|
38 * @lib clf2mde |
|
39 * @since S60 3.1 |
|
40 */ |
|
41 NONSHARABLE_CLASS( CCLFQueryAdapter ) : public CBase, |
|
42 public MMdEQueryObserver |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 // 2-phase constructor |
|
47 static CCLFQueryAdapter* NewL( CMdESession& aMdESession ); |
|
48 |
|
49 // Destructor |
|
50 virtual ~CCLFQueryAdapter(); |
|
51 |
|
52 public: // New functions |
|
53 |
|
54 /** |
|
55 * Queries the mediatypes |
|
56 * |
|
57 * @since S60 3.1 |
|
58 * @param aMimeTypeArray array for mime types which are included in result |
|
59 * @param aMediaTypeArray array for media types which are included in result |
|
60 * @param aStatus reference to TRequestStatus which is completed |
|
61 */ |
|
62 |
|
63 void QueryMdEObjectsL( const MDesCArray& aMimeTypeArray, |
|
64 const TArray< TInt >& aMediaTypeArray, |
|
65 CMdEObjectQuery*& aQuery, |
|
66 TRequestStatus& aStatus ); |
|
67 |
|
68 void QueryMdEObjectsL( const TArray< TCLFItemId >& aItemIDArray, |
|
69 const TDesC& aObjDefStr, |
|
70 CMdEObjectQuery*& aQuery, |
|
71 TRequestStatus& aStatus ); |
|
72 |
|
73 protected: // Functions from base classes |
|
74 |
|
75 /** |
|
76 * From MMdEQueryObserver |
|
77 */ |
|
78 void HandleQueryNewResults( CMdEQuery& aQuery, |
|
79 TInt aFirstNewItemIndex, |
|
80 TInt aNewItemCount ); |
|
81 |
|
82 /** |
|
83 * From MMdEQueryObserver |
|
84 */ |
|
85 void HandleQueryCompleted( CMdEQuery& aQuery, TInt aError ); |
|
86 |
|
87 private: // New functions |
|
88 |
|
89 /** |
|
90 * Helper function. |
|
91 */ |
|
92 void CompleteRequest( CMdEQuery& aQuery, TInt aError ); |
|
93 |
|
94 void AddMimeTypeConditionL( CMdELogicCondition& aLogicCondition, |
|
95 const CMdEPropertyDef& aPropDef, |
|
96 const TPtrC& aMimeType ); |
|
97 |
|
98 private: |
|
99 |
|
100 /** |
|
101 * C++ default constructor. |
|
102 */ |
|
103 CCLFQueryAdapter( CMdESession& aMdESession ); |
|
104 |
|
105 /** |
|
106 * By default Symbian 2nd phase constructor is private. |
|
107 */ |
|
108 void ConstructL(); |
|
109 |
|
110 private: // data |
|
111 |
|
112 /** MdE session. Ref */ |
|
113 CMdESession& iMdESession; |
|
114 |
|
115 /** MdE namespace */ |
|
116 CMdENamespaceDef* iDefaultNamespaceDef; |
|
117 |
|
118 /** MdE query array */ |
|
119 RPointerArray< CMdEQuery > iQueryArray; |
|
120 |
|
121 /** Request status array */ |
|
122 RPointerArray< TRequestStatus > iStatusArray; |
|
123 }; |
|
124 |
|
125 #endif // C_CCLFQUERYADAPTER_H |
|
126 |
|
127 // End of File |