|
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 Animation Information Element. |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 * @file |
|
22 * @internalComponent |
|
23 * Defines CEmsPreDefAnimation and CEmsAnimationIE classes |
|
24 */ |
|
25 |
|
26 #ifndef __EMSAnimationIE_H__ |
|
27 #define __EMSAnimationIE_H__ |
|
28 |
|
29 #include <emspictureie.h> |
|
30 |
|
31 /** |
|
32 * @internalComponent |
|
33 */ |
|
34 #define KSmallAnimSize TSize(8,8) |
|
35 /** |
|
36 * @internalComponent |
|
37 */ |
|
38 #define KLargeAnimSize TSize(16,16) |
|
39 |
|
40 |
|
41 class CEmsPreDefAnimationIE : public CEmsInformationElement |
|
42 /** |
|
43 * CEmsPreDefAnimationIE wraps the creation & modification of an EMS predefined animation |
|
44 * information element into a single class. |
|
45 * |
|
46 * Format of PreDef animation Information Element. |
|
47 * ----------------------------------------------- |
|
48 * |
|
49 * Position (Octet) Bit Description |
|
50 * 1 Start Position |
|
51 * 2 PreDefined Animation Number |
|
52 * |
|
53 * The start position of the information element is relative to the PDU that contains the object. |
|
54 * However when within this class it will be an converted to an absolute position within the message. |
|
55 * |
|
56 * @see 3gpp Spec V5 section 9.2.3.24.10.1.4 |
|
57 * @internalComponent |
|
58 */ |
|
59 { |
|
60 public: |
|
61 // EIESize is 1 because start position is not included |
|
62 enum {EIESize=1}; |
|
63 enum TAnimType{ |
|
64 EFlirty =0x0, |
|
65 EGlad =0x1, |
|
66 ESceptic =0x2, |
|
67 ESad =0x3, |
|
68 EWow =0x4, |
|
69 ECrying =0x5, |
|
70 EWinking =0x6, |
|
71 ELaughing =0x7, |
|
72 EIndifferent=0x8, |
|
73 EKissing =0x9, |
|
74 EConfused =0xA, |
|
75 ETongueOut =0xB, |
|
76 EAngry =0xC, |
|
77 EGlasses =0xD, |
|
78 EDevil =0xE}; |
|
79 |
|
80 IMPORT_C static CEmsPreDefAnimationIE* NewL(TAnimType aAnimValue=EFlirty); |
|
81 IMPORT_C CEmsInformationElement* DuplicateL() const; |
|
82 IMPORT_C void CopyL(const CEmsPreDefAnimationIE& aSrc); |
|
83 |
|
84 IMPORT_C TAnimType Animation() const ; |
|
85 IMPORT_C void SetAnimationL(TAnimType aValue); |
|
86 |
|
87 private: |
|
88 CEmsPreDefAnimationIE(TAnimType aAnimValue); |
|
89 CEmsPreDefAnimationIE(); |
|
90 virtual void EncodeBodyL(TPtr8 aPtr, TBool aIsForSerialisation) const; |
|
91 virtual void DecodeBodyL(const TPtrC8 aPtr, TBool aIsFromSerialisation); |
|
92 TAnimType iAnimNumber; |
|
93 }; |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 class CEmsAnimationIE : public CEmsInformationElement |
|
99 /** |
|
100 * CEmsAnimationIE wraps the creation & modification of both an EMS large animation & small animation |
|
101 * information element into a single class. |
|
102 * |
|
103 * Format of Large/User Animation Information Element. |
|
104 * ----------------------------------------------- |
|
105 * |
|
106 * Position (Octet) Bit Description |
|
107 * 1 Start Position |
|
108 * 2..n Animation Data |
|
109 * |
|
110 * The start position of the information element is relative to the PDU that contains the object. |
|
111 * However when within this class it will be an converted to an absolute position within the message. |
|
112 * |
|
113 * @see 3gpp Spec V5 section 9.2.3.24.10.1.5/6 |
|
114 * @internalComponent |
|
115 */ |
|
116 { |
|
117 public: |
|
118 enum {EFramesPerMsg=4}; |
|
119 enum {EIESmallSize=32, EIELargeSize=128}; |
|
120 |
|
121 static CEmsAnimationIE* NewL(); |
|
122 IMPORT_C static CEmsAnimationIE* NewL(const CFbsBitmap& aBitmap); |
|
123 IMPORT_C ~CEmsAnimationIE(); |
|
124 IMPORT_C CEmsInformationElement* DuplicateL() const; |
|
125 IMPORT_C void CopyL(const CEmsAnimationIE& aSrc); |
|
126 |
|
127 IMPORT_C CFbsBitmap* GetBitmapL() const; |
|
128 |
|
129 private: |
|
130 CEmsAnimationIE(); |
|
131 void ConstructL(const CFbsBitmap& aBitmap); |
|
132 virtual void EncodeBodyL(TPtr8 aPtr, TBool aIsForSerialisation) const; |
|
133 virtual void DecodeBodyL(const TPtrC8 aPtr, TBool aIsFromSerialisation); |
|
134 CFbsBitmap* GetBitmapL(const TSize& aSize, const TDesC8& aDataBuf)const; |
|
135 HBufC8* iData; |
|
136 }; |
|
137 |
|
138 #endif // __EMSAnimationIE_H__ |