31
|
1 |
/*
|
|
2 |
* Copyright (c) 2006 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 the License "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: MBSElement.h
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef __MBSELEMENT_H
|
|
21 |
#define __MBSELEMENT_H
|
|
22 |
|
|
23 |
#include <e32std.h>
|
33
|
24 |
#include <rbsobjowningptrarray.h>
|
31
|
25 |
|
|
26 |
enum TBSElementType
|
|
27 |
{
|
|
28 |
EBSInt,
|
|
29 |
EBSText,
|
|
30 |
EBSList,
|
|
31 |
EBSBuffer,
|
|
32 |
EBSBitmap,
|
|
33 |
EBSFile
|
|
34 |
};
|
|
35 |
|
|
36 |
/**
|
|
37 |
* Class encapsulating the structure type branding items
|
|
38 |
*
|
|
39 |
* @since
|
|
40 |
*/
|
|
41 |
|
|
42 |
class RWriteStream;
|
|
43 |
class CBSBitmap;
|
|
44 |
|
|
45 |
NONSHARABLE_CLASS( MBSElement )
|
|
46 |
{
|
|
47 |
|
|
48 |
public:
|
|
49 |
|
|
50 |
/*
|
|
51 |
* Element type
|
|
52 |
* @return the element type
|
|
53 |
*/
|
|
54 |
virtual TBSElementType ElementType() = 0;
|
|
55 |
|
|
56 |
/*
|
|
57 |
* Element id
|
|
58 |
* @return the element id
|
|
59 |
*/
|
|
60 |
virtual const TDesC8& ElementId() = 0;
|
|
61 |
|
|
62 |
/*
|
|
63 |
* Integer data
|
|
64 |
* Panics if trying to get wrong type data.
|
|
65 |
* @return the integer data of the item
|
|
66 |
*/
|
|
67 |
virtual TInt IntDataL() = 0;
|
|
68 |
|
|
69 |
/*
|
|
70 |
* Text data
|
|
71 |
* Panics if trying to get wrong type data.
|
|
72 |
* @return the text data of the item
|
|
73 |
*/
|
|
74 |
virtual const TDesC& TextDataL() = 0;
|
|
75 |
|
|
76 |
/*
|
|
77 |
* 8-bit buffer data
|
|
78 |
* Panics if trying to get wrong type data.
|
|
79 |
* @return the text data of the item
|
|
80 |
*/
|
|
81 |
virtual const TDesC8& BufferDataL() = 0;
|
|
82 |
|
|
83 |
/*
|
|
84 |
* Bitmap data
|
|
85 |
* Panics if trying to get wrong type data.
|
|
86 |
* @return the text data of the item
|
|
87 |
*/
|
|
88 |
virtual const CBSBitmap& BitmapDataL() = 0;
|
|
89 |
|
|
90 |
/*
|
|
91 |
* Structure data
|
|
92 |
* Panics if trying to get wrong type data.
|
|
93 |
* @return the list data
|
|
94 |
*/
|
|
95 |
virtual TArray<MBSElement*> GetStructureL() = 0;
|
|
96 |
|
|
97 |
/*
|
|
98 |
* Finds the first entry from the list of a list type element with
|
|
99 |
* the given element id. Note that if there are several subelements
|
|
100 |
* with the same elementId then TBrandingElementIterator should be
|
|
101 |
* used to iterate through them.
|
|
102 |
* @param aElementId elementId of the subelement to be found.
|
|
103 |
* @return the subelement
|
|
104 |
*/
|
|
105 |
virtual const MBSElement& FindSubEntryL( const TDesC& aElementId ) = 0;
|
|
106 |
|
|
107 |
/*
|
|
108 |
* Writes the internal state to stream.
|
|
109 |
* @param aWriteStream output stream;
|
|
110 |
*/
|
|
111 |
virtual void ExternalizeL( RWriteStream& aWriteStream ) = 0;
|
|
112 |
|
|
113 |
/*
|
|
114 |
* Deletes the element.
|
|
115 |
*/
|
|
116 |
virtual void Close() = 0;
|
|
117 |
|
|
118 |
/*
|
|
119 |
* Destructor
|
|
120 |
*/
|
|
121 |
virtual ~MBSElement() {};
|
|
122 |
|
|
123 |
};
|
|
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
#endif //__MBSELEMENT_H
|