photos_plat/controllers_collection_api/inc/glxcollectionmanager.h
changeset 0 4e91876724a2
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     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:    Implementation of collection manager API for external use
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __C_GLXCOLLECTIONMANAGER_H__
       
    22 #define __C_GLXCOLLECTIONMANAGER_H__
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <e32std.h>
       
    26 #include <mpxcollectionobserver.h>
       
    27 
       
    28 class CGlxCollectionInfo;
       
    29 class CGlxCollectionManagerImpl;
       
    30 
       
    31 
       
    32 /**
       
    33  * Collection manager allows accessing and managing collections (only albums
       
    34  * currently supported). 
       
    35  *
       
    36  * Only one request may be issued at one time. Functions panic if two requests
       
    37  * are issued at the same time
       
    38  *
       
    39  * The interface is intended to be used by non-MPX applications. 
       
    40  * Not intended to be used by Gallery internally, as there are more efficient 
       
    41  * and architecturally aligned means existing.
       
    42  *
       
    43  * @lib glxuiutilities.lib
       
    44  */
       
    45 NONSHARABLE_CLASS( CGlxCollectionManager )
       
    46  	: public CBase
       
    47 	{
       
    48 public: 
       
    49     /**
       
    50      * Special collections, for which id is not know by client
       
    51      */
       
    52     enum TCollection
       
    53         {
       
    54         /// Camera album 
       
    55         ECollectionCameraAlbum
       
    56         };
       
    57 public:
       
    58     /**
       
    59      * Two-phase constructor
       
    60      */
       
    61     IMPORT_C static CGlxCollectionManager* NewL();
       
    62 
       
    63     /**
       
    64      * Destructor
       
    65      */
       
    66     IMPORT_C ~CGlxCollectionManager();
       
    67 
       
    68     /**
       
    69      * Adds a file to collection asynchronously.
       
    70      * @param aUri URI of file to be added to collection
       
    71      * @param aCollection Specific collection to which item should be added
       
    72      * @param aRequestStatus Request status that will be signalled when 
       
    73      *         request is complete or fails due to an error. aRequestStatus must
       
    74      *         be an iStatus member variable of an active object. Using
       
    75      *         User::WaitForRequest() will not work.
       
    76      */
       
    77     IMPORT_C void AddToCollectionL(const TDesC& aUri, 
       
    78         TCollection aCollection, TRequestStatus& aRequestStatus);
       
    79 
       
    80     /**
       
    81      * Adds a file to collection asynchronously.
       
    82      * @param aUri URI of file to be added to collection
       
    83      * @param aCollectionId MDS ID of collection (album, tag, etc.)
       
    84      * @param aRequestStatus Request status that will be signalled when 
       
    85      *         request is complete or fails due to an error. aRequestStatus must
       
    86      *         be an iStatus member variable of an active object. Using
       
    87      *         User::WaitForRequest() will not work.
       
    88      */
       
    89     IMPORT_C void AddToCollectionL(const TDesC& aUri, 
       
    90         TUint32 aCollectionId, TRequestStatus& aRequestStatus);
       
    91 
       
    92     /**
       
    93      * Retrieves collection info
       
    94      * @param aInfo Contains the collection information upon return
       
    95      *         Must contain the collection id when called.
       
    96      *         Must not be deleted before aRequestStatus is signalled.
       
    97      * @param aRequestStatus Request status that will be signalled when 
       
    98      *         request is complete or fails due to an error. aRequestStatus must
       
    99      *         be an iStatus member variable of an active object. Using
       
   100      *         User::WaitForRequest() will not work.
       
   101      */
       
   102     IMPORT_C void CollectionInfoL(CGlxCollectionInfo& aInfo,
       
   103         TRequestStatus& aRequestStatus);
       
   104 
       
   105     /**
       
   106      * Cancel an ongoing request
       
   107      */
       
   108     IMPORT_C void Cancel();
       
   109 
       
   110 private:
       
   111 	/**
       
   112 	 * Default constructor.
       
   113 	 */
       
   114 	CGlxCollectionManager();
       
   115 	
       
   116 	/**
       
   117 	 * Second-phase constructor
       
   118 	 */
       
   119 	void ConstructL();
       
   120     
       
   121 private:
       
   122 	/**
       
   123 	 * Internal implementation (owned).
       
   124 	 */
       
   125     CGlxCollectionManagerImpl* iImplementation;
       
   126 	};
       
   127 
       
   128 #endif // __C_GLXCOLLECTIONMANAGER_H__