mmmw_plat/telephony_multimedia_service_api/inc/tmsglobalvoleffect.h
changeset 0 71ca22bcf22a
child 12 2eb3b066cc7d
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     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:
       
    13  *
       
    14  * Description: Telephony Multimedia Service
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef TMS_GLOBAL_VOL_EFFECT_H
       
    19 #define TMS_GLOBAL_VOL_EFFECT_H
       
    20 
       
    21 #include <tms.h>
       
    22 #include <tmseffect.h>
       
    23 
       
    24 namespace TMS {
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class TMSGlobalVolEffectBody;
       
    28 class TMSEffectObserver;
       
    29 
       
    30 /**
       
    31  * TMSGlobalVolEffect class
       
    32  *
       
    33  * This class provides volume level control in the global TMS scope. Volume
       
    34  * level changes done by any client are adjusted accross all calls serviced
       
    35  * by the TMS server.
       
    36  *
       
    37  * @lib tmsapi.lib
       
    38  *
       
    39  */
       
    40 class TMSGlobalVolEffect : public TMSEffect
       
    41     {
       
    42 public:
       
    43     /**
       
    44      * Destructor
       
    45      */
       
    46     IMPORT_C virtual ~TMSGlobalVolEffect();
       
    47 
       
    48     /**
       
    49      * Add client as an observer to events generated by this effect object.
       
    50      *
       
    51      * This function can be called at any time. It is recommended adding the
       
    52      * observer before calling any functions on the Effect. Otherwise, the
       
    53      * observer may miss a callback.
       
    54      *
       
    55      * A reference to the obsrvr is stored in the effect. EffectsEvent callback
       
    56      * will be called when an effect event occurs. When effect is deleted, all
       
    57      * TMSEffectObserver references are automatically released. The ownership of
       
    58      * the obsrvr is still maintained by the client. Should the client need to
       
    59      * delete the obsrvr before deleting the effect, it should remove the obsrvr
       
    60      * reference from the effect by calling RemoveObserver() function.
       
    61      *
       
    62      * @param  obsrvr
       
    63      *      Listener to be added to the effect.
       
    64      *
       
    65      * @param  user_data
       
    66      *      Any user data passed to the function.
       
    67      *
       
    68      * @return
       
    69      *      TMS_RESULT_SUCCESS if the obsrvr is added to the list successfully.
       
    70      *      TMS_RESULT_ALREADY_EXIST if the obsrvr is already in the list.
       
    71      *
       
    72      */
       
    73     IMPORT_C gint AddObserver(TMSEffectObserver& obsrvr, gpointer user_data);
       
    74 
       
    75     /**
       
    76      * Remove client observer from the Effect.
       
    77      *
       
    78      * This function can be called at any time.
       
    79      *
       
    80      * @param  obsrvr
       
    81      *      Listener to be removed from the effect.
       
    82      *
       
    83      * @return
       
    84      *      TMS_RESULT_SUCCESS if the obsrvr is successfully removed.
       
    85      *      TMS_RESULT_DOES_NOT_EXIST if trying to remove the obsrvr that has
       
    86      *      not been added to the list.
       
    87      *
       
    88      */
       
    89     IMPORT_C gint RemoveObserver(TMSEffectObserver& obsrvr);
       
    90 
       
    91     /**
       
    92      * Set global audio volume level. The volume level should be between 0
       
    93      * and the max value returned by GetMaxLevel().
       
    94      *
       
    95      * @param  level
       
    96      *      the volume level to be set.
       
    97      * @return
       
    98      *      TMS_RESULT_SUCCESS if the operation was successful.
       
    99      */
       
   100     IMPORT_C gint SetLevel(const guint level);
       
   101 
       
   102     /**
       
   103      * Return current global audio volume level.
       
   104      *
       
   105      * @param  level
       
   106      *      Volume level to be set.
       
   107      *
       
   108      * @return
       
   109      *      TMS_RESULT_SUCCESS if the operation was successful.
       
   110      *
       
   111      */
       
   112     IMPORT_C gint GetLevel(guint& level);
       
   113 
       
   114     /**
       
   115      * Return max volume level supported by the device.
       
   116      *
       
   117      * @param  level
       
   118      *      Max volume level.
       
   119      *
       
   120      * @return
       
   121      *      TMS_RESULT_SUCCESS if the operation was successful.
       
   122      *
       
   123      */
       
   124     IMPORT_C gint GetMaxLevel(guint& level);
       
   125 
       
   126     /**
       
   127      * Return effect type.
       
   128      *
       
   129      * @param  effecttype
       
   130      *      Type of the effect object (TMS_EFFECT_GLOBAL_VOL).
       
   131      *
       
   132      * @return
       
   133      *      TMS_RESULT_SUCCESS if the operation was successful.
       
   134      *
       
   135      */
       
   136     IMPORT_C virtual gint GetType(TMSEffectType& effecttype);
       
   137 
       
   138 protected:
       
   139     /**
       
   140      * Constructor
       
   141      */
       
   142     IMPORT_C TMSGlobalVolEffect();
       
   143 
       
   144 protected:
       
   145     TMSGlobalVolEffectBody *iBody;
       
   146     };
       
   147 
       
   148 } //namespace TMS
       
   149 
       
   150 #endif //TMS_GLOBAL_VOL_EFFECT_H