phonebookui/Phonebook/inc/CPbkGroupMembersFetchDlg.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     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 Group members Fetch API.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CPbkGroupMembersFetchDlg_H__
       
    21 #define __CPbkGroupMembersFetchDlg_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>    // CBase
       
    25 #include <cntviewbase.h> // MContactViewObserver
       
    26 
       
    27 //  FORWARD DECLARATIONS
       
    28 class CPbkContactEngine;
       
    29 class CContactIdArray;
       
    30 class CPbkFetchDlg;
       
    31 class CContactGroupView;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * @internal Only Phonebook internal use supported!
       
    37  *
       
    38  * Phonebook Group Members Fetch API.
       
    39  */
       
    40 class CPbkGroupMembersFetchDlg : public CBase, private MContactViewObserver
       
    41     {
       
    42     public:  // Types
       
    43         /**
       
    44          * Fetch parameters class.
       
    45          */
       
    46         class TParams
       
    47             {
       
    48             public:  // Input parameters
       
    49                 /**
       
    50                  * MANDATORY: Contact group to get label and show query.
       
    51                  */
       
    52                 TContactItemId iGroupId;
       
    53 
       
    54             public:  // Output parameters
       
    55                 /**
       
    56                  * Returns the marked entries.
       
    57                  * Caller must delete iMarkedEntries when no longer needed.
       
    58                  */
       
    59                 CContactIdArray* iMarkedEntries;
       
    60 
       
    61             public:  // Functions
       
    62                 /**
       
    63                  * C++ Constructor.
       
    64                  */
       
    65                 IMPORT_C TParams();
       
    66 
       
    67                 /**
       
    68                  * Returns a cleanup item which will release all resources
       
    69                  * held by this object in case a leave occurs.
       
    70                  */
       
    71                 IMPORT_C operator TCleanupItem();
       
    72 
       
    73                 // Compiler-generated destructor is ok for this class
       
    74 
       
    75             private:  // Implementation
       
    76                 static void Cleanup(TAny* aPtr);
       
    77 
       
    78             private:  // Unimplemented functions
       
    79                 /// Unimplemented copy constructor
       
    80                 TParams(const TParams&);
       
    81                 /// Unimplemented assignment operator
       
    82                 TParams& operator=(const TParams&);
       
    83             };
       
    84 
       
    85     public:  // Interface
       
    86         /**
       
    87          * Creates a new group members fetch dialog.
       
    88          *
       
    89          * @param aParams @see TParams
       
    90          * @param aPbkEngine reference to phonebook engine
       
    91          */
       
    92         IMPORT_C static CPbkGroupMembersFetchDlg* NewL(TParams& aParams,
       
    93             CPbkContactEngine& aPbkEngine);
       
    94 
       
    95         /**
       
    96          * Executes this dialog.
       
    97          * NOTE: this object is deleted when ExecuteLD returns or leaves!
       
    98          *
       
    99          * @return !=0 if not canceled.
       
   100          */
       
   101         IMPORT_C TInt ExecuteLD();
       
   102 
       
   103         /**
       
   104          * Destructor. Also makes ExecuteLD() return like the dialog was
       
   105          * cancelled.
       
   106          */
       
   107         ~CPbkGroupMembersFetchDlg();
       
   108 
       
   109     private: // from MContactViewObserver
       
   110         void HandleContactViewEvent(const CContactViewBase& aView,
       
   111             const TContactViewEvent& aEvent);
       
   112 
       
   113     private:  // Implementation
       
   114         CPbkGroupMembersFetchDlg(TParams& aParams,
       
   115             CPbkContactEngine& aPbkEngine);
       
   116         void ConstructL();
       
   117 
       
   118     private:  // Data
       
   119         /// Own: parameters
       
   120         TParams& iParams;
       
   121         /// Ref: Phonebook Engine
       
   122         CPbkContactEngine& iPbkEngine;
       
   123         /// Own: fetch dialog
       
   124         CPbkFetchDlg* iFetchDlg;
       
   125         /// Ref: Referred TBool is set ETrue in destructor
       
   126         TBool* iDestroyedPtr;
       
   127         /// Own: Group non members sub view
       
   128         CContactGroupView* iGroupNonMembersSubView;
       
   129     };
       
   130 
       
   131 #endif // __CPbkGroupMembersFetchDlg_H__
       
   132 
       
   133 // End of File