|
1 /* |
|
2 * Copyright (c) 2007 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: Restricted Audio Output Api Implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef RESTRICTEDAUDIOOUTPUTIMPL_H |
|
20 #define RESTRICTEDAUDIOOUTPUTIMPL_H |
|
21 |
|
22 |
|
23 #include "RestrictedAudioOutputImpl.h" |
|
24 #include <RestrictedAudioOutput.h> |
|
25 |
|
26 |
|
27 /** |
|
28 * CRestrictedAudioOutputImpl class documentation. |
|
29 * |
|
30 * @lib RestrictedAudioOutput.lib |
|
31 * |
|
32 * @since S60 5.0 |
|
33 */ |
|
34 class CRestrictedAudioOutputImpl : public CBase |
|
35 { |
|
36 |
|
37 public: |
|
38 |
|
39 // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Constructs, and returns a pointer to, a new CBody object. |
|
43 * Leaves on failure.. |
|
44 * @return CBody* A pointer to newly created object. |
|
45 */ |
|
46 static CRestrictedAudioOutputImpl* NewL(); |
|
47 |
|
48 |
|
49 /** |
|
50 * Destructor |
|
51 * |
|
52 */ |
|
53 ~CRestrictedAudioOutputImpl(); |
|
54 |
|
55 /** |
|
56 * Appends an allowed output to the existing list. |
|
57 * |
|
58 * @param aOutput to be appended. |
|
59 * @return KErrNone if successful. KErrAlreadyExists if aOutput is already |
|
60 * appended before. KErrIncompleteInitialization if ConstructL is not called |
|
61 * by the deriving class. Otherwise any systemwide error code. |
|
62 */ |
|
63 TInt AppendAllowedOutput( CRestrictedAudioOutput::TAllowedOutputPreference aOutput ); |
|
64 |
|
65 /** |
|
66 * Removes an allowed output from the existing list. |
|
67 * |
|
68 * @param The position within the array from where the object is to be |
|
69 * removed. The position is relative to zero, i.e. zero implies that an |
|
70 * object at the beginning of the array is to be removed. |
|
71 * |
|
72 * @return KErrNone if successful. KErrNotFound if aOutput is not in the |
|
73 * the list. KErrIncompleteInitialization if ConstructL is not called |
|
74 * by the deriving class. Otherwise any systemwide error code. |
|
75 */ |
|
76 TInt RemoveAllowedOutput( CRestrictedAudioOutput::TAllowedOutputPreference aOutput ); |
|
77 |
|
78 /** |
|
79 * Gets a reference to an allowed output located at a specified position |
|
80 * within the list. |
|
81 * |
|
82 * @param The position within the array from where the object is to be |
|
83 * removed. The position is relative to zero, i.e. zero implies that an |
|
84 * object at the beginning of the array is to be removed. |
|
85 * |
|
86 * @param The position within the array from where the object is to be |
|
87 * removed. The position is relative to zero, i.e. zero implies that an |
|
88 * object at the beginning of the array is to be removed. |
|
89 * |
|
90 * @param A const reference to the object at position anIndex within the |
|
91 * list. |
|
92 * |
|
93 * @return KErrNone if successful. KErrNotFound if index is not in the |
|
94 * the list. KErrIncompleteInitialization if ConstructL is not called |
|
95 * by the deriving class. Otherwise any systemwide error code. |
|
96 */ |
|
97 TInt GetAllowedOutput( TInt aIndex, CRestrictedAudioOutput::TAllowedOutputPreference& aOutput ); |
|
98 |
|
99 /** |
|
100 * Gets the number of objects in the array. |
|
101 * |
|
102 * @param On successful return will contain the number of objects in |
|
103 * the list. |
|
104 * |
|
105 * @return KErrIncompleteInitialization if ConstructL is not called |
|
106 * by the deriving class. Otherwise a system wide error code. |
|
107 */ |
|
108 TInt GetAllowedOutputCount( TInt& aSize ); |
|
109 |
|
110 /** |
|
111 * Empties the list, so that it is ready to be reused. |
|
112 * |
|
113 * |
|
114 * @return KErrNone if successful. KErrIncompleteInitialization if ConstructL |
|
115 * is not called by the deriving class. |
|
116 */ |
|
117 TInt Reset(); |
|
118 |
|
119 /** |
|
120 * Applies settings cached locally and commits. |
|
121 * |
|
122 * @return KErrNone if successful. |
|
123 */ |
|
124 TInt Commit(); |
|
125 |
|
126 private: |
|
127 |
|
128 /** |
|
129 * C++ default constructor. |
|
130 */ |
|
131 CRestrictedAudioOutputImpl(); |
|
132 |
|
133 /** |
|
134 * By default Symbian 2nd phase constructor is private. |
|
135 */ |
|
136 static void ConstructL(); |
|
137 |
|
138 TBool ExistsInArray(CRestrictedAudioOutput::TAllowedOutputPreference& aOutput); |
|
139 |
|
140 // Data: |
|
141 |
|
142 |
|
143 private: // Friend classes |
|
144 friend class CRestrictedAudioOutput; |
|
145 |
|
146 RArray<CRestrictedAudioOutput::TAllowedOutputPreference> iAllowedOutputPrefArray; |
|
147 |
|
148 }; |
|
149 |
|
150 #endif // RESITRCTEDAUDIOOUTPUTIMPL_H |
|
151 |
|
152 // End of file |