uiacceltk/hitchcock/coretoolkit/src/HuiFxLayer.cpp
changeset 0 15bf7259bb7c
child 5 433cbbb6a04b
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2008 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:   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "HuiFxLayer.h"
       
    21 
       
    22 EXPORT_C CHuiFxLayer::CHuiFxLayer() :
       
    23     iLayerType( ELayerTypeUnknown )
       
    24     {
       
    25 #ifdef HUIFX_TRACE    
       
    26     RDebug::Print(_L("CHuiFxLayer::CHuiFxLayer - 0x%x "), this);
       
    27 #endif
       
    28     }
       
    29 
       
    30 EXPORT_C CHuiFxLayer::~CHuiFxLayer()
       
    31     {
       
    32 #ifdef HUIFX_TRACE    
       
    33     RDebug::Print(_L("CHuiFxLayer::~CHuiFxLayer - 0x%x "), this);
       
    34 #endif
       
    35     }
       
    36 
       
    37 EXPORT_C void CHuiFxLayer::ConstructL( THuiFxLayerType aType )
       
    38     {
       
    39     iBlendingOp = EBlendingModeReplace;
       
    40     iLayerType = aType;
       
    41     iSourceRect = TRect(0, 0, 0, 0);
       
    42     iTargetRect = TRect(0, 0, 0, 0);
       
    43     iVisualRect = TRect(0, 0, 0, 0);
       
    44     iAnimated = EFalse;
       
    45     iTransformed = EFalse;
       
    46     iMarginEnabled = ETrue;
       
    47     }
       
    48 EXPORT_C void CHuiFxLayer::CopyFromL(const CHuiFxLayer *aOldLayer)
       
    49     {
       
    50     iBlendingOp = aOldLayer->iBlendingOp;
       
    51     iLayerType = aOldLayer->iLayerType;
       
    52     iSourceRect = aOldLayer->iSourceRect;
       
    53     iTargetRect = aOldLayer->iTargetRect;
       
    54     iVisualRect = aOldLayer->iVisualRect;
       
    55     iAnimated = aOldLayer->iAnimated;
       
    56     iTransformed = aOldLayer->iTransformed;
       
    57     iMarginEnabled = aOldLayer->iMarginEnabled;
       
    58     }
       
    59 
       
    60 EXPORT_C TBool CHuiFxLayer::PrepareDrawL(CHuiFxEngine& /*aEngine*/)
       
    61     {
       
    62     // Nothing to do
       
    63     return ETrue;
       
    64     }
       
    65 
       
    66 EXPORT_C TBool CHuiFxLayer::VisualArea( TRect& /*aRect*/ )
       
    67     {
       
    68     // No area in base class
       
    69     return EFalse;
       
    70     }
       
    71 EXPORT_C TBool CHuiFxLayer::Margin( TMargins & /* aMargin */ )
       
    72 {
       
    73    // empty implementation in base class
       
    74    return EFalse;
       
    75 }
       
    76 
       
    77 EXPORT_C TBool CHuiFxLayer::Changed() const
       
    78     {
       
    79     return EFalse;
       
    80     }
       
    81 
       
    82 EXPORT_C void CHuiFxLayer::AdvanceTime(TReal32 /*aElapsedTime*/)
       
    83     {
       
    84     // Nothing to do
       
    85     }
       
    86 
       
    87 EXPORT_C THuiFxLayerType CHuiFxLayer::Type()
       
    88     {
       
    89     return iLayerType;
       
    90     }
       
    91 
       
    92 EXPORT_C void CHuiFxLayer::SetBlendingMode(THuiFxBlendingMode aOp)
       
    93     {
       
    94     iBlendingOp = aOp;
       
    95     }
       
    96 
       
    97 EXPORT_C THuiFxBlendingMode CHuiFxLayer::BlendingMode() const
       
    98     {
       
    99     return iBlendingOp;
       
   100     }
       
   101 
       
   102 EXPORT_C void CHuiFxLayer::SetDisplayArea(const TRect& aRect)
       
   103     {
       
   104     iDisplayArea = aRect;
       
   105     }
       
   106 
       
   107 EXPORT_C void CHuiFxLayer::SetSourceRect(const TRect& aRect)
       
   108     {
       
   109 #ifdef HUIFX_TRACE    
       
   110     RDebug::Print(_L("CHuiFxLayer::SetSourceRect - 0x%x (%d,%d,%d,%d))"), this, aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY);
       
   111 #endif
       
   112     iSourceRect = aRect;
       
   113     }
       
   114 
       
   115 EXPORT_C void CHuiFxLayer::SetTargetRect(const TRect& aRect)
       
   116     {
       
   117 #ifdef HUIFX_TRACE    
       
   118     RDebug::Print(_L("CHuiFxLayer::SetTargetRect - 0x%x (%d,%d,%d,%d))"), this, aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY);
       
   119 #endif
       
   120     iTargetRect = aRect;
       
   121     }
       
   122 
       
   123 EXPORT_C void CHuiFxLayer::SetVisualRect(const TRect& aRect)
       
   124     {
       
   125 #ifdef HUIFX_TRACE    
       
   126     RDebug::Print(_L("CHuiFxLayer::SetVisualRect - 0x%x (%d,%d,%d,%d))"), this, aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY);
       
   127 #endif
       
   128     iVisualRect = aRect;
       
   129     }
       
   130 
       
   131 EXPORT_C const TRect& CHuiFxLayer::SourceRect() const
       
   132     {
       
   133     return iSourceRect;
       
   134     }
       
   135 
       
   136 EXPORT_C const TRect& CHuiFxLayer::TargetRect() const
       
   137     {
       
   138     return iTargetRect;
       
   139     }
       
   140 
       
   141 EXPORT_C const TRect& CHuiFxLayer::VisualRect() const
       
   142     {
       
   143     return iVisualRect;
       
   144     }
       
   145 
       
   146 TBool CHuiFxLayer::IsAnimated() const
       
   147     {
       
   148     return iAnimated;
       
   149     }
       
   150 
       
   151 void CHuiFxLayer::SetAnimated(TBool aAnimated)
       
   152     {
       
   153     iAnimated = aAnimated;
       
   154     }
       
   155 
       
   156 TBool CHuiFxLayer::IsTransformed() const
       
   157     {
       
   158     return iTransformed;
       
   159     }    
       
   160 
       
   161 void CHuiFxLayer::SetTransformed(TBool aTransformed)
       
   162     {
       
   163     iTransformed = aTransformed;
       
   164     }
       
   165 
       
   166 void CHuiFxLayer::EnableMargin(TBool aEnable)
       
   167     {
       
   168     iMarginEnabled = aEnable;
       
   169     EnableMarginApplyChildren(aEnable);
       
   170     }
       
   171 void CHuiFxLayer::EnableMarginApplyChildren(TBool /*aEnable*/)
       
   172     {
       
   173     /* empty in baseclass */
       
   174     }
       
   175 
       
   176 
       
   177 TBool CHuiFxLayer::IsMarginEnabled() const
       
   178     {
       
   179     return iMarginEnabled;
       
   180     }
       
   181 
       
   182 TBool CHuiFxLayer::IsFiltered() const
       
   183     {
       
   184     return EFalse;
       
   185     }
       
   186 
       
   187 TBool CHuiFxLayer::IsSemitransparent() const
       
   188     {
       
   189     return EFalse;
       
   190     }