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