scrsaver/scrsaverplugins/SlideshowPlugin/inc/SlideshowSlide.h
branchRCL_3
changeset 26 e8d784ac1a4b
parent 0 040fcad49f44
equal deleted inserted replaced
25:aaeeca1f15af 26:e8d784ac1a4b
       
     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:   Stores a single slide
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_SLIDESHOWSLIDE_H
       
    21 #define C_SLIDESHOWSLIDE_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>  // e32def, e32std
       
    25 #include <e32cmn.h>
       
    26 #include <fbs.h>
       
    27 
       
    28 #include "SlideshowSlideLoader.h"
       
    29 
       
    30 //  CONSTANTS
       
    31 
       
    32 // Leave code when a slide is on memory card and the card is not present
       
    33 const TInt KSSTryLater = (-100);
       
    34 
       
    35 //  MACROS
       
    36 
       
    37 // Item flags
       
    38 #define SSS_NONE        	0x00
       
    39 #define SSS_IMAGELOADED 	0x01
       
    40 #define SSS_ISONMC      	0x02
       
    41 #define SSS_DECODEFAILED    0x04
       
    42 
       
    43 
       
    44 //  DATA TYPES  
       
    45 
       
    46 //  EXTERNAL DATA STRUCTURES  
       
    47 
       
    48 //  FUNCTION PROTOTYPES
       
    49 
       
    50 //  FORWARD DECLARATIONS
       
    51 
       
    52 //  CLASS DEFINITIONS 
       
    53 class CSlideshowSlide : public CBase
       
    54     {
       
    55 public:
       
    56     // Creator
       
    57     static CSlideshowSlide* NewL(TDesC& aFileName, TBool aIsOnMC = EFalse);
       
    58 
       
    59     // Destructor
       
    60     virtual ~CSlideshowSlide();
       
    61       
       
    62     // Is decoding is in progress
       
    63     TBool IsDecodingInProgress();
       
    64     
       
    65     // Could not decode the file
       
    66     TBool CouldNotDecodeFile();
       
    67     
       
    68     //
       
    69     friend class CSlideshowSlideLoader;
       
    70 private:
       
    71 
       
    72     // Default constructor
       
    73     CSlideshowSlide(TBool aIsOnMC);
       
    74 
       
    75     // 2-phase
       
    76     void ConstructL(TDesC& aFileName);
       
    77 
       
    78 public:
       
    79 
       
    80     // Prepares slide (loads image)
       
    81     void PrepareSlideL(const TSize& aTargetSize);
       
    82 
       
    83     // Get image
       
    84     CFbsBitmap* Image() const { return iImage; }
       
    85 
       
    86     // Get filename
       
    87     HBufC* FileName() const { return iFileName; }
       
    88     
       
    89     // Release image
       
    90     void ReleaseImage();
       
    91     
       
    92     // Get flags
       
    93     TInt Flags() const { return iFlags; }
       
    94     
       
    95     // Is slide decoded completely
       
    96     TBool IsSlideDecoded();
       
    97     
       
    98 protected:
       
    99 	//Empty
       
   100 private:
       
   101     // Type flags
       
   102     TInt iFlags;
       
   103 
       
   104     // Image
       
   105     CFbsBitmap* iImage; 
       
   106 
       
   107     // Filename
       
   108     HBufC* iFileName;
       
   109     CSlideshowSlideLoader *iSlideLoader;
       
   110     };
       
   111 
       
   112 #endif  // C_SLIDESHOWSLIDE_H