1 /* |
|
2 * Copyright (c) 2008 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: Tone class definition. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_EVTTONEACTION_H |
|
20 #define C_EVTTONEACTION_H |
|
21 |
|
22 // System Includes |
|
23 |
|
24 // User Includes |
|
25 #include "evtaction.h" |
|
26 |
|
27 // Forward Declarations |
|
28 |
|
29 // extern data types |
|
30 |
|
31 // global Functions |
|
32 |
|
33 /** |
|
34 * @class CEvtToneAction |
|
35 * Class that captures information for the Tone action Type. |
|
36 * This class allows for Internalizing and Externalizing |
|
37 * the Tone action. |
|
38 * This class is used to store the information of Tone action. |
|
39 * |
|
40 * @lib evtstorage.lib |
|
41 * @since S60 v9.1 |
|
42 */ |
|
43 class CEvtToneAction : public CBase |
|
44 { |
|
45 |
|
46 public: |
|
47 /** |
|
48 * Constructs a new instance of Event Tone. |
|
49 * |
|
50 * @return The new instance of Event Tone object. |
|
51 * @leave System wide error code if the object creation fails. |
|
52 */ |
|
53 IMPORT_C static CEvtToneAction* NewL(); |
|
54 |
|
55 /** |
|
56 * Constructs a new instance of Event Tone. |
|
57 * Leaves the created instance on the cleanup stack. |
|
58 * |
|
59 * @return The new instance of Event object. |
|
60 * @leave System wide error code if the object creation fails. |
|
61 */ |
|
62 IMPORT_C static CEvtToneAction* NewLC(); |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 virtual ~CEvtToneAction(); |
|
68 |
|
69 public: // Get and Set methods |
|
70 |
|
71 /** |
|
72 * Gets the Tone for the Location Events. |
|
73 * The Tone is defined by the Location EventsUi on Creation. |
|
74 * A reference to the object's internal string is returned. |
|
75 * |
|
76 * @since S60 v9.1 |
|
77 * @return Tone String for the Location Event. |
|
78 */ |
|
79 IMPORT_C TPtrC FileName() const; |
|
80 |
|
81 /** |
|
82 * Set the Tone String for the Location Event. The Tone is |
|
83 * copied. |
|
84 * |
|
85 * @since S60 v9.1 |
|
86 * @param[in] aTone Tone String for the Location Event. |
|
87 * The Tone string is copied. |
|
88 * @leave KErrNoMemory If there is not enough memory to copy the string. |
|
89 */ |
|
90 IMPORT_C void SetFileNameL( const TDesC& aFileName ); |
|
91 |
|
92 /** |
|
93 * Gets the ToneLoop flag for the Location Event. |
|
94 * The ToneLoop is defined by the Location EventsUi on Creation. |
|
95 * |
|
96 * @since S60 v9.1 |
|
97 * @return TBool ToneLoop flag for the Location Event. |
|
98 */ |
|
99 IMPORT_C TBool ToneLoop() const; |
|
100 |
|
101 /** |
|
102 * Set the ToneLoop flag for playing tone for Location Event. |
|
103 * |
|
104 * @since S60 v9.1 |
|
105 * @param[in] TBool ToneLoop flag for the Location Event. |
|
106 */ |
|
107 IMPORT_C void SetToneLoop( const TBool aRepeat ); |
|
108 |
|
109 /** |
|
110 * Externalizes the contents into a CEvtAction. |
|
111 * |
|
112 * @since S60 v5.0 |
|
113 * @param aAction CEvtAction onto which the contents of |
|
114 * would be externalized. |
|
115 */ |
|
116 IMPORT_C void ExternalizeL( CEvtAction& aAction ); |
|
117 |
|
118 /** |
|
119 * Internalized the contents of the CEvtAction. |
|
120 * |
|
121 * @since S60 v5.0 |
|
122 * @param aAction CEvtAction from which the contents would be |
|
123 * populated. |
|
124 */ |
|
125 IMPORT_C void InternalizeL( CEvtAction& aAction ); |
|
126 |
|
127 private: |
|
128 |
|
129 /** |
|
130 * Externalizes the contents into a buffer. |
|
131 * |
|
132 * @since S60 v5.0 |
|
133 * @param aWriteStream Buffer onto which the contents of |
|
134 * would be externalized. |
|
135 */ |
|
136 void ExternalizeL( RWriteStream& aWriteStream ); |
|
137 |
|
138 /** |
|
139 * Internalized the contents of the buffer. |
|
140 * |
|
141 * @since S60 v5.0 |
|
142 * @param aReadStream Buffer from which the contents would be |
|
143 * populated. |
|
144 */ |
|
145 void InternalizeL( RReadStream& aReadStream ); |
|
146 |
|
147 /** |
|
148 * Returns the total size for the Internalize/Externalize buffer. |
|
149 * |
|
150 * @since S60 v5.0 |
|
151 * @return TInt Total Size of Interalize/Externalize buffer |
|
152 */ |
|
153 TInt TotalSize( ); |
|
154 |
|
155 private: // methods |
|
156 /** |
|
157 * Default C++ Constructor. |
|
158 */ |
|
159 CEvtToneAction(); |
|
160 |
|
161 /** |
|
162 * Second phase of the two phase constructor. |
|
163 */ |
|
164 void ConstructL(); |
|
165 |
|
166 private: // data |
|
167 |
|
168 /** |
|
169 * Tone String for Event. |
|
170 */ |
|
171 HBufC* iFileName; |
|
172 |
|
173 /** |
|
174 * Loop for tone. |
|
175 */ |
|
176 TBool iToneLoop; |
|
177 |
|
178 }; |
|
179 |
|
180 #endif // C_EVTTONEACTION_H |
|