|
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 Picture (Small/Large/Variable) Information Element. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 /** |
|
22 * @file |
|
23 * |
|
24 * Defines CEmsPictureIE class |
|
25 * @internalComponent |
|
26 * @released |
|
27 */ |
|
28 |
|
29 |
|
30 #ifndef __EMSPictureIE_H__ |
|
31 #define __EMSPictureIE_H__ |
|
32 |
|
33 #include <emsinformationelement.h> |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 #define KSmallPicSize TSize(16,16) |
|
39 |
|
40 #define KLargePicSize TSize(32,32) |
|
41 |
|
42 class CGraphicsDevice; |
|
43 class CFbsBitmap; |
|
44 class CEmsPictureIE : public CEmsInformationElement |
|
45 /** |
|
46 * CEmsPictureIE wraps the creation & modification of the picture small/large and vriable |
|
47 * information element into a single class. |
|
48 * |
|
49 * Format of Small/Large |
|
50 * ---------------------------- |
|
51 * |
|
52 * Position (Octet) Bit Description |
|
53 * 1 Start Position |
|
54 * 2..n Picture Data |
|
55 * |
|
56 * Format of variable |
|
57 * ---------------------------- |
|
58 * |
|
59 * Position (Octet) Bit Description |
|
60 * 1 Start Position |
|
61 * 2 Width |
|
62 * 3 Height |
|
63 * 4..n Picture Data |
|
64 * |
|
65 * @see 3gpp Spec V5 section 9.2.3.24.10.1.7/8/9 |
|
66 * @internalComponent |
|
67 */ |
|
68 { |
|
69 friend class CEmsAnimationIE; |
|
70 public: |
|
71 enum {ESmallBufSize=32, ELargeBufSize=128, EEnhancedMaxSize=128}; |
|
72 enum TColors {EWhite = 0, EBlack=1}; |
|
73 |
|
74 IMPORT_C static CEmsPictureIE* NewL(const CFbsBitmap& aBitmap); // resizes bitmap if needed |
|
75 static CEmsPictureIE* NewL(); |
|
76 IMPORT_C CEmsInformationElement* DuplicateL() const; |
|
77 IMPORT_C ~CEmsPictureIE(); |
|
78 IMPORT_C void CopyL(const CEmsPictureIE& aSrc); |
|
79 IMPORT_C TSize SizeInPixels() const; |
|
80 IMPORT_C CFbsBitmap* GetBitmapL()const; |
|
81 |
|
82 private: |
|
83 virtual void EncodeBodyL(TPtr8 aPtr, TBool aIsForSerialisation) const; |
|
84 virtual void DecodeBodyL(const TPtrC8 aPtr, TBool aIsFromSerialisation); |
|
85 CEmsPictureIE(); |
|
86 void ConstructL(const CFbsBitmap& aBitmap); |
|
87 inline HBufC8* PictureBuf() const ; |
|
88 static HBufC8* CreatePictureBufferL(const CFbsBitmap& aBitmap); |
|
89 TSize iSize; |
|
90 HBufC8* iPictureBuf; |
|
91 }; |
|
92 #include <emspictureie.inl> |
|
93 #endif // __EMSPictureIE_H__ |