|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 #ifndef IMAGEFRAMEBODY_H |
|
21 #define IMAGEFRAMEBODY_H |
|
22 |
|
23 #include <imageframe.h> |
|
24 |
|
25 /** |
|
26 CBody class implements the functionality declared in CImageFrame class. |
|
27 It can be created as a wrapper around a RChunk or a descriptor. |
|
28 */ |
|
29 NONSHARABLE_CLASS( CImageFrame::CBody ): public CBase |
|
30 { |
|
31 friend class CImageFrame; |
|
32 |
|
33 private: |
|
34 static CBody* NewL(CImageFrame& aHandle, const TDes8& aBuffer, TInt aMaxBufferSize); |
|
35 |
|
36 static CBody* NewL(CImageFrame& aHandle, const TDes8& aBuffer, TInt aMaxBufferSize, |
|
37 const TSize& aFrameSize, const TFrameFormatBase& aFrameFormat, const TFrameLayoutBase& aFrameLayout); |
|
38 |
|
39 static CBody* NewL(CImageFrame& aHandle, const RChunk* aBuffer, TInt aMaxBufferSize, TInt aDataOffset); |
|
40 |
|
41 static CBody* NewL(CImageFrame& aHandle, const RChunk* aBuffer, TInt aMaxBufferSize, |
|
42 TInt aDataOffset, const TSize& aFrameSize, const TFrameFormatBase& aFrameFormat,const TFrameLayoutBase& aFrameLayout); |
|
43 ~CBody(); |
|
44 |
|
45 const TFrameFormatBase& FrameFormat() const; |
|
46 void SetFrameFormatL(const TFrameFormatBase& aFormat); |
|
47 |
|
48 const TFrameLayoutBase& FrameLayout() const; |
|
49 void SetFrameLayoutL(const TFrameLayoutBase& aFrameLayout); |
|
50 |
|
51 const TSize& FrameSizeInPixels() const; |
|
52 void SetFrameSizeInPixels(const TSize& aFrameSize); |
|
53 |
|
54 TDes8& Data(); |
|
55 |
|
56 const TDesC8& Data() const; |
|
57 |
|
58 RChunk& DataChunk(); |
|
59 |
|
60 TInt DataOffset() const; |
|
61 TInt MaxBufferSize() const; |
|
62 TBool IsChunk() const; |
|
63 |
|
64 explicit CBody(CImageFrame& aHandle); |
|
65 CBody(CImageFrame& aHandle, const TDes8& aBuffer); |
|
66 |
|
67 void StoreChunkL(const RChunk* aBuffer, TInt aMaxBufferSize, TInt aDataOffset); |
|
68 void SetMaxSizeL(TInt aMaxBufferSize); |
|
69 void StoreAddParamL(const TSize& aFrameSize, const TFrameFormatBase& aFrameFormat, const TFrameLayoutBase& aFrameLayout); |
|
70 void SetDefaultFormatL(); |
|
71 |
|
72 |
|
73 private: |
|
74 CImageFrame& iHandle; |
|
75 // Frame size in pixels |
|
76 TSize iFrameSize; |
|
77 // Image Frame specific layout |
|
78 TFrameLayoutBase* iLayout; |
|
79 // Image Frame format |
|
80 TFrameFormatBase* iFormat; |
|
81 // pointer to the RChunk, represented by the CImageFrameRChunk object |
|
82 RChunk* iDataChunk; |
|
83 // offset of the data from the start of the chunk |
|
84 TInt iDataOffset; |
|
85 // 8-bit pointer to the data. |
|
86 TPtr8 iBufferPtr; |
|
87 // The maximum size allocated to this object by its creator |
|
88 TInt iMaxBufferSize; |
|
89 // stores the info about the type of the present object |
|
90 TBool iIsChunk; |
|
91 }; |
|
92 |
|
93 #endif //IMAGEFRAMEBODY_H |