textinput/peninputhwrfscn/src/peninputhwrfscnbasepanel.cpp
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Implementation for chinese peninput full screen hwr
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "peninputhwrfscnlayout.h"
       
    20 #include "peninputhwrfscnbasepanel.h"
       
    21 
       
    22 // ============================ MEMBER FUNCTIONS ===============================
       
    23   
       
    24 // -----------------------------------------------------------------------------
       
    25 // CPeninputHwrfscnBasePanel::~CPeninputHwrfscnBasePanel()
       
    26 // .
       
    27 // -----------------------------------------------------------------------------
       
    28 //
       
    29 CPeninputHwrfscnBasePanel::~CPeninputHwrfscnBasePanel()   
       
    30     {
       
    31     iEventObserverList.Reset();
       
    32     iEventObserverList.Close();
       
    33     }
       
    34 
       
    35 // -----------------------------------------------------------------------------
       
    36 // CPeninputHwrfscnBasePanel::AddEventObserver()
       
    37 // .
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 void CPeninputHwrfscnBasePanel::AddEventObserver( MEventObserver* aObserver )
       
    41     {
       
    42     if( !aObserver )
       
    43         return;
       
    44     //add only when it's not an observer 
       
    45     if( KErrNotFound == iEventObserverList.Find( aObserver ) )
       
    46         {
       
    47         iEventObserverList.Append( aObserver );
       
    48         }        
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CPeninputHwrfscnBasePanel::RemoveEventObserver()
       
    53 // .
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 void CPeninputHwrfscnBasePanel::RemoveEventObserver( MEventObserver* aObserver )
       
    57     {
       
    58     TInt index = iEventObserverList.Find( aObserver );
       
    59     if( KErrNotFound != index )
       
    60         {
       
    61         iEventObserverList.Remove( index );
       
    62         }        
       
    63     }
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // CPeninputHwrfscnBasePanel::SetPostion()
       
    67 // .
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 void CPeninputHwrfscnBasePanel::SetPostion( TPoint aPos )
       
    71     {
       
    72     iPos = aPos;
       
    73     SizeChanged();
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CPeninputHwrfscnBasePanel::IsVisible()
       
    78 // .
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 TBool CPeninputHwrfscnBasePanel::IsVisible()
       
    82     {
       
    83     return iVisible;
       
    84     }
       
    85         
       
    86 // -----------------------------------------------------------------------------
       
    87 // CPeninputHwrfscnBasePanel::AddToRootControl()
       
    88 // .
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 void CPeninputHwrfscnBasePanel::AddToRootControlL( CFepUiBaseCtrl* aCtrl )
       
    92 	{
       
    93 	iLayout->AddControlL( aCtrl, EFalse );	
       
    94 	}
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CPeninputHwrfscnBasePanel::CPeninputHwrfscnBasePanel()
       
    98 // .
       
    99 // -----------------------------------------------------------------------------
       
   100 //	
       
   101 CPeninputHwrfscnBasePanel::CPeninputHwrfscnBasePanel( 
       
   102     CPeninputHwrfscnLayout * aLayout )
       
   103     : iVisible( EFalse ),iLayout( aLayout )
       
   104     {
       
   105     }
       
   106     
       
   107 // -----------------------------------------------------------------------------
       
   108 // CPeninputHwrfscnBasePanel::ReportEvent()
       
   109 // .
       
   110 // -----------------------------------------------------------------------------
       
   111 //	
       
   112 void CPeninputHwrfscnBasePanel::ReportEvent( TInt aEventType, 
       
   113     CFepUiBaseCtrl* aCtrl, 
       
   114 	const TDesC& aEventData )
       
   115     {
       
   116     for( TInt i = 0; i < iEventObserverList.Count(); i++ )
       
   117         {
       
   118         iEventObserverList[i]->HandleControlEvent( 
       
   119             aEventType, aCtrl, aEventData );
       
   120         }
       
   121     }
       
   122 
       
   123 //end of file