|
1 /* |
|
2 * Copyright (c) 2009 Sony Ericsson Mobile Communications AB |
|
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 * Sony Ericsson Mobile Communications AB - initial contribution. |
|
11 * Nokia Corporation - additional changes. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: |
|
16 * Implements the Enhanced SMS Predefined and User Defined sound IE. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 /** |
|
22 * @file |
|
23 * @internalComponent |
|
24 * Defines CEmsPreDEfSound and CEmsSoundIE classes |
|
25 */ |
|
26 |
|
27 #ifndef __EMSSoundIE_H__ |
|
28 #define __EMSSoundIE_H__ |
|
29 |
|
30 #include <emsinformationelement.h> |
|
31 |
|
32 |
|
33 |
|
34 class CEmsPreDefSoundIE : public CEmsInformationElement |
|
35 /** |
|
36 * @internalComponent |
|
37 */ |
|
38 { |
|
39 public: |
|
40 enum TPredefinedSound {EChimesHigh=0, EChimesLow, EDing, ETaDa, ENotify, EDrum, EClaps, EFanFar, EChordHigh, EChordLow}; |
|
41 IMPORT_C static CEmsPreDefSoundIE* NewL(TPredefinedSound aSound=EChimesHigh); |
|
42 IMPORT_C CEmsInformationElement* DuplicateL() const; |
|
43 |
|
44 IMPORT_C void CopyL(const CEmsPreDefSoundIE& aSrc); |
|
45 IMPORT_C TPredefinedSound PredefinedSound() const; |
|
46 private: |
|
47 CEmsPreDefSoundIE(); |
|
48 virtual void EncodeBodyL(TPtr8 aPtr, TBool aIsForSerialisation) const; |
|
49 virtual void DecodeBodyL(const TPtrC8 aPtr, TBool aIsFromSerialisation); |
|
50 void ConstructL(TPredefinedSound aSound); |
|
51 TPredefinedSound iSound; |
|
52 |
|
53 }; |
|
54 |
|
55 class CEmsSoundIE : public CEmsInformationElement |
|
56 /** |
|
57 * CEmsSoundIE wraps the creation & modification of the user & predefined sound |
|
58 * information elements into a single class. |
|
59 * |
|
60 * Format of Extended Object PreDefined Sound. |
|
61 * ------------------------------------------ |
|
62 * |
|
63 * Position (Octet) Bit Description |
|
64 * 1 Start Position |
|
65 * 2 Number of predef sound |
|
66 * |
|
67 * Format of Extended Object User Defined Sound. |
|
68 * -------------------------------------------- |
|
69 * |
|
70 * Position (Octet) Bit Description |
|
71 * 1 Start Position |
|
72 * 2..n Sound Data (iMelody) |
|
73 * |
|
74 * @see 3gpp Spec V5 section 9.2.3.24.10.1.2/3 |
|
75 * @internalComponent |
|
76 */ |
|
77 { |
|
78 public: |
|
79 enum {EMaxSoundLength=128}; |
|
80 |
|
81 static CEmsSoundIE* NewL(); |
|
82 IMPORT_C static CEmsSoundIE* NewL(const TDesC8& aMelody); |
|
83 |
|
84 IMPORT_C CEmsInformationElement* DuplicateL() const; |
|
85 IMPORT_C ~CEmsSoundIE(); |
|
86 IMPORT_C void CopyL(const CEmsSoundIE& aSrc); |
|
87 |
|
88 IMPORT_C const HBufC8* Melody() const; |
|
89 |
|
90 private: |
|
91 CEmsSoundIE(); |
|
92 void ConstructL(const TDesC8& aMelody); |
|
93 virtual void EncodeBodyL(TPtr8 aPtr, TBool aIsForSerialisation) const; |
|
94 virtual void DecodeBodyL(const TPtrC8 aPtr, TBool aIsFromSerialisation); |
|
95 void Reset(); |
|
96 HBufC8* iMelody; |
|
97 }; |
|
98 |
|
99 |
|
100 #endif // __EMSSoundIE_H__ |