phonebookui/Speeddial/src/SpdiaCallingVmbxContainer.cpp
changeset 0 e686773b3f54
child 21 9da50d567e3c
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2004 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:     Declares container control for application.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include <SpdCtrl.rsg>
       
    25 
       
    26 #include "speeddialprivate.h"
       
    27 #include "SpdiaCallingVmbxContainer.h"
       
    28 #include <CVPbkContactStoreUriArray.h>
       
    29 #include <VPbkContactStoreUris.h>
       
    30 #include <TVPbkContactStoreUriPtr.h>
       
    31 #include <CPbk2StoreConfiguration.h>
       
    32 
       
    33 // ========================= MEMBER FUNCTIONS ================================
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // CSpdiaCallingVmbxContainer::CSpdiaCallingVmbxContainer
       
    37 // Constructor
       
    38 // ---------------------------------------------------------------------------
       
    39 CSpdiaCallingVmbxContainer::CSpdiaCallingVmbxContainer():
       
    40 							iContactManager(NULL),iControl(NULL)
       
    41 															
       
    42     {
       
    43     }
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // CSpdiaCallingVmbxContainer::NewL
       
    47 // Symbian two-phased constructor
       
    48 // ---------------------------------------------------------------------------
       
    49 CSpdiaCallingVmbxContainer* CSpdiaCallingVmbxContainer::NewL()
       
    50     {
       
    51     CSpdiaCallingVmbxContainer* self = CSpdiaCallingVmbxContainer::NewLC();
       
    52     CleanupStack::Pop( self );
       
    53     return self;
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // CSpdiaCallingVmbxContainer::NewLC
       
    58 // Symbian two-phased constructor
       
    59 // ---------------------------------------------------------------------------
       
    60 CSpdiaCallingVmbxContainer* CSpdiaCallingVmbxContainer::NewLC()
       
    61     {
       
    62     CSpdiaCallingVmbxContainer* self =
       
    63         new ( ELeave ) CSpdiaCallingVmbxContainer;
       
    64     CleanupStack::PushL( self );
       
    65     self->ConstructL();
       
    66     return self;
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // CSpdiaCallingVmbxContainer::ConstructL
       
    71 // Symbian two phased constructor
       
    72 // ---------------------------------------------------------------------------
       
    73 void CSpdiaCallingVmbxContainer::ConstructL()
       
    74     {
       
    75     CreateWindowL();
       
    76 
       
    77     iControl = NULL;
       
    78     
       
    79     CPbk2StoreConfiguration* configuration = CPbk2StoreConfiguration::NewL();
       
    80     CleanupStack::PushL(configuration);
       
    81     CVPbkContactStoreUriArray* uriArray = configuration->CurrentConfigurationL();
       
    82     CleanupStack::PushL(uriArray);
       
    83     iContactManager = CVPbkContactManager::NewL(*uriArray);
       
    84     CleanupStack::PopAndDestroy(2); // uriArray, configuration
       
    85     
       
    86     iControl = CSpeedDialPrivate::NewL(iContactManager);
       
    87 
       
    88     ActivateL();
       
    89     }
       
    90 
       
    91 // ---------------------------------------------------------------------------
       
    92 // CSpdiaCallingVmbxContainer::~CSpdiaCallingVmbxContainer
       
    93 // Destructor
       
    94 // ---------------------------------------------------------------------------
       
    95 CSpdiaCallingVmbxContainer::~CSpdiaCallingVmbxContainer()
       
    96     {
       
    97     
       
    98     delete iControl;
       
    99     delete iContactManager;	
       
   100     iControl = NULL;
       
   101     
       
   102     }
       
   103 
       
   104 // ---------------------------------------------------------------------------
       
   105 // CSpdiaCallingVmbxContainer::SizeChanged
       
   106 // Called by framework when the view size is changed
       
   107 // ---------------------------------------------------------------------------
       
   108 void CSpdiaCallingVmbxContainer::SizeChanged()
       
   109     {
       
   110     iControl->SetLayout( Rect() );
       
   111     }
       
   112 
       
   113 // ---------------------------------------------------------------------------
       
   114 // CSpdiaCallingVmbxContainer::CountComponentControls
       
   115 //
       
   116 // ---------------------------------------------------------------------------
       
   117 TInt CSpdiaCallingVmbxContainer::CountComponentControls() const
       
   118     {
       
   119     return 1;
       
   120     }
       
   121 
       
   122 // ---------------------------------------------------------------------------
       
   123 // CSpdiaCallingVmbxContainer::ComponentControl
       
   124 //
       
   125 // ---------------------------------------------------------------------------
       
   126 CCoeControl* CSpdiaCallingVmbxContainer::ComponentControl(
       
   127                                              TInt /*aIndex*/ ) const
       
   128     {
       
   129     return iControl;
       
   130     }
       
   131 
       
   132 // End of File