phonebookui/pbkcommonui/src/cntdefaultviewfactory.cpp
changeset 65 ae724a111993
parent 59 a642906a277a
child 71 7cc7d74059f9
equal deleted inserted replaced
59:a642906a277a 65:ae724a111993
    36 #include "cnteditview.h"
    36 #include "cnteditview.h"
    37 #include "cntimportsview.h"
    37 #include "cntimportsview.h"
    38 #include "cntsettingsview.h"
    38 #include "cntsettingsview.h"
    39 #include "cntextensionmanager.h"
    39 #include "cntextensionmanager.h"
    40 
    40 
    41 CntDefaultViewFactory::CntDefaultViewFactory():
    41 CntDefaultViewFactory::CntDefaultViewFactory( CntExtensionManager& aExt ):
    42     mExtensionManager(NULL)
    42     mExtensionManager( aExt )
    43 {
    43 {
    44     mExtensionManager = new CntExtensionManager();
       
    45     HbStyleLoader::registerFilePath( ":/style" );
    44     HbStyleLoader::registerFilePath( ":/style" );
    46 }
    45 }
    47 
    46 
    48 CntDefaultViewFactory::~CntDefaultViewFactory()
    47 CntDefaultViewFactory::~CntDefaultViewFactory()
    49 {
    48 {
    50     delete mExtensionManager;
       
    51 }
    49 }
    52 
    50 
    53 CntAbstractView* CntDefaultViewFactory::createView( int aId )
    51 CntAbstractView* CntDefaultViewFactory::createView( int aId )
    54 {
    52 {
    55     switch ( aId )
    53     switch ( aId )
    56     {
    54     {
    57     case namesView:
    55     case namesView:
    58         return new CntNamesView(*mExtensionManager);
    56         return new CntNamesView();
    59     case contactCardView:
    57     case contactCardView:
    60         return new CntContactCardView();
    58         return new CntContactCardView();
    61     case myCardView:
    59     case myCardView:
    62         return new CntMyCardView();
    60         return new CntMyCardView();
    63     case collectionView:
    61     case collectionView:
    64         return new CntCollectionView(*mExtensionManager);
    62         return new CntCollectionView();
    65     case collectionFavoritesView:
    63     case collectionFavoritesView:
    66         return new CntFavoritesView();
    64         return new CntFavoritesView();
    67     case favoritesMemberView:
    65     case favoritesMemberView:
    68         return new CntFavoritesMemberView();
    66         return new CntFavoritesMemberView();
    69     case editView:
    67     case editView:
   101     return NULL;
    99     return NULL;
   102 }
   100 }
   103 
   101 
   104 CntAbstractView* CntDefaultViewFactory::createPluginView( int aId )
   102 CntAbstractView* CntDefaultViewFactory::createPluginView( int aId )
   105 {
   103 {
   106     for(int i = 0;i < mExtensionManager->pluginCount();i++)
   104     for(int i = 0;i < mExtensionManager.pluginCount();i++)
   107     {
   105     {
   108         CntViewSupplier* viewSupplier = mExtensionManager->pluginAt(i)->viewSupplier();
   106         CntViewSupplier* viewSupplier = mExtensionManager.pluginAt(i)->viewSupplier();
   109         if (viewSupplier)
   107         if (viewSupplier)
   110         {
   108         {
   111             for(int j = 0;j < viewSupplier->viewCount();j++)
   109             for(int j = 0;j < viewSupplier->viewCount();j++)
   112             {
   110             {
   113                 if (viewSupplier->viewIdAt(j) == aId)
   111                 if (viewSupplier->viewIdAt(j) == aId)