mmmw_plat/telephony_multimedia_service_api/inc/tmsringtone.h
changeset 12 5a06f39ad45b
child 20 b67dd1fc57c5
equal deleted inserted replaced
0:71ca22bcf22a 12:5a06f39ad45b
       
     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_RINGTONE_H
       
    19 #define TMS_RINGTONE_H
       
    20 
       
    21 #include <tms.h>
       
    22 
       
    23 namespace TMS {
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class TMSRingToneImpl;
       
    27 class TMSRingToneBody;
       
    28 class TMSRingToneObserver;
       
    29 
       
    30 /**
       
    31  * TMSRingTone class
       
    32  *
       
    33  * This class provides ring tone playback capability to the TMS clients.
       
    34  *
       
    35  * @lib tmsapi.lib
       
    36  *
       
    37  */
       
    38 class TMSRingTone
       
    39     {
       
    40 public:
       
    41     /**
       
    42      * Destructor
       
    43      */
       
    44     IMPORT_C virtual ~TMSRingTone();
       
    45 
       
    46     /**
       
    47      * Add client as an observer to TMSRingTone events.
       
    48      *
       
    49      * @param  obsrvr
       
    50      *      Observer object to TMSRingTone events.
       
    51      *
       
    52      * @param  user_data
       
    53      *      Any user data passed to the function.
       
    54      *
       
    55      * @return
       
    56      *      TMS_RESULT_SUCCESS if the operation was successful.
       
    57      *      TMS_RESULT_ALREADY_EXIST if the obsrvr is already in the list.
       
    58      *
       
    59      */
       
    60     IMPORT_C gint AddObserver(TMSRingToneObserver& obsrvr, gpointer user_data);
       
    61 
       
    62     /**
       
    63      * Remove client as an observer to TMSRingTone events.
       
    64      *
       
    65      * @param  obsrvr
       
    66      *      Observer object to TMSRingTone events.
       
    67      *
       
    68      * @return
       
    69      *      TMS_RESULT_SUCCESS if the obsrvr is removed successfully from list.
       
    70      *      TMS_RESULT_DOES_NOT_EXIST if obsrvr is not already in the list.
       
    71      *
       
    72      */
       
    73     IMPORT_C gint RemoveObserver(TMSRingToneObserver& obsrvr);
       
    74 
       
    75     /**
       
    76      * Init ring tone player to play supplied content based on its type.
       
    77      *
       
    78      * @param  type
       
    79      *      Type of the content descriptor. Allowed types:
       
    80      *          - TMS_RINGTONE_DEFAULT - use RT from current Profile
       
    81      *          - TMS_RINGTONE_FILE  - A/V File
       
    82      *          - TMS_RINGTONE_SEQUENCE - RNG sequence in the descriptor format
       
    83      *          - TMS_RINGTONE_BEEP_ONCE - play a beep
       
    84      *          - TMS_RINGTONE_SILENT - play silent tone
       
    85      *          - TMS_RINGTONE_UNSECURE_VOIP - play tone for uncecure VoIP call
       
    86      *
       
    87      * @param  str
       
    88      *      Content descriptor to play. String containing one of the following:
       
    89      *          - File with folder name
       
    90      *          - Nokia ring tone sequence in a descriptor format
       
    91      *          - NULL - Will use current Profile.
       
    92      *
       
    93      * @param  tts
       
    94      *      Text to be played. When added it will be played along with the
       
    95      *      tone. TTS can only be played with TMS_RINGTONE_DEFAULT and
       
    96      *      TMS_RINGTONE_FILE. Parameter will be ignored for all other types.
       
    97      *          - NULL - Will use current Profile TTS setting - caller's name
       
    98      *            will be played from the phone book (if available).
       
    99      *
       
   100      * @return
       
   101      *      TMS_RESULT_SUCCESS if the operation was successful.
       
   102      *
       
   103      */
       
   104     IMPORT_C gint Init(const TMSRingToneType type = TMS_RINGTONE_DEFAULT,
       
   105             GString* str = NULL, GString* tts = NULL);
       
   106 
       
   107     /**
       
   108      * Deinit ring tone player.
       
   109      *
       
   110      * @return
       
   111      *      TMS_RESULT_SUCCESS if the operation was successful.
       
   112      *
       
   113      */
       
   114     IMPORT_C gint Deinit();
       
   115 
       
   116     /**
       
   117      * Start ring tone playback.
       
   118      *
       
   119      * @return
       
   120      *      TMS_RESULT_SUCCESS if the operation was successful.
       
   121      *
       
   122      */
       
   123     IMPORT_C gint Play();
       
   124 
       
   125     /**
       
   126      * Stop ring tone playback.
       
   127      *
       
   128      * @return
       
   129      *      TMS_RESULT_SUCCESS if the operation was successful.
       
   130      *
       
   131      */
       
   132     IMPORT_C gint Stop();
       
   133 
       
   134     /**
       
   135      * Pause ring tone playback.
       
   136      *
       
   137      * @return
       
   138      *      TMS_RESULT_SUCCESS if the operation was successful.
       
   139      *
       
   140      */
       
   141     IMPORT_C gint Pause();
       
   142 
       
   143     /**
       
   144      * Mute ring tone playback.
       
   145      *
       
   146      * @return
       
   147      *      TMS_RESULT_SUCCESS if the operation was successful.
       
   148      *
       
   149      */
       
   150     IMPORT_C gint Mute();
       
   151 
       
   152 protected:
       
   153     /**
       
   154      * Constructor
       
   155      */
       
   156     IMPORT_C TMSRingTone();
       
   157 
       
   158 protected:
       
   159     TMSRingToneBody *iBody;
       
   160     };
       
   161 
       
   162 } //namespace TMS
       
   163 
       
   164 #endif //TMS_RINGTONE_H
       
   165 
       
   166 // End of file
       
   167