photosgallery/viewframework/medialists/inc/glxustringconverter.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:    UString converter implementation class that converts symbian data 
       
    15 *                types to UString types
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef GLXUSTRINGCONVERTER_H
       
    23 #define GLXUSTRINGCONVERTER_H                           
       
    24 
       
    25 #include "glxmedia.h"
       
    26 
       
    27 namespace osncore
       
    28     {
       
    29     //template <class T> class AlfPtrVector;  
       
    30     class UString;
       
    31     }
       
    32 using namespace osncore;
       
    33 
       
    34 // ================================================
       
    35 // DO NOT USE THIS CLASS IF NOT GLXDATAPROVIDER.DLL
       
    36 // ================================================
       
    37 //
       
    38 /**
       
    39  * CGlxUStringConverter class that converts the symbian types to UString type
       
    40  */
       
    41 
       
    42 NONSHARABLE_CLASS(CGlxUStringConverter): public CBase
       
    43 {
       
    44 public:
       
    45 
       
    46     /**
       
    47      * Constructor
       
    48      * @param aMedia The media object
       
    49      */
       
    50    
       
    51     CGlxUStringConverter();
       
    52     
       
    53     /**
       
    54      * Two phase construction
       
    55      * @param aMedia The media object
       
    56      */ 
       
    57     IMPORT_C static CGlxUStringConverter* NewL();
       
    58     
       
    59     /**
       
    60      * Two phase construction
       
    61      * @param aMedia The media object
       
    62      */
       
    63     static CGlxUStringConverter* NewLC();
       
    64 
       
    65     /**
       
    66      * The function that converts symbian types to UString
       
    67      * @param aMedia The media object
       
    68      * @param aAttribute The attribute used to extract the data to be converted
       
    69      * @param aFormatString Holds the information regarding the format in which data
       
    70      * should be.
       
    71      */
       
    72 	IMPORT_C void AsStringL(const TGlxMedia& aMedia, const TMPXAttribute& aAttribute, TInt aFormatString, HBufC*& aString ) const;
       
    73 	
       
    74 private:
       
    75     
       
    76     ~CGlxUStringConverter();
       
    77 
       
    78 	/**
       
    79      * Returns the item size in the required format
       
    80      */
       
    81 	void GetFormattedItemSizeL(const CGlxMedia& media, HBufC*& aString) const;
       
    82 	
       
    83 	/**
       
    84      * Returns the item location in the required format
       
    85      * @param aCoordinate holds the coordinate information
       
    86      */
       
    87 	void GetFormatLocationL( const TCoordinate& aCoordinate, HBufC*& aString )const;
       
    88 	
       
    89 	/**
       
    90      * Returns the item duration in the required format
       
    91      * @param aDuration holds the duration information
       
    92      */
       
    93 	void GetFormattedDurationL( const TReal& aDuration, HBufC*& aString ) const;
       
    94 	
       
    95 	/**
       
    96      * Returns the item resolution in the required format
       
    97      * @param aSize holds the resolution size information
       
    98      */
       
    99 	void GetFormatResolutionL( const TSize& aSize, HBufC*& aString ) const;
       
   100 	
       
   101 private:
       
   102 
       
   103    
       
   104 };
       
   105 
       
   106 #endif //GLXUSTRINGCONVERTER_H