epoc32/include/app/cpbksingleitemfetchdlg.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/app/cpbksingleitemfetchdlg.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/app/cpbksingleitemfetchdlg.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,179 @@
     1.4 -cpbksingleitemfetchdlg.h
     1.5 +/*
     1.6 +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description: 
    1.19 +*      Phonebook Single Item Fetch API.
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +#ifndef __CPbkSingleItemFetchDlg_H__
    1.25 +#define __CPbkSingleItemFetchDlg_H__
    1.26 +
    1.27 +//  INCLUDES
    1.28 +#include <e32base.h>    // CBase
    1.29 +#include <cntdef.h>     // TContactItemId
    1.30 +
    1.31 +//  FORWARD DECLARATIONS
    1.32 +class CContactViewBase;
    1.33 +class CPbkFetchDlg;
    1.34 +class CPbkSelectFieldDlg;
    1.35 +class CPbkContactEngine;
    1.36 +class CPbkFieldIdArray;
    1.37 +class CPbkContactItem;
    1.38 +class TPbkContactItemField;
    1.39 +class MObjectProvider;
    1.40 +
    1.41 +
    1.42 +// CLASS DECLARATION
    1.43 +
    1.44 +/**
    1.45 + * Phonebook Single Item Fetch API. This class is used to construct 
    1.46 + * a Phonebook UI dialog where the user is able to select a single 
    1.47 + * contact entry from a contact list. Then the user must select a 
    1.48 + * particular field of that selected contact. The selected contact 
    1.49 + * item and field are then returned to the client.
    1.50 + */
    1.51 +class CPbkSingleItemFetchDlg : public CBase
    1.52 +    {
    1.53 +    public:  // Types
    1.54 +        /**
    1.55 +         * Single item fetch parameter class. 
    1.56 +         */
    1.57 +        class TParams
    1.58 +            {
    1.59 +            public:  // Input parameters
    1.60 +                /**
    1.61 +                 * Contact view to display. If NULL, loads the default
    1.62 +                 * contact view containing all names in the contact
    1.63 +                 * database.
    1.64 +                 */
    1.65 +                CContactViewBase* iContactView;
    1.66 +
    1.67 +                /**
    1.68 +                 * Array of field types to fetch.
    1.69 +                 */
    1.70 +                const CPbkFieldIdArray* iFieldIdArray;
    1.71 +
    1.72 +            public:  // Output parameters
    1.73 +                /**
    1.74 +                 * Returns an contact item of the selected entry, undefined 
    1.75 +                 * if the dialog is canceled. Caller is responsible of 
    1.76 +                 * deleting iContactItem.
    1.77 +                 */
    1.78 +                CPbkContactItem* iContactItem;
    1.79 +
    1.80 +                /**
    1.81 +                 * Returns a field of the selected entry, undefined if the 
    1.82 +                 * dialog is canceled. This is iContactItem's field so it 
    1.83 +                 * is deleted when iContactItem is deleted.
    1.84 +                 */
    1.85 +                TPbkContactItemField* iContactItemField;
    1.86 +
    1.87 +            public: // Additional input parameters
    1.88 +                /**
    1.89 +                 * OPTIONAL: Fetch softkey resource ID.
    1.90 +                 * If 0, Default softkeys are used.
    1.91 +                 */
    1.92 +                TInt iCbaId;
    1.93 +
    1.94 +            public:  // Constructors
    1.95 +                /**
    1.96 +                 * C++ constructor.
    1.97 +                 */
    1.98 +                IMPORT_C TParams();
    1.99 +
   1.100 +                // Compiler-generated destructor is ok for this class
   1.101 +
   1.102 +                /**
   1.103 +                 * Returns a cleanup item which will handle cleanup of this
   1.104 +                 * object in case a leave occurs.
   1.105 +                 */
   1.106 +                IMPORT_C operator TCleanupItem();
   1.107 +
   1.108 +            private: // Implementation
   1.109 +                static void Cleanup(TAny* aSelf);
   1.110 +
   1.111 +            private:  // Unimplemented functions
   1.112 +                /// Unimplemented copy constructor
   1.113 +                TParams(const TParams&);
   1.114 +                /// Unimplemented assignment operator
   1.115 +                TParams& operator=(const TParams&);
   1.116 +
   1.117 +            private:  // data
   1.118 +				/// Own: spare data
   1.119 +                TInt32 iSpare1;
   1.120 +            };
   1.121 +
   1.122 +    public:  // Interface
   1.123 +        /**
   1.124 +         * Creates a new single entry fetch dialog.
   1.125 +         *
   1.126 +         * @param aParams   Fetch parameters, @see TParams
   1.127 +         * @param aEngine   Phonebook engine
   1.128 +         */
   1.129 +        IMPORT_C static CPbkSingleItemFetchDlg* NewL
   1.130 +            (TParams& aParams, CPbkContactEngine& aEngine);
   1.131 +
   1.132 +        /**
   1.133 +         * @see CCoeControl::SetMopParent(MObjectProvider* aParent)
   1.134 +         */
   1.135 +        IMPORT_C void SetMopParent(MObjectProvider* aParent);
   1.136 +
   1.137 +        /**
   1.138 +         * Executes this dialog.
   1.139 +         * NOTE: this object is deleted when ExecuteLD returns or leaves!
   1.140 +         * NOTE: current status pane layout is replaced with the Phonebook
   1.141 +         * one. Restoring the original pane is left to be the responsibility
   1.142 +         * of the caller.
   1.143 +         *
   1.144 +         * @return A non-zero value if not canceled.
   1.145 +         */
   1.146 +        IMPORT_C TInt ExecuteLD();
   1.147 +
   1.148 +        /**
   1.149 +         * Destructor. Also cancels this dialog if ExecuteLD() has been called.
   1.150 +         */
   1.151 +        ~CPbkSingleItemFetchDlg();
   1.152 +
   1.153 +    private:  // Implementation
   1.154 +        CPbkSingleItemFetchDlg(TParams& aParams, CPbkContactEngine& aEngine);
   1.155 +        void ConstructL();
   1.156 +        TBool EntryFetchAcceptedL(TContactItemId aCid);
   1.157 +        class TFetchCallback;
   1.158 +        friend class TFetchCallback;
   1.159 +
   1.160 +    private:  // Data
   1.161 +        /// Own: parameters
   1.162 +        TParams& iParams;
   1.163 +        /// Ref: contact view containing contacts to choose from
   1.164 +        CContactViewBase* iContactView;
   1.165 +        /// Own: fetch dialog
   1.166 +        CPbkFetchDlg* iFetchDlg;
   1.167 +        /// Own: field selection dialog
   1.168 +        CPbkSelectFieldDlg* iFieldDlg;
   1.169 +        /// Own: Phonebook engine
   1.170 +        CPbkContactEngine& iPbkEngine;
   1.171 +        /// Own: contact item to return to user via iParams
   1.172 +        CPbkContactItem* iContactItem;
   1.173 +        /// Own: contact item field to return to user via iParams
   1.174 +        TPbkContactItemField* iContactItemField;
   1.175 +        /// Ref: set to ETrue in destructor
   1.176 +        TBool* iDestroyedPtr;
   1.177 +        /// Own: object provicer
   1.178 +        MObjectProvider* iObjectProvider;
   1.179 +    };
   1.180 +
   1.181 +#endif // __CPbkSingleItemFetchDlg_H__
   1.182 +
   1.183 +// End of File