uiservicetab/vimpstui/inc/mvimpstuitabcontrolfactory.h
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     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:  Factory implementation  of the tabbed view controls
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "cvimpstuidoublelistboxtabviewcontrol.h"  // container with double line listbox
       
    20 #include "cvimpstuisinglelistboxtabviewcontrol.h" // container with single line listbox
       
    21 #include "mvimpstengine.h"
       
    22 
       
    23 
       
    24 class MVIMPSTUiTabbedViewControlFactory
       
    25     {
       
    26 public:
       
    27     
       
    28     /**
       
    29      * creates the MVIMPSTUiTabbedViewControl implementations based on the 
       
    30      * presence availability of the service : OWNERSHIP TO THE CALLER
       
    31      *  
       
    32      * it checks from aEngine.IsPresenceEnabled() ; the presence availability
       
    33      *  then it creates the corresponding container
       
    34      * 
       
    35      * @param aTabbedView reference to view.
       
    36      * @param aKeyEventHandler Key event handler to be used
       
    37      * @param aCommandHandler reference to commandhandler
       
    38      * @param aServiceId Id of the service
       
    39      * @param aBrandHandler reference to brandhandler
       
    40      * @param aEngine reference to engine
       
    41      *
       
    42      * @return MVIMPSTUiTabbedViewControl object based on the presence availability
       
    43      * : OWNERSHIP TO THE CALLER
       
    44      */
       
    45     static  MVIMPSTUiTabbedViewControl* NewTabControlL( CVIMPSTUiTabbedView& aTabbedView,
       
    46                                                         MPbk2KeyEventHandler* aKeyEventHandler, 
       
    47                                                         MVIMPSTCmdHandler& aCommandHandler,
       
    48                                                         TUint32 aServiceId,
       
    49                                                         CVIMPSTUiBrandData& aBrandHandler,
       
    50                                                         MVIMPSTEngine& aEngine,
       
    51                                                         CEikButtonGroupContainer* aCba)
       
    52                                                         
       
    53         {
       
    54         // LOGIC : IF presence is enabled for that service then 
       
    55         // it creates  double listbox control 
       
    56         // if presencxe is NOT Enabled creates single listbox control
       
    57         if( aEngine.SubService( TVIMPSTEnums::EPresence) )
       
    58             {
       
    59             return CVIMPSTUiDoubleListBoxTabViewControl::NewL(  aTabbedView,
       
    60                     aKeyEventHandler,
       
    61                     aCommandHandler,
       
    62                     aServiceId, 
       
    63                     aBrandHandler ,
       
    64                     aEngine,
       
    65                     aCba);
       
    66 
       
    67             }
       
    68         else
       
    69             {
       
    70             return CVIMPSTUiSingleListBoxTabViewControl::NewL(  aTabbedView,
       
    71                     aKeyEventHandler,
       
    72                     aCommandHandler,
       
    73                     aServiceId, 
       
    74                     aBrandHandler ,
       
    75                     aEngine,
       
    76                     aCba);
       
    77             }
       
    78         }
       
    79     
       
    80     };