idlefw/tsrc/idleint/stubs/aknsoundsystem.h
branchRCL_3
changeset 27 2c7f27287390
equal deleted inserted replaced
25:9e077f9a342c 27:2c7f27287390
       
     1 /*
       
     2 * Copyright (c) 2010 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:  This is an interface for controlling keysounds.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #if !defined(__AKNSOUNDSYSTEM_H__)
       
    20 #define __AKNSOUNDSYSTEM_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <w32std.h>
       
    25 #include <aknSoundInfo.h>
       
    26 
       
    27 
       
    28 // CLASS DECLARATION
       
    29 class CAknSoundPlayer;
       
    30 class CAknKeySoundStack;
       
    31 
       
    32 /**
       
    33 *  This is an interface for controlling keysounds from Avkon.
       
    34 *  Provides support for handling key sounds.
       
    35 *  @since Series 60 0.9
       
    36 */
       
    37 NONSHARABLE_CLASS(CAknKeySoundSystem) : public CBase
       
    38 	{
       
    39 public:
       
    40 	/**
       
    41 	* Base class default constructor.
       
    42 	* @param aUid Application UID.
       
    43 	* @return A pointer to a new @c CAknKeySoundSystem object.
       
    44 	*/
       
    45 	static CAknKeySoundSystem* NewL(TInt /*aUid*/)
       
    46 	    {
       
    47 	    return new(ELeave) CAknKeySoundSystem();
       
    48 	    };
       
    49 	
       
    50 	/**
       
    51 	* Destructor.
       
    52 	*/
       
    53 	~CAknKeySoundSystem()
       
    54 	    {
       
    55 	    };
       
    56 	
       
    57 	/**
       
    58 	* Function reads resource data from resource file and push the context
       
    59 	* to the server session. The most common Avkon resources in this case are
       
    60 	* @c R_AVKON_DEFAULT_SOUND_LIST, @c R_AVKON_DEFAULT_SKEY_LIST and 
       
    61 	* @c R_AVKON_SILENT_SKEY_LIST.
       
    62 	* If a leave occurs the framework generates a Symbian Leave code.
       
    63 	* @param aResourceId Avkon resource ID.
       
    64 	*/
       
    65 	void PushContextL(TInt/* aResourceId*/)
       
    66 	    {
       
    67 	    };
       
    68 	
       
    69 	/**
       
    70 	* Pop the context from the server session object.
       
    71 	*/
       
    72 	void PopContext()
       
    73 	    {
       
    74 	    };
       
    75 	
       
    76 	/**
       
    77 	* This function plays key event sounds.
       
    78 	* @param aKeyEvent The scan code of the key that caused the event.
       
    79 	*/
       
    80 	void PlaySound(const TKeyEvent& /*aKeyEvent*/)
       
    81 	    {
       
    82 	    };
       
    83 		
       
    84 	/**
       
    85 	* This function plays sounds by sound ID.
       
    86 	* @param aSid Sound ID. These SID numbers are specified in Avkon 
       
    87 	* enum @c TAvkonSystemSID.
       
    88 	*/
       
    89 	void PlaySound(TInt /*aSid*/)
       
    90 	    {
       
    91 	    };
       
    92 	
       
    93 	/**
       
    94 	* Function reads resource data from resource file. And adds the
       
    95 	* application sound info list to the server session.
       
    96 	* If the leave occurs the framework generates a Symbian Leave code.
       
    97 	* @param aResourceId Avkon resource ID.
       
    98 	*/
       
    99 	void AddAppSoundInfoListL(TInt /*aResourceId*/)
       
   100 	    {
       
   101 	    };
       
   102 		
       
   103 	/**
       
   104 	* This function brings the sounds back to foreground. This function should
       
   105 	* be called from @c HandleForegroundEventL(). @c HandleForegroundEventL() is 
       
   106 	* implemented in @c CAknAppUi and it is reimplemented in @c CAknViewAppUi.
       
   107 	*/ 
       
   108 	void BringToForeground()
       
   109 	    {
       
   110 	    };
       
   111 
       
   112     /**
       
   113     * Stops playing the sound with given ID.
       
   114     * @param aSid Sound ID. Application defined SID's should be less than 1000.
       
   115     */
       
   116     void StopSound(TInt /*aSid*/)
       
   117         {
       
   118         };
       
   119 
       
   120     /**
       
   121     * Locks context.
       
   122     */
       
   123     void LockContext()
       
   124         {
       
   125         };
       
   126 
       
   127     /**
       
   128     * Releases context.
       
   129     */
       
   130     void ReleaseContext()
       
   131         {
       
   132         };
       
   133 
       
   134     /**
       
   135     * Reads sound information from certain given sound ID.
       
   136     * @since Series 60 2.0
       
   137     * @param aSid ID for sound which's information is requested.
       
   138     * @param aInfo Sound information will be put in this structure.
       
   139     * @return TInt Returns @c KErrNone if succesfull otherwise returns 
       
   140     * @c KErrNotFound if requested sound ID is not found.
       
   141     */
       
   142 	TInt RequestSoundInfoL(TInt /*aSid*/, CAknSoundInfo& /*aInfo*/)
       
   143 	    {
       
   144 	    return KErrNone;
       
   145 	    };
       
   146 
       
   147     /**
       
   148     * Returns top context id from the session.
       
   149     * 
       
   150     * @since 3.1
       
   151     * @return The resource id of the context that is at the top of the soundstack. 
       
   152     */
       
   153     TInt TopContext()
       
   154         {
       
   155         return KErrNone;
       
   156         };
       
   157 
       
   158 public://private:
       
   159 	CAknKeySoundSystem()
       
   160 	    {
       
   161 	    };
       
   162 	void ConstructL(TInt /*aUid*/)
       
   163 	    {
       
   164 	    };
       
   165 private:
       
   166 	//CAknSoundPlayer* iSoundPlayer;
       
   167 	//TInt iSpare;
       
   168 	};
       
   169 
       
   170 #endif // __AKNSOUNDSYSTEM_H__