photosgallery/viewframework/medialists/inc/mglxcache.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:    Interface to media item cache
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef M_GLXCACHE_H
       
    22 #define M_GLXCACHE_H
       
    23 
       
    24 class CGlxMedia;
       
    25 class MGlxCacheObserver;
       
    26 
       
    27 #include "glxmediaid.h"
       
    28 
       
    29 /**
       
    30  *  MGlxCache
       
    31  *
       
    32  *  External interface to the media item cache
       
    33  *
       
    34  *  @lib glxmedialists.lib
       
    35  */
       
    36 class MGlxCache
       
    37 	{
       
    38 public:	
       
    39     /**
       
    40      * Return a reference-counted instance of MGlxCache. User MUST Close() this when finished with it.
       
    41      * @return Singleton cache object
       
    42      */
       
    43     IMPORT_C static MGlxCache* InstanceL();
       
    44 
       
    45     /**
       
    46      * Finds a media item based on id-space and media id
       
    47      * @param aIdSpaceId The id space of the media item
       
    48      * @param aMediaId The id of the media item
       
    49      * @return The media item, if found; NULL if not
       
    50      */
       
    51 	virtual CGlxMedia* Media(const TGlxIdSpaceId& aIdSpaceId, const TGlxMediaId& aMediaId) const = 0;
       
    52 
       
    53     /**
       
    54      * Add a cache observer
       
    55      * @param aObserver The observer to add
       
    56      */
       
    57 	virtual void AddObserverL(MGlxCacheObserver* aObserver) = 0;
       
    58 
       
    59     /**
       
    60      * Remove a cache observer
       
    61      * @param aObserver The observer to remove
       
    62      */
       
    63 	virtual void RemoveObserver(MGlxCacheObserver* aObserver) = 0;
       
    64 
       
    65     /**
       
    66      * Begin refreshing fetch contexts, if currently idle.
       
    67      */
       
    68     virtual void RefreshL() = 0;
       
    69 
       
    70     /**
       
    71      * Close the MGlxCache object. This MUST be called when the client has finished using it
       
    72      */	
       
    73 	virtual void Close() = 0;
       
    74 	
       
    75 	//OOM	
       
    76 	/**
       
    77 	 * ReleaseRAM on request
       
    78 	 */ 
       
    79 	 virtual void ReleaseRAML(TBool aFlushOnRequest = EFalse) = 0;
       
    80 	/**
       
    81 	 * Stop RAM realease.
       
    82 	 */ 
       
    83 	virtual void StopRAMReleaseL() = 0;	
       
    84     //OOM
       
    85 
       
    86 	/**
       
    87      * Cleanup Container Cache
       
    88      */
       
    89 	virtual void ForceCleanupMedia(TGlxIdSpaceId aSpaceId,TGlxMediaId aId)=0;
       
    90 	};
       
    91 
       
    92 #endif // M_GLXCACHE_H
       
    93