phoneapp/phoneuiview/inc/cphonecontactcontroller.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     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:  Manager for contacts.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CPHONECONTACTCONTROLLER_H
       
    21 #define CPHONECONTACTCONTROLLER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include    <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CPhoneCntManagerBase;
       
    28 class CPhCntFactory;
       
    29 class CPhCntSingleItemFetch;
       
    30 class CPhoneCntVoiceKeyImp;
       
    31 class CPhoneCntSaveAddToName;
       
    32 class CPhCntRfsHandler;
       
    33 class CPhCntSpeedDialMonitor; 
       
    34 
       
    35 // CONSTANTS
       
    36 const TInt KConstructAll = -1;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  It is manager for contacts.
       
    42 */
       
    43 class CPhoneContactController 
       
    44     : public CBase
       
    45     {
       
    46     public:  // Constructors and destructor      
       
    47         
       
    48         /**
       
    49         * Two-phased constructor.
       
    50         */
       
    51         static CPhoneContactController* NewL();
       
    52         
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         ~CPhoneContactController();
       
    57 
       
    58     public: // New functions
       
    59 
       
    60         /**
       
    61         * Perform steps in construction.
       
    62         *
       
    63         * @param aSteps steps to be performed, one by default
       
    64         * @return steps to be done.
       
    65         */
       
    66         TInt ContinueConstructL( TInt aSteps = 1 );
       
    67 
       
    68         /**
       
    69         * Returns amount of steps to be done.
       
    70         *
       
    71         * @return steps to be done, 0 if everything ok.
       
    72         */
       
    73         TInt ConstructionSteps() const;
       
    74 
       
    75         /**
       
    76         * Creates single item fetcher.
       
    77         * 
       
    78         * @return single item fetcher, ownership transferred.
       
    79         */
       
    80         CPhCntSingleItemFetch* CreateSingleItemFetchL();
       
    81       
       
    82         /**
       
    83         * Creates object from which pbk operations add
       
    84         * and save are possible
       
    85         *
       
    86         * @return CPhoneCntSaveAddToName, ownership transferred.
       
    87         */
       
    88         CPhoneCntSaveAddToName* CreateSaveAddToNameL();
       
    89         
       
    90         /**
       
    91         * Creates Restore Factory Settings handler.
       
    92         *
       
    93         * @return instance of restore factory settings handler
       
    94         */
       
    95         CPhCntRfsHandler* CreateRfsHandlerL();
       
    96         
       
    97         /**
       
    98         * Creates Speed dial monitor handler.
       
    99         *
       
   100         * @return instance of speed dial monitor handler
       
   101         */
       
   102         CPhCntSpeedDialMonitor* CreateSpeedDialMonitorL();
       
   103         
       
   104         /**
       
   105         * Creates phonebook services, stores etc.
       
   106         */
       
   107         void CreatePhoneBookServiceL();
       
   108 
       
   109     private:
       
   110 
       
   111         // It defines enumeration for steps in construction.
       
   112         enum TStep
       
   113             {
       
   114             EStepLoadLibrary,
       
   115             EStepCreateFactory,
       
   116             EStepDone
       
   117             };
       
   118 
       
   119         /**
       
   120         * C++ default constructor.
       
   121         */
       
   122         CPhoneContactController();
       
   123         
       
   124         /**
       
   125         * Perform a step.
       
   126         */
       
   127         void DoStepL();
       
   128 
       
   129         /**
       
   130         * Determine next step.
       
   131         *
       
   132         * @param aStep current step.
       
   133         * @return next step.
       
   134         */
       
   135         static TStep NextStep( TStep aStep );
       
   136 
       
   137         /**
       
   138         * Load library.
       
   139         */
       
   140         void ConstructLoadLibraryL();
       
   141 
       
   142         /**
       
   143         * Create factory.
       
   144         */
       
   145         void ConstructCreateFactoryL();
       
   146 
       
   147         // By default, prohibit copy constructor
       
   148         CPhoneContactController( const CPhoneContactController& );
       
   149         // Prohibit assigment operator
       
   150         CPhoneContactController& operator= ( const CPhoneContactController& );
       
   151 
       
   152     private:    // Data
       
   153         
       
   154         // Owned: library.
       
   155         RLibrary iLibrary;
       
   156 
       
   157         // Owned: contact factory.
       
   158         CPhCntFactory* iFactory;
       
   159 
       
   160         // Current situation.
       
   161         TStep iCurrentStep;
       
   162     };
       
   163 
       
   164 #endif // CPhoneContactController_H
       
   165 
       
   166 // End of File