phonebookui/Phonebook2/Application/inc/CPbk2AppViewFactory.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Phonebook 2 application view factory.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2APPVIEWFACTORY_H
       
    20 #define CPBK2APPVIEWFACTORY_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32std.h>  // for TUid
       
    24 #include <e32base.h>
       
    25 
       
    26 //  FORWARD DECLARATIONS
       
    27 class CAknView;
       
    28 class CPbk2AppUi;
       
    29 class CPbk2UIExtensionManager;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34  * Phonebook 2 application view factory. CPbk2AppUi uses this class
       
    35  * to create the application view objects. Removes direct dependencies
       
    36  * from CPbk2AppUi to application view classes.
       
    37  */
       
    38 class CPbk2AppViewFactory : public CBase
       
    39     {
       
    40     public: // Constructors and destructor
       
    41 
       
    42         /**
       
    43          * Creates a new instance of this class.
       
    44          *
       
    45          * @param aAppUi    Application UI.
       
    46          * @return  A new instance of this class.
       
    47          */
       
    48         static CPbk2AppViewFactory* NewL(
       
    49                 CPbk2AppUi& aAppUi );
       
    50 
       
    51         /**
       
    52          * Creates a new instance of this class.
       
    53          *
       
    54          * @param aAppUi    Application UI.
       
    55          * @return  A new instance of this class.
       
    56          */
       
    57         static CPbk2AppViewFactory* NewLC(
       
    58                 CPbk2AppUi& aAppUi );
       
    59 
       
    60         /**
       
    61          * Destructor.
       
    62          */
       
    63         ~CPbk2AppViewFactory();
       
    64 
       
    65     public: // Interface
       
    66 
       
    67         /**
       
    68          * Creates and returns application view with the given UID.
       
    69          *
       
    70          * @param aId               The UID of the view.
       
    71          * @exception KErrNoMemory  If out of memory.
       
    72          * @exception               Anything thrown during the
       
    73          *                          initialisation of the view.
       
    74          * @return  A new application view instance.
       
    75          */
       
    76         CAknView* CreateAppViewL(
       
    77                 TUid aId );
       
    78 
       
    79         /**
       
    80          * Creates and returns application view with the given UID.
       
    81          *
       
    82          * @param aId               The UID of the view.
       
    83          * @exception KErrNoMemory  If out of memory.
       
    84          * @exception               Anything thrown during the
       
    85          *                          initialisation of the view.
       
    86          * @return  A new application view instance.
       
    87          */
       
    88         CAknView* CreateAppViewLC(
       
    89                 TUid aId );
       
    90 
       
    91     private: // Implementation
       
    92         CPbk2AppViewFactory(
       
    93                 CPbk2AppUi& aAppUi );
       
    94         void ConstructL();
       
    95 
       
    96     private: // Data
       
    97         /// Own: Extension manager
       
    98         CPbk2UIExtensionManager* iExtensionManager;
       
    99         /// Ref: Application UI
       
   100         CPbk2AppUi& iAppUi;
       
   101     };
       
   102 
       
   103 #endif // CPBK2APPVIEWFACTORY_H
       
   104 
       
   105 // End of File