photosgallery/collectionframework/thumbnailcreator/inc/glxtnfileutility.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:    Utility for thumbnail tasks handling files
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 /**
       
    22  * @internal reviewed 30/07/2007 by Simon Brooks
       
    23  */
       
    24 
       
    25 #ifndef GLXTNFILEUTILITY_H
       
    26 #define GLXTNFILEUTILITY_H
       
    27 
       
    28 #include <e32base.h>
       
    29 #include <f32file.h>
       
    30 
       
    31 /**
       
    32  * Utility for thumbnail tasks handling files.
       
    33  *
       
    34  * @author Dan Rhodes
       
    35  * @ingroup glx_thumbnail_creator
       
    36  */
       
    37 NONSHARABLE_CLASS(CGlxtnFileUtility) : public CBase
       
    38     {
       
    39 public:  // Constructors and destructor
       
    40 
       
    41     /**
       
    42     * Two-phased constructor.
       
    43     */
       
    44     static CGlxtnFileUtility* NewL();
       
    45 
       
    46     /**
       
    47     * Destructor.
       
    48     */
       
    49     ~CGlxtnFileUtility();
       
    50 
       
    51     /**
       
    52     * Provide file server session for opening images from files.
       
    53     */
       
    54     RFs& FsSession();
       
    55 
       
    56     /**
       
    57     * Test whether a file is on the bad file list.  If so this method leaves.
       
    58     * If not the bad file marker is set to the filename, so that if a panic
       
    59     * occurs the file will be added to the bad file list.
       
    60     * @param aFilename Path of file for which a thumbnail is to be generated.
       
    61     */
       
    62     void CheckBadFileListL(const TDesC& aFilename);
       
    63 
       
    64     /**
       
    65     * Clear the bad file marker.  Called when processing a file is complete (no
       
    66     * panic occurred).
       
    67     */
       
    68     void ClearBadFileMarker();
       
    69 
       
    70     /**
       
    71     * Test whether a generated thumbnail should be stored in persistent storage.
       
    72     * @param aSize Requested size of thumbnail.
       
    73     */
       
    74     TBool IsPersistentSize(const TSize& aSize);
       
    75 
       
    76 private:
       
    77 
       
    78     /**
       
    79     * C++ default constructor.
       
    80     */
       
    81     CGlxtnFileUtility();
       
    82 
       
    83     /**
       
    84     * By default Symbian 2nd phase constructor is private.
       
    85     */
       
    86     void ConstructL();
       
    87 
       
    88     /**
       
    89     * Read bad file list from file and add file from marker, if present.
       
    90     */
       
    91     void ReadBadFileListL();
       
    92     /**
       
    93     * Write bad file list to file.
       
    94     */
       
    95     void WriteBadFileListL();
       
    96 	/**
       
    97     * calculates Grid Icon Size for landscape orientation and Fullscreen
       
    98     * Image size depending on Layout defines.
       
    99     */
       
   100 	void LayoutSpecificDataL();
       
   101 	
       
   102 private:
       
   103     /** File server session for opening images from files */
       
   104     RFs iFs;
       
   105     /** Directory in which to store bad file list and marker */
       
   106     TFileName iBadFileDir;
       
   107     /** Filenames of media files which cause panics when decoding */
       
   108     RPointerArray<HBufC> iBadFileArray;
       
   109     /** Persistent thumbnail size classes */
       
   110     RArray<TSize> iPersistentSizeClasses;
       
   111     };
       
   112 
       
   113 #endif  // GLXTNFILEUTILITY_H