gsprofilesrv_plat/filelist_api/inc/CFLDFileListContainer.h
branchRCL_3
changeset 24 8ee96d21d9bf
parent 23 8bda91a87a00
child 25 7e0eff37aedb
equal deleted inserted replaced
23:8bda91a87a00 24:8ee96d21d9bf
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     FileListContainer owns the list box, the model, and the controller,
       
    16 *     and it is used to launch the popup list.
       
    17 *
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 #ifndef __CFLDFILELISTCONTAINER_H__
       
    24 #define __CFLDFILELISTCONTAINER_H__
       
    25 
       
    26 // INTERNAL INCLUDES
       
    27 
       
    28 // EXTERNAL INCLUDES
       
    29 #include <e32base.h>
       
    30 #include <DRMHelper.h>
       
    31 #include <bamdesca.h>
       
    32 #include <CLFContentListing.hrh>
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CFLDDRMImplementation;
       
    36 class CFLDFileListModel;
       
    37 class CFLDController;
       
    38 
       
    39 //  CLASS DECLARATION
       
    40 /**
       
    41 * FileListContainer owns the list box, the model, and the controller,
       
    42 * and it is used to launch the popup list.
       
    43 *
       
    44 * @lib filelist.lib
       
    45 * @since 2.1
       
    46 */
       
    47 class   CFLDFileListContainer
       
    48     : public CBase
       
    49     {
       
    50     public:     // Constructors and destructors
       
    51 
       
    52 	    /**
       
    53         * Two-phase static constructor
       
    54         * @return A pointer to a fully constructed CFLDFileListContainer instance
       
    55         */
       
    56         IMPORT_C static CFLDFileListContainer* NewL();
       
    57 
       
    58 		/**
       
    59 		* Two-phase static constructor
       
    60 		* @return A pointer to a fully constructed CFLDFileListContainer instance.
       
    61 		*/
       
    62         IMPORT_C static CFLDFileListContainer* NewLC();
       
    63     
       
    64         /**
       
    65         * Two-phase static constructor
       
    66         * @param aResourceId A CLF model resource, see CLFContentListing.rh
       
    67         * @return A pointer to a fully constructed CFLDFileListContainer instance
       
    68         */
       
    69         IMPORT_C static CFLDFileListContainer* NewL(
       
    70 			const TInt aResourceId );
       
    71 
       
    72         /**
       
    73         * Two-phase static constructor
       
    74         * @param aResourceId A CLF model resource, see CLFContentListing.rh
       
    75         * @return A pointer to a fully constructed CFLDFileListContainer instance.
       
    76         */
       
    77         IMPORT_C static CFLDFileListContainer* NewLC(
       
    78 			const TInt aResourceId );
       
    79 			
       
    80 		/**
       
    81         * Two-phase static constructor
       
    82         * @param aResourceId A CLF model resource, see CLFContentListing.rh
       
    83         * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES
       
    84         * structure, see FileListModel.rh for details
       
    85         * @return A pointer to a fully constructed CFLDFileListContainer instance
       
    86         */
       
    87         IMPORT_C static CFLDFileListContainer* NewL(
       
    88 			const TInt aResourceId, const TInt aDirectoriesResourceId );
       
    89 
       
    90        /**
       
    91         * Two-phase static constructor
       
    92         * @param aResourceId A CLF model resource, see CLFContentListing.rh
       
    93         * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES
       
    94         * structure, see FileListModel.rh for details
       
    95         * @return A pointer to a fully constructed CFLDFileListContainer instance
       
    96         */
       
    97         IMPORT_C static CFLDFileListContainer* NewLC(
       
    98 			const TInt aResourceId, const TInt aDirectoriesResourceId );			
       
    99 
       
   100         /**
       
   101         * Destructor
       
   102         */
       
   103         IMPORT_C virtual ~CFLDFileListContainer();
       
   104 
       
   105     private:  // Constructors and destructors
       
   106 
       
   107         /**
       
   108         * Constructor
       
   109         */
       
   110         CFLDFileListContainer();
       
   111 
       
   112         /**
       
   113         * Second phase constructor
       
   114         * @param aResourceId A CLF model resource, see CLFContentListing.rh
       
   115         * @param aDirectoriesResourceId A resource using FILELISTDIRECTORIES
       
   116         * structure, see FileListModel.rh for details
       
   117         */
       
   118         void ConstructL(
       
   119          const TInt aResourceId, const TInt aDirectoriesResourceId );
       
   120 
       
   121     public:     // New methods
       
   122 
       
   123 		/**
       
   124         * Set the automated content type
       
   125         * @param  aAutomatedType: type of automated content
       
   126         */
       
   127         IMPORT_C void SetAutomatedType(
       
   128          CDRMHelper::TDRMHelperAutomatedType aAutomatedType );
       
   129          
       
   130         /**
       
   131         * Launches a popup list for browsing files
       
   132         * @param aFileName The selected file name will be stored here. If the selected
       
   133         *        item was not a file but a null text item, aFileName will contain KNullDesC.
       
   134         *        If aFileName contains something already, CFLDFileListContainer tries to find
       
   135         *        the name on the list and focus on it.
       
   136         *        NOTE: Size of aFileName must be KMaxFileName, otherwise KErrNotFound is
       
   137         *		 returned (aFileName is compared against TFileName entities).
       
   138         * @param aPopupTitle If this parameter is given, sets the title text of the popup
       
   139         * @return True: User selected a file, and its name is stored in aFileName.
       
   140         *         False: No file selected because user pressed cancel.
       
   141         */
       
   142         IMPORT_C TBool LaunchL( TDes& aFileName, const TDesC& aPopupTitle = KNullDesC );
       
   143 
       
   144         /**
       
   145         * Adds a text (e.g. "None") as the first item of the list,
       
   146         * which will not be sorted among the file name items.
       
   147         * @param aItemText A descriptor containing the null item text
       
   148         */
       
   149         IMPORT_C void InsertNullItemL( const TDesC& aItemText );
       
   150 
       
   151         /**
       
   152         * Adds a text (e.g. "None") as the first item of the list,
       
   153         * which will not be sorted among the file name items.
       
   154         * @param aItemText A descriptor containing the null item text
       
   155         * @param aFileName A descriptor containing the ringing tone file name for null item
       
   156         */
       
   157         IMPORT_C void InsertNullItemL( const TDesC& aItemText, const TDesC& aFileName );
       
   158 
       
   159         /**
       
   160         * Adds a text (e.g. "None") as the last item of the list,
       
   161         * which will not be sorted among the file name items.
       
   162         * @param aItemText A descriptor containing the null item text
       
   163         */
       
   164         IMPORT_C void InsertEndNullItemL( const TDesC& aItemText );
       
   165 
       
   166         /**
       
   167         * Adds a text (e.g. "None") as the last item of the list,
       
   168         * which will not be sorted among the file name items.
       
   169         * @param aItemText A descriptor containing the null item text
       
   170         * @param aFileName A descriptor containing the ringing tone file name for null item
       
   171         */
       
   172         IMPORT_C void InsertEndNullItemL( const TDesC& aItemText, const TDesC& aFileName );
       
   173 
       
   174         /**
       
   175         * Set the delay until the timer expires.
       
   176         * @param aDelay The delay in microseconds
       
   177         */
       
   178         IMPORT_C void SetDelay( TTimeIntervalMicroSeconds32 aDelay );
       
   179 
       
   180         /**
       
   181          * Set the volume level on which the sound is played.
       
   182          * If this method is not called, toneplayer uses the setting in active profile.
       
   183          * @param aVolume The volume level
       
   184          */
       
   185         IMPORT_C void SetVolume( TInt aVolume );
       
   186 
       
   187         /**
       
   188          * Sets the ringing type
       
   189          * If this method is not called, toneplayer uses the setting in active profile.
       
   190          * @param aRingingType The ringing type (see CFLDRingingTonePlayer::TRingingTypes)
       
   191          */
       
   192         IMPORT_C void SetRingingType( TInt aRingingType );
       
   193 
       
   194         /**
       
   195         * Sets vibrating alert on or off.
       
   196         * If this method is not called, toneplayer uses the setting in active profile.
       
   197         * @param aVibra True: Vibra is on. False: Vibra is off.
       
   198         */
       
   199         IMPORT_C void SetVibra( TBool aVibra );
       
   200 
       
   201         /**
       
   202         * Adds a new MIME type into blocking list.
       
   203         * @param aMimeType The blocked MIME type
       
   204         */
       
   205     	IMPORT_C void AddExclusiveMimeTypeL( const TDesC& aMimeType );
       
   206 
       
   207     	/**
       
   208         * Adds a new media type into blocking list.
       
   209         * @param aMediaType The blocked media type (see TCLFMediaType enumeration
       
   210         * inside CFLContentListing.hrh)
       
   211         */
       
   212     	IMPORT_C void AddExclusiveMediaTypeL( const TInt32 aMediaType );
       
   213 
       
   214     	/**
       
   215         * Sets wanted mime types. Overrides all settings defined inside
       
   216         * resource, defined with AddExclusive -methods or with
       
   217         * SetWanted -methods.
       
   218         * @param aMimeTypes The array containing wanted MIME types
       
   219         */
       
   220     	IMPORT_C void SetWantedMimeTypesL( const MDesCArray& aMimeTypes );
       
   221 
       
   222      	/**
       
   223         * Sets wanted media types. Overrides all settings defined inside
       
   224         * resource, defined with AddExclusive -methods or with
       
   225         * SetWanted -methods.
       
   226         * @param aMediaTypes The array containing wanted media types
       
   227         */
       
   228     	IMPORT_C void SetWantedMediaTypesL( const TArray<TCLFMediaType>& aMediaTypes );
       
   229 
       
   230     	/**
       
   231         * Removes all the defined exlusive MIME types
       
   232         */
       
   233     	IMPORT_C void ResetExclusiveMimeTypes();
       
   234 
       
   235     	/**
       
   236         * Removes all the defined exlusive media types
       
   237         */
       
   238     	IMPORT_C void ResetExclusiveMediaTypes();
       
   239     	
       
   240     	/**
       
   241         * Sets the maximum file size for the list.
       
   242         * @param aMaxFileSize The maximum file size in bytes. If you want to
       
   243         *        allow all file sizes, set this to KFLDNoSizeFiltering
       
   244         *        (defined in FileListModel.hrh).
       
   245         * @since 3.1
       
   246         */
       
   247         IMPORT_C void SetMaxFileSize( const TInt aMaxFileSize );
       
   248         
       
   249          /**
       
   250         * Sets 3d-effects on or off.
       
   251         * If this method is called using parameter EFalse 3d-effects are 
       
   252         * always disabled even though those are set in active profile.
       
   253         * Otherwise toneplayer uses the setting in active profile.
       
   254         * @param a3dEffects True: 3dEffects are on. False: 3dEffects are off.
       
   255         */
       
   256         IMPORT_C void Set3dEffects( TBool a3dEffects );
       
   257 
       
   258     private:    // Data
       
   259 
       
   260         /// Own: The file list model
       
   261         CFLDFileListModel* iModel;
       
   262 
       
   263         /// Own: The controller
       
   264         CFLDController* iController;
       
   265 
       
   266 		/// Own: DRM implementation
       
   267 		CFLDDRMImplementation* iDRMImplementation;
       
   268 		
       
   269 		/// Resourceloader which loads used resources
       
   270        	RConeResourceLoader iResourceLoader;
       
   271 
       
   272     };
       
   273 
       
   274 #endif      //  __CFLDFILELISTCONTAINER_H__
       
   275 
       
   276 // End of File