psln/PslnLibraryLoaders/inc/pslnprofilesettingsloader.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  Loads ProfileSettingsView.dll dynamically.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_PSLNPROFILESETTINGSLOADER
       
    20 #define C_PSLNPROFILESETTINGSLOADER
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class MProfileEngineExtended;
       
    25 class MProfileExtended;
       
    26 class CDRMHelper;
       
    27 /**
       
    28 *  Interface class for profile settings view.
       
    29 *  
       
    30 *  @lib PslnProfileSettingsLoader.lib
       
    31 *  @since Series 60 3.1
       
    32 */
       
    33 class MPslnProfileSettingsLoader
       
    34     {
       
    35     public:
       
    36 
       
    37         /**
       
    38         * Pure virtual method for setting ringing tone for all profiles.
       
    39         * @param aType type of tone (actual ringing tone, or message alert tone).
       
    40         * @param aFullName full filename (inc. path) of tone.
       
    41         */
       
    42         virtual void SetToneForProfilesL( TInt aType, TDes& aFullName ) = 0;
       
    43 
       
    44         /**
       
    45         * Pure virtual method for indicating to the media gallery that 
       
    46         * there is new sound file available in the gallery.
       
    47         * @param aFullPath path and file of the new sound file..
       
    48         */
       
    49         virtual void IndicateFileUpdationL( const TDesC& aFullPath ) = 0;
       
    50     };
       
    51 
       
    52 /**
       
    53 *  This class is for dynamically loading ProfilesSettingsView.dll that 
       
    54 *  enables setting of ringing tone for all profiles.
       
    55 *
       
    56 *  @lib PslnProfileSettingsLoader.lib
       
    57 *  @since Series 60 3.1
       
    58 */
       
    59 class CPslnProfileSettingsLoader : public CBase, 
       
    60                                    public MPslnProfileSettingsLoader
       
    61     {
       
    62 public:
       
    63     /**
       
    64     * Two-phased constructor.
       
    65     * @return new instance of CPslnProfileSettingsLoader.
       
    66     */
       
    67     static CPslnProfileSettingsLoader* NewL();
       
    68 
       
    69     /**
       
    70     * Destructor.
       
    71     */
       
    72     virtual ~CPslnProfileSettingsLoader();
       
    73 
       
    74     /**
       
    75     * Sets tone for all profiles.
       
    76     * @param aType type of tone (actual ringing tone, or message alert tone).
       
    77     * @param aFullName full filename (inc. path) of tone.
       
    78     */
       
    79     void SetToneForProfilesL( TInt aType, TDes& aFullName );
       
    80 
       
    81     /**
       
    82     * Indicates to the media gallery that there is new sound file 
       
    83     * available in the gallery.
       
    84     * @param aFullPath path and file of the new sound file.
       
    85     */
       
    86     void IndicateFileUpdationL( const TDesC& aFullPath );
       
    87 
       
    88 private:
       
    89 
       
    90     /**
       
    91     * C++ default constructor.
       
    92     */
       
    93     CPslnProfileSettingsLoader();
       
    94     
       
    95     /**
       
    96     * Stores the settings to Profiles Engine and adds the file to automated
       
    97     * content list and removes the old file from automated content list.
       
    98     * @param aProfileEngine The MProfileEngineExtended.
       
    99     * @param aProfileId The ID of the profile (NOT an index).
       
   100     * @param aType Identifies the tone which is updated.
       
   101     * @param aFileName Full path and filename of the tone to be used
       
   102     *                  as the new ringing or alert tone.
       
   103     */    
       
   104     void DoSetProfileToneL( MProfileEngineExtended* aProfileEngine, TInt aProfileId, 
       
   105     		TInt aType, const TDesC& aFileName );
       
   106     
       
   107     /**
       
   108     * Sets the tone to an MProfileExtended instance.
       
   109     * @param aProfile The MProfileExtended instance.
       
   110     * @param aType Identifies the tone which is updated.
       
   111     * @param aFileName The tone file name.
       
   112     */
       
   113     void SetToneL( MProfileExtended& aProfile,
       
   114     		TInt aType, const TDesC& aFileName );
       
   115     
       
   116     /**
       
   117     * Reads a tone setting from an MProfileExtended instance.
       
   118     * @param aProfile The MProfileExtended instance.
       
   119     * @param aType Identifies the tone which is read.
       
   120     * @return Returns the tone file name.
       
   121     */
       
   122     const TDesC& ToneL( MProfileExtended& aProfile,TInt aType );
       
   123     
       
   124     /**
       
   125     * Set Automated content
       
   126     * @param aDrmHelper Pointer to Drm helper.
       
   127     * @param aType Identifies the type the content.
       
   128     * @param aFileName Filename for the content.
       
   129     * @return Returns success/fail.
       
   130     */
       
   131     TInt SetAutomated( CDRMHelper* aDrmHelper,TInt aType,
       
   132     		const TDesC& aFileName );
       
   133     /**
       
   134     * Remove Automated content
       
   135     * @param aDrmHelper Pointer to Drm helper.
       
   136     * @param aFileName Filename for the content.
       
   137     */
       
   138     void RemoveAutomated( CDRMHelper* aDrmHelper,const TDesC& aFileName );
       
   139 
       
   140     
       
   141 private:
       
   142 
       
   143 #ifdef RD_CONTENTNOTIFICATION
       
   144     /**
       
   145     * Array of notification events.
       
   146     * Own.
       
   147     */
       
   148     CArrayFixFlat<CContentNotificationEvent*>* iEventArray;
       
   149 #endif // RD_CONTENTNOTIFICATION
       
   150     };
       
   151 
       
   152 // Environment gate function
       
   153 IMPORT_C TAny* GateFunction();
       
   154 
       
   155 #endif // C_PSLNPROFILESETTINGSLOADER
       
   156 
       
   157 // End of File