messagingappbase/smilengine/engine/inc/smilrootregion.h
branchRCL_3
changeset 27 7fdbb852d323
parent 0 72b543305e3a
equal deleted inserted replaced
26:ebe688cedc25 27:7fdbb852d323
       
     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: smilrootregion  declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef SMILROOTREGION_H
       
    21 #define SMILROOTREGION_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "smilregion.h"
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 class CSmilRootRegion : public CSmilRegion
       
    29     {
       
    30     public:  // Constructors and destructor
       
    31 
       
    32 		/**
       
    33         * Two-phased constructor.
       
    34         */
       
    35         static CSmilRootRegion* NewL( CSmilPresentation* aPresentation );
       
    36         
       
    37         /**
       
    38         * Destructor.
       
    39         */
       
    40         virtual ~CSmilRootRegion();
       
    41 		
       
    42 
       
    43     public: // New functions
       
    44 
       
    45 		virtual TBool IsRoot() const { return ETrue; }
       
    46 
       
    47 		virtual void Redraw();
       
    48 		virtual void Redraw(TRect iUpdate);
       
    49 
       
    50 		virtual void AddChild(CSmilRegion* aChild);
       
    51 
       
    52 		virtual TRect GetRectangle() const;
       
    53 
       
    54 		/**
       
    55 		* Calculate the region positions
       
    56 		*/
       
    57 		virtual void Layout(TReal32 aScalingFactor = 1);
       
    58 
       
    59 		// drawing
       
    60 
       
    61 		virtual void Draw(CGraphicsContext& aGc, const TRect& aRect);
       
    62 
       
    63 		// child management
       
    64 
       
    65 		virtual CSmilRegion* FirstChild() const { return iFirstChild; }
       
    66 		virtual CSmilRegion* LastChild() const { return iLastChild; }
       
    67 
       
    68 		virtual void SetFirstChild(CSmilRegion* c) { iFirstChild = c; } 
       
    69 		virtual void SetLastChild(CSmilRegion* c ) { iLastChild = c; } 
       
    70 
       
    71 		CSmilRegion* FindRegion(const TDesC& aId);
       
    72 
       
    73 		void SetDefaultLayout(TBool aDef=ETrue);
       
    74 
       
    75 		CSmilMedia* MediaAt(const TPoint& aPoint,TBool aOnlyFocusable=EFalse);
       
    76 		CSmilArea* AreaAt(const TPoint& aPoint, TBool aOnlyFocusable=EFalse);
       
    77 
       
    78 		CSmilObject* FindNearest(const TPoint& aPoint, TDirection iDir);		
       
    79 		TReal32 GetScalingFactor() ;
       
    80 
       
    81 	protected:
       
    82 
       
    83 		CSmilObject* FindNearest(const TPoint& aPoint, TDirection iDir, TInt& dist2);
       
    84 
       
    85 		CSmilRootRegion(CSmilPresentation* aPresentation);
       
    86 
       
    87 		// child management
       
    88 
       
    89 		CSmilRegion* iFirstChild;
       
    90 		CSmilRegion* iLastChild;
       
    91 		
       
    92 		TReal32 iScalingFactor;
       
    93 
       
    94     };
       
    95 
       
    96 #endif      // ?INCLUDE_H   
       
    97             
       
    98 // End of File