msg_plat/smil_engine_api/inc/smilregioninterface.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2003 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: smilregioninterface  declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef SMILREGIONINTERFACE
       
    21 #define SMILREGIONINTERFACE
       
    22 
       
    23 #include <e32std.h>
       
    24 #include <gdi.h>
       
    25 
       
    26 
       
    27 class CSmilMedia;
       
    28 
       
    29 /**
       
    30  * Interface representing a drawing region
       
    31  */
       
    32 class MSmilRegion
       
    33 	{
       
    34 	public:
       
    35 		enum TFit
       
    36 			{
       
    37 			EFill,
       
    38 			EMeet,	
       
    39 			ESlice,	
       
    40 			EScroll,
       
    41 			EHidden
       
    42 			};
       
    43 
       
    44 		enum TBgMode
       
    45 			{
       
    46 			EAlways,
       
    47 			EWhenActive
       
    48 			};
       
    49 
       
    50 		/**
       
    51 		* Coordinates of the drawing area
       
    52 		*/
       
    53 		virtual TRect GetRectangle() const = 0;
       
    54 
       
    55 		/**
       
    56 		* Coordinates of the media object within the rectangle. 
       
    57 		* Empty rect if the media is not visible on the region
       
    58 		*/
       
    59 		virtual TRect GetRectangle(const CSmilMedia* aMedia) const = 0;
       
    60 
       
    61 		/**
       
    62 		* z-index of the region. Regions with higher z-index are 
       
    63 		* drawn on top of lower ones
       
    64 		*/
       
    65 		virtual TInt GetZIndex() const = 0;
       
    66 
       
    67 		/**
       
    68 		* Value of SMIL fit attribute. Values are:
       
    69 		*
       
    70 		* EFill - media on this regions is scaled to fill it
       
    71 		* EMeet - media is scaled so that it fills the region in 
       
    72 		*		one direction while maintaining the aspect ratio
       
    73 		* ESlice - scale media to fill the region, while 
       
    74 		*		maintaining the aspect ration and slicing off 
       
    75 		*		the overflowing part 
       
    76 		* EScroll - provide scrolling mechanism for the media
       
    77 		* EHidden - don't scale, slice off the overflow
       
    78 		*/
       
    79 		virtual TFit GetFit() const = 0;
       
    80 
       
    81 		/**
       
    82 		* Foreground color
       
    83 		*/
       
    84 		virtual TRgb GetForeground() const = 0;
       
    85 
       
    86 		/**
       
    87 		* Background color
       
    88 		*/
       
    89 		virtual TRgb GetBackground() const = 0;
       
    90 
       
    91 		/**
       
    92 		* Is background transparent?
       
    93 		*/
       
    94 		virtual TBool BackgroundTransparent() const = 0;
       
    95 
       
    96 		/**
       
    97 		* Background mode of the region. Values match those of
       
    98 		* SMIL showBackground attribute:
       
    99 		* 
       
   100 		* EAlways - background is always drawn
       
   101 		* EWhenActive - background is drawn when some media is 
       
   102 		*			active on the region
       
   103 		*/
       
   104 		virtual TBgMode GetBackgroundMode() const = 0;
       
   105 
       
   106 		/**
       
   107 		* Requests redrawing of this region and its visible contents
       
   108 		*/
       
   109 		virtual void Redraw()=0;
       
   110 
       
   111 		/**
       
   112 		* Requests redrawing of this region and its visible contents.
       
   113 		* Update area is given in the coordinate space of the region
       
   114 		*/
       
   115 		virtual void Redraw(TRect aUpdate)=0;
       
   116 
       
   117 		/**
       
   118 		*Return the parent region
       
   119 		*/
       
   120 		virtual MSmilRegion* Parent() const = 0;
       
   121 
       
   122 		/**
       
   123 		* Return the root region
       
   124 		*/
       
   125 		virtual MSmilRegion* Root() const = 0;
       
   126 
       
   127 		/**
       
   128 		* Called to by the Engine to tell that a piece of media 
       
   129 		* is currently visible on this region
       
   130 		*/
       
   131 		virtual void AddMediaL(CSmilMedia* aMedia)=0;
       
   132 
       
   133 		/**
       
   134 		* Called to by the Engine to tell that a piece of media is 
       
   135 		* no longer visible on this region
       
   136 		*/
       
   137 		virtual void RemoveMedia(CSmilMedia* aMedia)=0;
       
   138 
       
   139 		/**
       
   140 		* Is the media currently visible on the region?
       
   141 		*/
       
   142 		virtual TBool ContainsMedia(const CSmilMedia* aMedia) const = 0;
       
   143 
       
   144 		/**
       
   145 		* True if this is the root region
       
   146 		*/
       
   147 		virtual TBool IsRoot() const = 0;
       
   148 
       
   149 		/**
       
   150 		* Called to by the Engine to tell that a piece of media
       
   151 		* on the region has ended its transition 
       
   152 		* (and fill=transition semantics should be applied)
       
   153 		*/
       
   154 		virtual void MediaTransitionEnd(CSmilMedia* aMedia)=0;
       
   155 	};
       
   156 
       
   157 #endif