os/mm/devsoundextensions/restrictedaudiooutput/RestrictedAudioOutputBase/inc/RestrictedAudioOutputImpl.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/devsoundextensions/restrictedaudiooutput/RestrictedAudioOutputBase/inc/RestrictedAudioOutputImpl.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,152 @@
     1.4 +/*
     1.5 +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: Restricted Audio Output Api Implementation  
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef RESTRICTEDAUDIOOUTPUTIMPL_H
    1.23 +#define RESTRICTEDAUDIOOUTPUTIMPL_H
    1.24 +
    1.25 +
    1.26 +#include "RestrictedAudioOutputImpl.h"
    1.27 +#include <RestrictedAudioOutput.h>
    1.28 +
    1.29 +
    1.30 +/**
    1.31 + * CRestrictedAudioOutputImpl class documentation.
    1.32 + *
    1.33 + * @lib RestrictedAudioOutput.lib
    1.34 + *
    1.35 + * @since S60 5.0 
    1.36 + */
    1.37 +class CRestrictedAudioOutputImpl : public CBase
    1.38 +	{
    1.39 +
    1.40 +public:
    1.41 +        
    1.42 +	// Constructors and destructor
    1.43 +
    1.44 +    /**
    1.45 +     * Constructs, and returns a pointer to, a new CBody object.
    1.46 +     * Leaves on failure..
    1.47 +     * @return CBody* A pointer to newly created object.
    1.48 +     */
    1.49 +     static CRestrictedAudioOutputImpl* NewL();
    1.50 +
    1.51 +
    1.52 +    /**
    1.53 +     * Destructor
    1.54 +     *
    1.55 +     */
    1.56 +    ~CRestrictedAudioOutputImpl();
    1.57 +
    1.58 +    /**
    1.59 +     * Appends an allowed output to the existing list.
    1.60 +     *
    1.61 +     * @param aOutput to be appended.
    1.62 +     * @return KErrNone if successful. KErrAlreadyExists if aOutput is already
    1.63 +     *  appended before. KErrIncompleteInitialization if ConstructL is not called
    1.64 +     *  by the deriving class. Otherwise any systemwide error code.
    1.65 +     */
    1.66 +    TInt AppendAllowedOutput( CRestrictedAudioOutput::TAllowedOutputPreference aOutput );
    1.67 +
    1.68 +    /**
    1.69 +     * Removes an allowed output from the existing list.
    1.70 +     *
    1.71 +     * @param The position within the array from where the object is to be
    1.72 +     * removed. The position is relative to zero, i.e. zero implies that an
    1.73 +     * object at the beginning of the array is to be removed.
    1.74 +     *
    1.75 +     * @return KErrNone if successful. KErrNotFound if aOutput is not in the
    1.76 +     *  the list. KErrIncompleteInitialization if ConstructL is not called
    1.77 +     *  by the deriving class. Otherwise any systemwide error code.
    1.78 +     */
    1.79 +    TInt RemoveAllowedOutput( CRestrictedAudioOutput::TAllowedOutputPreference aOutput );
    1.80 +
    1.81 +    /**
    1.82 +     * Gets a reference to an allowed output located at a specified position
    1.83 +     * within the list.
    1.84 +     *
    1.85 +     * @param The position within the array from where the object is to be
    1.86 +     * removed. The position is relative to zero, i.e. zero implies that an
    1.87 +     * object at the beginning of the array is to be removed.
    1.88 +     *
    1.89 +     * @param The position within the array from where the object is to be
    1.90 +     * removed. The position is relative to zero, i.e. zero implies that an
    1.91 +     * object at the beginning of the array is to be removed.
    1.92 +     *
    1.93 +     * @param A const reference to the object at position anIndex within the
    1.94 +     * list.
    1.95 +     *
    1.96 +     * @return KErrNone if successful. KErrNotFound if index is not in the
    1.97 +     *  the list. KErrIncompleteInitialization if ConstructL is not called
    1.98 +     *  by the deriving class. Otherwise any systemwide error code.
    1.99 +     */
   1.100 +    TInt GetAllowedOutput( TInt aIndex, CRestrictedAudioOutput::TAllowedOutputPreference& aOutput  );
   1.101 +
   1.102 +    /**
   1.103 +     * Gets the number of objects in the array.
   1.104 +     *
   1.105 +     * @param On successful return will contain the number of objects in
   1.106 +     * the list.
   1.107 +     *
   1.108 +     * @return KErrIncompleteInitialization if ConstructL is not called
   1.109 +     *  by the deriving class. Otherwise a system wide error code.
   1.110 +     */
   1.111 +    TInt GetAllowedOutputCount( TInt& aSize );
   1.112 +
   1.113 +    /**
   1.114 +     * Empties the list, so that it is ready to be reused.
   1.115 +     *
   1.116 +     *
   1.117 +     * @return KErrNone if successful. KErrIncompleteInitialization if ConstructL
   1.118 +     *  is not called by the deriving class.
   1.119 +     */
   1.120 +    TInt Reset();
   1.121 +
   1.122 +    /**
   1.123 +     * Applies settings cached locally and commits.
   1.124 +     *
   1.125 +     * @return KErrNone if successful.
   1.126 +     */
   1.127 +    TInt Commit();
   1.128 +    
   1.129 +    private:
   1.130 +
   1.131 +        /**
   1.132 +        * C++ default constructor.
   1.133 +        */
   1.134 +        CRestrictedAudioOutputImpl();
   1.135 +
   1.136 +        /**
   1.137 +        * By default Symbian 2nd phase constructor is private.
   1.138 +        */
   1.139 +        static void ConstructL();
   1.140 +  
   1.141 +		TBool ExistsInArray(CRestrictedAudioOutput::TAllowedOutputPreference& aOutput);        
   1.142 +        
   1.143 +	// Data:
   1.144 +	
   1.145 +
   1.146 +    private:    // Friend classes
   1.147 +           friend class CRestrictedAudioOutput;
   1.148 +      
   1.149 +		RArray<CRestrictedAudioOutput::TAllowedOutputPreference> iAllowedOutputPrefArray; 		
   1.150 +
   1.151 +	};
   1.152 +
   1.153 +#endif // RESITRCTEDAUDIOOUTPUTIMPL_H
   1.154 +
   1.155 +// End of file