engine/collectionframework/datasource/plugins/glxdatasourcemde/inc/glxdatasourcetaskmdeattribute.h
changeset 71 27f2d7aec52a
parent 69 45459746d5e8
child 72 0a8e959402e5
equal deleted inserted replaced
69:45459746d5e8 71:27f2d7aec52a
     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:   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef _C_GLXDATASOURCETASKMDEATTRIBUTETASK_H_
       
    21 #define _C_GLXDATASOURCETASKMDEATTRIBUTETASK_H_
       
    22 
       
    23 /**
       
    24  * @author Simon Brooks, Alex Birkett
       
    25  */
       
    26 
       
    27 #include <e32std.h>
       
    28 #include "glxdatasourcetaskmde.h"
       
    29 
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 class CGlxGetRequest;    
       
    34 
       
    35 NONSHARABLE_CLASS(TGlxQueryAttribute)
       
    36     {
       
    37 public:
       
    38     TGlxQueryAttribute(
       
    39         TMPXAttribute aAttribute,
       
    40         CMPXMedia* aMedia,
       
    41         TGlxFilterProperties aFilterProperties
       
    42         ) : 
       
    43         iAttribute(aAttribute),
       
    44         iMedia(aMedia),
       
    45         iFilterProperties(aFilterProperties)
       
    46             {
       
    47             
       
    48             };
       
    49 public:
       
    50     TMPXAttribute iAttribute;
       
    51     CMPXMedia* iMedia;
       
    52     TGlxFilterProperties iFilterProperties;
       
    53     };
       
    54 
       
    55 /**
       
    56  * Attribute retrieval task.
       
    57  */
       
    58 NONSHARABLE_CLASS(CGlxDataSourceTaskMdeAttribute) : public CGlxDataSourceTaskMde
       
    59 	{
       
    60 public:
       
    61     /**
       
    62      * Constructor.
       
    63      * @param aRequest request to be executed.
       
    64      * @param aObserver observer to be informed when task has completed.
       
    65      * @param aDataSource data source to be used by this object.
       
    66      */
       
    67 	CGlxDataSourceTaskMdeAttribute(CGlxGetRequest* aRequest, MGlxDataSourceRequestObserver& aObserver, CGlxDataSource* aDataSource);
       
    68 	
       
    69     /**
       
    70      * Destructor.
       
    71      */
       
    72     ~CGlxDataSourceTaskMdeAttribute();
       
    73 	
       
    74 private: // From CGlxDataSourceTask     
       
    75     /**
       
    76      * See @ref CGlxDataSourceTask::ExecuteRequestL
       
    77      */ 
       
    78     void ExecuteRequestL();
       
    79 	
       
    80 private: // From CGlxDataSourceTaskMde
       
    81     /**
       
    82      * See @ref CGlxDataSourceTaskMde::DoHandleQueryCompletedL
       
    83      */ 
       
    84     void DoHandleQueryCompletedL(CMdEQuery& aQuery);
       
    85 
       
    86     /**
       
    87      * See @ref CGlxDataSourceTaskMde::DoNextQueryL
       
    88      */ 
       
    89     void DoNextQueryL();
       
    90     
       
    91 private:	
       
    92 
       
    93 	void AddAttributesL(CMdEObject& aObject, CMPXMedia* aEntry);
       
    94 
       
    95 	void AddCollectionAttributesL(CMPXMedia* aEntry);
       
    96 	
       
    97 	void AddContainerAttributesL(CMPXMedia* aEntry, CMdEObject* aContainer, CGlxDataSource::TContainerType aType);
       
    98 	
       
    99 	void AddItemAttributesL(CMPXMedia* aEntry, CMdEObject* aItem, CGlxDataSource::TItemType aType);
       
   100 	
       
   101     /**
       
   102      * Add location information to a media object from MDS.
       
   103      * @param aLocationId the id of a location object.
       
   104      * @param aMedia media object to add a location attribute to.
       
   105      */
       
   106     void AddLocationAttributeToMediaL(CMPXMedia& aMedia, const TItemId& aLocationId);
       
   107         
       
   108 
       
   109     void DoHandleAttributeQueryCompletedL();
       
   110     
       
   111     /**
       
   112 	 * Handles the completion of a query of type ELocationQuery.
       
   113 	 */
       
   114 	void DoHandleLocationQueryCompletedL();
       
   115 	
       
   116 
       
   117 	void DoHandleImageVideoQueryCompletedL();
       
   118 		
       
   119     /**
       
   120      * Creates a location query and adds it to the queue of queries.
       
   121      */
       
   122     void QueueLocaitonQueryL();
       
   123 
       
   124     /**
       
   125      * @param aObjectDef object definition which defines objects which will be queried
       
   126      * @param aIsContent If ETrue, the definition of the objects being queried is set by the item type filter property, if EFalse, the definition
       
   127      * of the object being queried is provided by the aObjectDef parameter
       
   128      *  
       
   129      */
       
   130     void QueueObjectQueryL(CMdEObjectDef& aObjectDef, TBool aIsContent, TGlxQueryType aQueryType, TQueryResultMode aResultMode, 
       
   131                           const TGlxMediaId& aContainerId, TMPXAttribute aAttribute, CMPXMedia* aEntry, 
       
   132                           const TGlxFilterProperties& aFilterProperties);
       
   133     
       
   134 
       
   135 	void DoHandleAttributeResponseCompleteL();
       
   136 
       
   137 	
       
   138     /**
       
   139      * Determines if the request contains the KGlxMediaGeneralLocation attribtue.
       
   140      * @return ETrue if the the KGlxMediaGeneralLocation attribute is requrested else EFalse
       
   141      */
       
   142     TBool LocationAttributeRequested();
       
   143     
       
   144     /**
       
   145      * Executes the next query in the queue of queries.
       
   146      */
       
   147     void ExecuteQueryL(); 
       
   148 
       
   149 private:
       
   150     /**
       
   151      * Results media array (owned)
       
   152      */
       
   153     CMPXMediaArray* iMediaArray;
       
   154     
       
   155     /**
       
   156      * Attributes associated with outstanding queries
       
   157      */
       
   158     RArray< TGlxQueryAttribute > iQueryAttributes;
       
   159 	};
       
   160 
       
   161 
       
   162 #endif // _C_GLXDATASOURCETASKMDEATTRIBUTETASK_H_