EngInc/IEImageList.h
changeset 3 93fff7023be8
equal deleted inserted replaced
2:e1e28b0273b0 3:93fff7023be8
       
     1 /*
       
     2 * Copyright (c) 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: Juha Kauppinen, Mika Hokkanen
       
    13 * 
       
    14 * Description: Photo Browser
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __IEIMAGELIST_H_
       
    19 #define __IEIMAGELIST_H_
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <f32file.h>
       
    24 #include <bautils.h>
       
    25 #include <s32file.h>
       
    26 #include <ICLExif.h> 
       
    27 #include <exifread.h>
       
    28 #include <ExifUtility.h>
       
    29 
       
    30 #include "IEImageProcessing.h"
       
    31 #include "IEEngineUtils.h"
       
    32 
       
    33 class CIEFileLoader;
       
    34 
       
    35 enum TGridMode {
       
    36     EGridModeTime,
       
    37     EGridModeFolder,
       
    38     EGridModePeople
       
    39 };
       
    40 
       
    41 class CIEImageList
       
    42     {
       
    43 public:
       
    44     IMPORT_C static CIEImageList* NewL(RArray<CImageData*>& aImageData, CIEFileLoader* aCallback);
       
    45     IMPORT_C ~CIEImageList();    
       
    46     IMPORT_C TBool IsImageViewableL(TDesC& aFileName, RFs& aFs) const;
       
    47     IMPORT_C void ReadDatabaseL();
       
    48     IMPORT_C void WriteDatabaseL();
       
    49     IMPORT_C CImageData* CreateImageDataL(
       
    50             const TFileName& aFileName, 
       
    51             const TTime& aCreatedTime, 
       
    52             TReal orientation);
       
    53     IMPORT_C void AddImage(CImageData* aImageData);
       
    54     IMPORT_C void Remove(TInt aIndex, RFs& aFs);
       
    55     IMPORT_C void RemoveNonExistImagesL(TDesC* aPath, RFs& aFs);     
       
    56     IMPORT_C TInt GetImageIndex(CImageData* aImageData);
       
    57     IMPORT_C CImageData* GetImageData(const TFileName& aFileName);
       
    58     IMPORT_C void SetChanged(TDesC& aPath);
       
    59     IMPORT_C void SetGridMode(TGridMode aGridMode);
       
    60     IMPORT_C TGridMode GetGridMode() const;    
       
    61     
       
    62 private:        
       
    63     enum TImageListDrive {
       
    64         EImageListDriveC = 0,
       
    65         EImageListDriveE = 1,
       
    66         EImageListDriveF = 2,
       
    67     };
       
    68   
       
    69     CIEImageList(RArray<CImageData*>& aImageData, CIEFileLoader* aCallback);
       
    70     void ConstructL();
       
    71     CImageData* ReadImageDataL(RFileReadStream& readStream, RFs& aFs);
       
    72     void WriteDatabaseL(TImageListDrive aDrive, RFs& aFs);
       
    73     void GetDatabaseFileName(TFileName& aFileName, TImageListDrive aDrive);
       
    74     TBool IsImageBefore(CImageData* aImageData1, TInt aIndex) const;
       
    75     TInt GetNewImageIndex(CImageData* aImageData) const;
       
    76     void Rearrange(TInt aStartIndex);
       
    77     void SetChanged(CImageData* aImageData);
       
    78     static TImageListDrive GetPathDriveL(TDesC& aPath);
       
    79     
       
    80     CIEFileLoader*          iCallback; 
       
    81     TBool                   iDatabaseChanged[3];
       
    82     RArray<CImageData*>&    iImageDataList;    
       
    83     TGridMode               iGridMode;
       
    84     RCriticalSection        iCritical;
       
    85     };
       
    86 
       
    87 #endif //__IEIMAGELIST_H_
       
    88 
       
    89 // End of File