os/mm/devsoundextensions/restrictedaudiooutput/RestrictedAudioOutputBase/inc/RestrictedAudioOutputImpl.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description: Restricted Audio Output Api Implementation  
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
#ifndef RESTRICTEDAUDIOOUTPUTIMPL_H
sl@0
    20
#define RESTRICTEDAUDIOOUTPUTIMPL_H
sl@0
    21
sl@0
    22
sl@0
    23
#include "RestrictedAudioOutputImpl.h"
sl@0
    24
#include <RestrictedAudioOutput.h>
sl@0
    25
sl@0
    26
sl@0
    27
/**
sl@0
    28
 * CRestrictedAudioOutputImpl class documentation.
sl@0
    29
 *
sl@0
    30
 * @lib RestrictedAudioOutput.lib
sl@0
    31
 *
sl@0
    32
 * @since S60 5.0 
sl@0
    33
 */
sl@0
    34
class CRestrictedAudioOutputImpl : public CBase
sl@0
    35
	{
sl@0
    36
sl@0
    37
public:
sl@0
    38
        
sl@0
    39
	// Constructors and destructor
sl@0
    40
sl@0
    41
    /**
sl@0
    42
     * Constructs, and returns a pointer to, a new CBody object.
sl@0
    43
     * Leaves on failure..
sl@0
    44
     * @return CBody* A pointer to newly created object.
sl@0
    45
     */
sl@0
    46
     static CRestrictedAudioOutputImpl* NewL();
sl@0
    47
sl@0
    48
sl@0
    49
    /**
sl@0
    50
     * Destructor
sl@0
    51
     *
sl@0
    52
     */
sl@0
    53
    ~CRestrictedAudioOutputImpl();
sl@0
    54
sl@0
    55
    /**
sl@0
    56
     * Appends an allowed output to the existing list.
sl@0
    57
     *
sl@0
    58
     * @param aOutput to be appended.
sl@0
    59
     * @return KErrNone if successful. KErrAlreadyExists if aOutput is already
sl@0
    60
     *  appended before. KErrIncompleteInitialization if ConstructL is not called
sl@0
    61
     *  by the deriving class. Otherwise any systemwide error code.
sl@0
    62
     */
sl@0
    63
    TInt AppendAllowedOutput( CRestrictedAudioOutput::TAllowedOutputPreference aOutput );
sl@0
    64
sl@0
    65
    /**
sl@0
    66
     * Removes an allowed output from the existing list.
sl@0
    67
     *
sl@0
    68
     * @param The position within the array from where the object is to be
sl@0
    69
     * removed. The position is relative to zero, i.e. zero implies that an
sl@0
    70
     * object at the beginning of the array is to be removed.
sl@0
    71
     *
sl@0
    72
     * @return KErrNone if successful. KErrNotFound if aOutput is not in the
sl@0
    73
     *  the list. KErrIncompleteInitialization if ConstructL is not called
sl@0
    74
     *  by the deriving class. Otherwise any systemwide error code.
sl@0
    75
     */
sl@0
    76
    TInt RemoveAllowedOutput( CRestrictedAudioOutput::TAllowedOutputPreference aOutput );
sl@0
    77
sl@0
    78
    /**
sl@0
    79
     * Gets a reference to an allowed output located at a specified position
sl@0
    80
     * within the list.
sl@0
    81
     *
sl@0
    82
     * @param The position within the array from where the object is to be
sl@0
    83
     * removed. The position is relative to zero, i.e. zero implies that an
sl@0
    84
     * object at the beginning of the array is to be removed.
sl@0
    85
     *
sl@0
    86
     * @param The position within the array from where the object is to be
sl@0
    87
     * removed. The position is relative to zero, i.e. zero implies that an
sl@0
    88
     * object at the beginning of the array is to be removed.
sl@0
    89
     *
sl@0
    90
     * @param A const reference to the object at position anIndex within the
sl@0
    91
     * list.
sl@0
    92
     *
sl@0
    93
     * @return KErrNone if successful. KErrNotFound if index is not in the
sl@0
    94
     *  the list. KErrIncompleteInitialization if ConstructL is not called
sl@0
    95
     *  by the deriving class. Otherwise any systemwide error code.
sl@0
    96
     */
sl@0
    97
    TInt GetAllowedOutput( TInt aIndex, CRestrictedAudioOutput::TAllowedOutputPreference& aOutput  );
sl@0
    98
sl@0
    99
    /**
sl@0
   100
     * Gets the number of objects in the array.
sl@0
   101
     *
sl@0
   102
     * @param On successful return will contain the number of objects in
sl@0
   103
     * the list.
sl@0
   104
     *
sl@0
   105
     * @return KErrIncompleteInitialization if ConstructL is not called
sl@0
   106
     *  by the deriving class. Otherwise a system wide error code.
sl@0
   107
     */
sl@0
   108
    TInt GetAllowedOutputCount( TInt& aSize );
sl@0
   109
sl@0
   110
    /**
sl@0
   111
     * Empties the list, so that it is ready to be reused.
sl@0
   112
     *
sl@0
   113
     *
sl@0
   114
     * @return KErrNone if successful. KErrIncompleteInitialization if ConstructL
sl@0
   115
     *  is not called by the deriving class.
sl@0
   116
     */
sl@0
   117
    TInt Reset();
sl@0
   118
sl@0
   119
    /**
sl@0
   120
     * Applies settings cached locally and commits.
sl@0
   121
     *
sl@0
   122
     * @return KErrNone if successful.
sl@0
   123
     */
sl@0
   124
    TInt Commit();
sl@0
   125
    
sl@0
   126
    private:
sl@0
   127
sl@0
   128
        /**
sl@0
   129
        * C++ default constructor.
sl@0
   130
        */
sl@0
   131
        CRestrictedAudioOutputImpl();
sl@0
   132
sl@0
   133
        /**
sl@0
   134
        * By default Symbian 2nd phase constructor is private.
sl@0
   135
        */
sl@0
   136
        static void ConstructL();
sl@0
   137
  
sl@0
   138
		TBool ExistsInArray(CRestrictedAudioOutput::TAllowedOutputPreference& aOutput);        
sl@0
   139
        
sl@0
   140
	// Data:
sl@0
   141
	
sl@0
   142
sl@0
   143
    private:    // Friend classes
sl@0
   144
           friend class CRestrictedAudioOutput;
sl@0
   145
      
sl@0
   146
		RArray<CRestrictedAudioOutput::TAllowedOutputPreference> iAllowedOutputPrefArray; 		
sl@0
   147
sl@0
   148
	};
sl@0
   149
sl@0
   150
#endif // RESITRCTEDAUDIOOUTPUTIMPL_H
sl@0
   151
sl@0
   152
// End of file