textinput/peninputcommonctrls/src/peninputdropdownlist/peninputlistmanager.cpp
branchRCL_3
changeset 21 ecbabf52600f
equal deleted inserted replaced
20:ebd48d2de13c 21:ecbabf52600f
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  List manager,which is used by drop down list
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "peninputlistmanager.h"
       
    20 #include "peninputlistonerowwithouticon.h"
       
    21 #include "peninputlistonerowwithouticonwithbubble.h"
       
    22 #include "peninputlistmultirowwithicon.h"
       
    23 #include "peninputlistmultirowwithiconwithbubble.h"
       
    24 #include "peninputlistonerowwithicon.h"
       
    25 #include "peninputlistonerowwithiconwithbubble.h"
       
    26 #include "peninputlistmultirowwithouticon.h"
       
    27 
       
    28 #include "peninputlistmultirowrollwithiconwithbubble.h"
       
    29 #include "peninputlistonerowrollwithiconwithbubble.h"
       
    30 
       
    31 #include "peninputlistmultirowrollwithicon.h"
       
    32 #include "peninputlistonerowrollwithicon.h"
       
    33 #include "peninputlistexpandablemultirowwithouticon.h"
       
    34 #include "peninputlistmultirowwithouticonwithbubble.h"
       
    35 
       
    36 #include <peninputdropdownlistcontext.h>
       
    37 
       
    38 // ======== MEMBER FUNCTIONS ========
       
    39 
       
    40 // Implementation of Class CListManager 
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CListManager::NewL
       
    44 // factory function
       
    45 // (other items were commented in a header).
       
    46 // -----------------------------------------------------------------------------
       
    47 //
       
    48 CListManager* CListManager::NewL(MFepCtrlDropdownListContext* aContext)
       
    49     {
       
    50     CListManager* self = new (ELeave) CListManager();
       
    51     CleanupStack::PushL(self);
       
    52     self->ConstructL(aContext);
       
    53     CleanupStack::Pop();
       
    54     return self;
       
    55     }
       
    56 
       
    57 // -----------------------------------------------------------------------------
       
    58 // CListManager::~CListManager
       
    59 // factory function
       
    60 // (other items were commented in a header).
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 CListManager::~CListManager()    
       
    64     {
       
    65     delete iListOneRowWithoutIcon;
       
    66     delete iListOneRowWithoutIconWithBubble;
       
    67     delete iListOneRowWithIcon;
       
    68     delete iListOneRowWithIconWithBubble;
       
    69     delete iListMultiRowWithIcon;
       
    70     delete iListMultiRowWithIconWithBubble;
       
    71     delete iListMultiRowWithoutIcon;
       
    72     delete iListMultiRowRollWithIcon;
       
    73     delete iListOneRowRollWithIcon;
       
    74     delete iListExpandableMultiRowWithoutIcon;
       
    75     delete iListMultiRowRollWithIconWithBubble;
       
    76     delete iListOneRowRollWithIconWithBubble;
       
    77     delete iListMultiRowWithoutIconWithBubble;
       
    78     }
       
    79         
       
    80 // -----------------------------------------------------------------------------
       
    81 // CListManager::NewL
       
    82 // 2nd construct function
       
    83 // (other items were commented in a header).
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 void CListManager::ConstructL(MFepCtrlDropdownListContext* aContext)
       
    87     {
       
    88     iContext = aContext;
       
    89     iListOneRowWithoutIcon = CListOneRowWithoutIcon::NewL(this, aContext);
       
    90     iListOneRowWithoutIconWithBubble = CListOneRowWithoutIconWithBubble::NewL(this, aContext);
       
    91     iListOneRowWithIcon = CListOneRowWithIcon::NewL(this, aContext);
       
    92     iListOneRowWithIconWithBubble = CListOneRowWithIconWithBubble::NewL(this, aContext);
       
    93     iListMultiRowWithIcon = CListMultiRowWithIcon::NewL(this, aContext);
       
    94     iListMultiRowWithIconWithBubble = CListMultiRowWithIconWithBubble::NewL(this, aContext);
       
    95     iListMultiRowWithoutIcon = CListMultiRowWithoutIcon::NewL(this, aContext);
       
    96     iListMultiRowRollWithIcon = CListMultiRowRollWithIcon::NewL(this, aContext);
       
    97     iListOneRowRollWithIcon = CListOneRowRollWithIcon::NewL(this, aContext);
       
    98     iListExpandableMultiRowWithoutIcon = CListExpandableMultiRowWithoutIcon::NewL(this, aContext);
       
    99     iListMultiRowRollWithIconWithBubble = CListMultiRowRollWithIconWithBubble::NewL(this, aContext);
       
   100     iListOneRowRollWithIconWithBubble = CListOneRowRollWithIconWithBubble::NewL(this, aContext);
       
   101     iListMultiRowWithoutIconWithBubble = CListMultiRowWithoutIconWithBubble::NewL(this, aContext);
       
   102     }
       
   103 
       
   104 // -----------------------------------------------------------------------------
       
   105 // CListManager::SizeChanged
       
   106 // size change
       
   107 // (other items were commented in a header).
       
   108 // -----------------------------------------------------------------------------
       
   109 //
       
   110 void CListManager::SizeChanged()
       
   111     {
       
   112     iListOneRowWithoutIcon->SizeChanged();    
       
   113     iListOneRowWithoutIconWithBubble->SizeChanged();   
       
   114     iListOneRowWithIcon->SizeChanged();
       
   115     iListOneRowWithIconWithBubble->SizeChanged();
       
   116     iListMultiRowWithIcon->SizeChanged();
       
   117     iListMultiRowWithIconWithBubble->SizeChanged();
       
   118     iListMultiRowWithoutIcon->SizeChanged();
       
   119     iListMultiRowRollWithIcon->SizeChanged();
       
   120     iListOneRowRollWithIcon->SizeChanged();
       
   121     iListExpandableMultiRowWithoutIcon->SizeChanged();
       
   122     iListMultiRowRollWithIconWithBubble->SizeChanged();
       
   123     iListOneRowRollWithIconWithBubble->SizeChanged();
       
   124     iListMultiRowWithoutIconWithBubble->SizeChanged();
       
   125     }
       
   126 
       
   127 // -----------------------------------------------------------------------------
       
   128 // CListManager::Move
       
   129 // move the list
       
   130 // (other items were commented in a header).
       
   131 // -----------------------------------------------------------------------------
       
   132 //
       
   133 void CListManager::Move(const TPoint& aOffset)
       
   134     {
       
   135     iListOneRowWithoutIcon->Move(aOffset);
       
   136     iListOneRowWithoutIconWithBubble->Move(aOffset);
       
   137     iListOneRowWithIcon->Move(aOffset);
       
   138     iListOneRowWithIconWithBubble->Move(aOffset);
       
   139     iListMultiRowWithIcon->Move(aOffset);
       
   140     iListMultiRowWithIconWithBubble->Move(aOffset);
       
   141     iListMultiRowWithoutIcon->Move(aOffset);
       
   142     iListMultiRowRollWithIcon->Move(aOffset);
       
   143     iListOneRowRollWithIcon->Move(aOffset);
       
   144     iListExpandableMultiRowWithoutIcon->Move(aOffset);
       
   145     iListMultiRowRollWithIconWithBubble->Move(aOffset);
       
   146     iListOneRowRollWithIconWithBubble->Move(aOffset);
       
   147     iListMultiRowWithoutIconWithBubble->Move(aOffset);
       
   148     
       
   149     // Move all candidates
       
   150     for ( TInt i=0; i<iContext->CandidateCount(); i++ )   
       
   151         {
       
   152         CCandidate* candidate = iContext->GetCandidate(i);
       
   153         if ( candidate )
       
   154             {
       
   155             candidate->Move(aOffset);        
       
   156             }       
       
   157         }    
       
   158     }
       
   159     
       
   160 // -----------------------------------------------------------------------------
       
   161 // CListManager::ActiveList
       
   162 // get active list
       
   163 // (other items were commented in a header).
       
   164 // -----------------------------------------------------------------------------
       
   165 //   
       
   166 CList* CListManager::ActiveList() const
       
   167     {
       
   168     return iActiveList;    
       
   169     }
       
   170 // -----------------------------------------------------------------------------
       
   171 // CListManager::SetActiveList
       
   172 // set active list
       
   173 // (other items were commented in a header).
       
   174 // -----------------------------------------------------------------------------
       
   175 //
       
   176 void CListManager::SetActiveList(CList* aList)
       
   177     {
       
   178     iActiveList = aList;
       
   179     }
       
   180 
       
   181 // -----------------------------------------------------------------------------
       
   182 // CListManager::ListOneRowWithoutIcon
       
   183 // get one row without icon
       
   184 // (other items were commented in a header).
       
   185 // -----------------------------------------------------------------------------
       
   186 //      
       
   187 CList* CListManager::ListOneRowWithoutIcon() const
       
   188     {
       
   189     return iListOneRowWithoutIcon;
       
   190     }
       
   191     
       
   192 // -----------------------------------------------------------------------------
       
   193 // CListManager::ListOneRowWithoutIcon
       
   194 // get one row without icon
       
   195 // (other items were commented in a header).
       
   196 // -----------------------------------------------------------------------------
       
   197 //      
       
   198 CList* CListManager::ListOneRowWithoutIconWithBubble() const
       
   199     {
       
   200     return iListOneRowWithoutIconWithBubble;
       
   201     }
       
   202     
       
   203 
       
   204 // -----------------------------------------------------------------------------
       
   205 // CListManager::ListOneRowWithIcon
       
   206 // get one row with icon
       
   207 // (other items were commented in a header).
       
   208 // -----------------------------------------------------------------------------
       
   209 //      
       
   210 CList* CListManager::ListOneRowWithIcon() const
       
   211     {
       
   212     return iListOneRowWithIcon;
       
   213     }
       
   214 
       
   215 // -----------------------------------------------------------------------------
       
   216 // CListManager::ListOneRowWithIcon
       
   217 // get one row with icon
       
   218 // (other items were commented in a header).
       
   219 // -----------------------------------------------------------------------------
       
   220 //      
       
   221 CList* CListManager::ListOneRowWithIconWithBubble() const
       
   222     {
       
   223     return iListOneRowWithIconWithBubble;
       
   224     }
       
   225 
       
   226 // -----------------------------------------------------------------------------
       
   227 // CListManager::ListMultiRowWithIcon
       
   228 // get multi row with icon
       
   229 // (other items were commented in a header).
       
   230 // -----------------------------------------------------------------------------
       
   231 //      
       
   232 CList* CListManager::ListMultiRowWithIcon() const
       
   233     {
       
   234     return iListMultiRowWithIcon;
       
   235     }
       
   236     
       
   237 CList* CListManager::ListMultiRowWithIconWithBubble() const
       
   238     {
       
   239     return iListMultiRowWithIconWithBubble;
       
   240     }    
       
   241     
       
   242 
       
   243 // -----------------------------------------------------------------------------
       
   244 // CListManager::ListMultiRowWithoutIcon
       
   245 // get multi row without icon
       
   246 // (other items were commented in a header).
       
   247 // -----------------------------------------------------------------------------
       
   248 //      
       
   249 CList* CListManager::ListMultiRowWithoutIcon() const
       
   250     {
       
   251     return iListMultiRowWithoutIcon;
       
   252     }    
       
   253 
       
   254 CList* CListManager::ListMultiRowRollWithIcon() const
       
   255     {
       
   256     return iListMultiRowRollWithIcon;
       
   257     }
       
   258 
       
   259 CList* CListManager::ListOneRowRollWithIcon() const
       
   260     {
       
   261     return iListOneRowRollWithIcon;
       
   262     }    
       
   263 
       
   264 CList* CListManager::ListExpandableMultiRowWithoutIcon() const
       
   265     {
       
   266     return iListExpandableMultiRowWithoutIcon;
       
   267     } 
       
   268 
       
   269 // -----------------------------------------------------------------------------
       
   270 // CListManager::ListMultiRowRollWithIconWithBubble
       
   271 // get one row roll with icon with bubble
       
   272 // (other items were commented in a header).
       
   273 // -----------------------------------------------------------------------------
       
   274 //        
       
   275 CList* CListManager::ListOneRowRollWithIconWithBubble() const    
       
   276     {
       
   277     return iListOneRowRollWithIconWithBubble;
       
   278     }
       
   279 
       
   280 // -----------------------------------------------------------------------------
       
   281 // CListManager::ListMultiRowRollWithIconWithBubble
       
   282 // get multi row roll with icon with bubble
       
   283 // (other items were commented in a header).
       
   284 // -----------------------------------------------------------------------------
       
   285 //        
       
   286 CList* CListManager::ListMultiRowRollWithIconWithBubble() const
       
   287     {
       
   288     return iListMultiRowRollWithIconWithBubble;
       
   289     }   
       
   290 
       
   291 CList* CListManager::ListMultiRowWithoutIconWithBubble() const
       
   292 	{
       
   293 	return iListMultiRowWithoutIconWithBubble;
       
   294 	}
       
   295     
       
   296 void CListManager::ResetStatus()
       
   297 	{
       
   298     ListOneRowWithoutIcon()->ResetStatus();
       
   299     ListOneRowWithoutIconWithBubble()->ResetStatus();
       
   300     ListMultiRowWithIcon()->ResetStatus();
       
   301     ListMultiRowWithIconWithBubble()->ResetStatus();
       
   302     ListOneRowWithIcon()->ResetStatus();		
       
   303     ListOneRowWithIconWithBubble()->ResetStatus();
       
   304     ListMultiRowRollWithIcon()->ResetStatus();
       
   305     ListOneRowRollWithIcon()->ResetStatus();
       
   306     ListOneRowRollWithIconWithBubble()->ResetStatus();
       
   307     ListMultiRowRollWithIconWithBubble()->ResetStatus();
       
   308 	}
       
   309 
       
   310 // End Of File