epoc32/include/app/cpbkmultipleentryfetchdlg.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2002 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: 
    15 *      Phonebook Multiple Entry Fetch API.
    16 *
    17 */
    18 
    19 
    20 #ifndef __CPbkMultipleEntryFetchDlg_H__
    21 #define __CPbkMultipleEntryFetchDlg_H__
    22 
    23 //  INCLUDES
    24 #include <e32base.h>    // CBase
    25 
    26 //  FORWARD DECLARATIONS
    27 class CPbkContactEngine;
    28 class CContactViewBase;
    29 class CContactIdArray;
    30 class CPbkFetchDlg;
    31 class MObjectProvider;
    32 class MPbkFetchDlgSelection;
    33 
    34 
    35 // CLASS DECLARATION
    36 
    37 /**
    38  * Phonebook Multiple Entry Fetch API. This class is used to construct 
    39  * a Phonebook UI dialog where the user is able to select multiple
    40  * contact entries from a list. The selection is then returned to the 
    41  * client.
    42  */
    43 class CPbkMultipleEntryFetchDlg : public CBase
    44     {
    45     public:  // Types
    46         /**
    47          * Multiple entry fetch parameter class. 
    48          */
    49         class TParams
    50             {
    51             public:  // Input parameters
    52                 /**
    53                  * Contact view to display. If NULL loads the default
    54                  * contact view containing all names in the contact
    55                  * database.
    56                  */
    57                 CContactViewBase* iContactView;
    58 
    59             public:  // Output parameters
    60                 /**
    61                  * Returns an array of ids of the selected entries,
    62                  * undefined if the dialog is canceled.
    63                  * Caller must delete iMarkedEntries when no longer needed.
    64                  */
    65                 CContactIdArray* iMarkedEntries;
    66 
    67             public: // Additional input parameters
    68                 /**
    69                  * OPTIONAL: Fetch softkey resource ID. 
    70                  * If 0, default softkeys are used.
    71                  */
    72                 TInt iCbaId;
    73                 
    74                 /**
    75                  * OPTIONAL: Fetch selection accepter. 
    76                  * If NULL, not applicable.                 
    77                  */
    78                 MPbkFetchDlgSelection* iFetchSelection;
    79 
    80             public:  // Interface
    81                 /**
    82                  * C++ constructor.
    83                  */
    84                 IMPORT_C TParams();
    85 
    86                 // Compiler-generated destructor is ok for this class
    87 
    88                 /**
    89                  * Returns a cleanup item which will handle cleanup of this
    90                  * object in case of a leave.
    91                  */
    92                 IMPORT_C operator TCleanupItem();
    93 
    94             private:  // Implementation
    95                 static void Cleanup(TAny* aPtr);
    96 
    97             private:  // Unimplemented functions
    98                 /// Unimplemented copy constructor
    99                 TParams(const TParams&);
   100                 /// Unimplemented assignment operator
   101                 TParams& operator=(const TParams&);
   102             };
   103 
   104     public:  // Interface
   105         /**
   106          * Creates a new multiple entry fetch dialog.
   107          *
   108          * @param aParams   Fetch parameters, see TParams.
   109          * @param aEngine   Phonebook engine.
   110          * @return A new instance of this class.
   111          */
   112         IMPORT_C static CPbkMultipleEntryFetchDlg* NewL
   113             (TParams& aParams, CPbkContactEngine& aEngine);
   114 
   115         /**
   116          * See CCoeControl::SetMopParent(MObjectProvider* aParent)
   117          */
   118         IMPORT_C void SetMopParent(MObjectProvider* aParent);
   119 
   120         /**
   121          * Executes this dialog.
   122          * NOTE: this object is deleted when ExecuteLD returns or leaves!
   123          * NOTE: current status pane layout is replaced with the Phonebook
   124          * one. Restoring the original pane is left to be the responsibility
   125          * of the caller.
   126          *
   127          * @return A non-zero value if accepted, zero if canceled.
   128          */
   129         IMPORT_C TInt ExecuteLD();
   130 
   131         /**
   132          * Destructor. Also cancels this dialog and makes ExecuteLD return.
   133          */
   134         ~CPbkMultipleEntryFetchDlg();
   135 
   136     private:  // Implementation
   137         CPbkMultipleEntryFetchDlg(TParams& aParams, CPbkContactEngine& aEngine);
   138         void ConstructL();
   139         static void Panic(TInt aReason);
   140 
   141     private:  // Data
   142         /// Own: parameters
   143         TParams& iParams;
   144         /// Own: fetch dialog
   145         CPbkFetchDlg* iFetchDlg;
   146         /// Ref: Phonebook engine
   147         CPbkContactEngine& iPbkEngine;
   148         /// Ref: set to ETrue in destructor
   149         TBool* iDestroyedPtr;
   150         /// Own: Object Provider
   151         MObjectProvider* iObjectProvider;
   152     };
   153 
   154 #endif // __CPbkMultipleEntryFetchDlg_H__
   155 
   156 // End of File