epoc32/include/app/cpbksingleentryfetchdlg.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/app/cpbksingleentryfetchdlg.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/app/cpbksingleentryfetchdlg.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,177 @@
     1.4 -cpbksingleentryfetchdlg.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 Entry Fetch dialog API.
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +#ifndef __CPbkSingleEntryFetchDlg_H__
    1.25 +#define __CPbkSingleEntryFetchDlg_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 CPbkContactEngine;
    1.35 +class MObjectProvider;
    1.36 +class MPbkFetchKeyCallback;
    1.37 +class MPbkFetchDlgAccept;
    1.38 +
    1.39 +
    1.40 +// CLASS DECLARATION
    1.41 +/**
    1.42 + * Phonebook Single Entry Fetch API. This class is used to construct 
    1.43 + * a Phonebook UI dialog where the user is able to select a single 
    1.44 + * contact entry from a contact list. The user selection is then returned 
    1.45 + * to the client.
    1.46 + */
    1.47 +class CPbkSingleEntryFetchDlg : 
    1.48 +        public CBase
    1.49 +    {
    1.50 +    public:  // Types
    1.51 +        /**
    1.52 +         * Single entry fetch parameter class. 
    1.53 +         */
    1.54 +        class TParams
    1.55 +            {
    1.56 +            public:  // Input parameters
    1.57 +                /**
    1.58 +                 * Contact database. If NULL, the contact database is 
    1.59 +                 * retrieved from TLS or constructed if not available.
    1.60 +                 * If you have a Contact database on the client side
    1.61 +                 * please supply it here. 
    1.62 +                 */
    1.63 +                CPbkContactEngine* iPbkEngine;
    1.64 +
    1.65 +                /**
    1.66 +                 * Contact view to display. If NULL, loads the default
    1.67 +                 * contact view containing all names in the contact
    1.68 +                 * database.
    1.69 +                 * @see CPbkContactEngine::AllContactsView()
    1.70 +                 * @see CPbkContactEngine::FilteredContactsViewL()
    1.71 +                 */
    1.72 +                CContactViewBase* iContactView;
    1.73 +
    1.74 +                /**
    1.75 +                 * OPTIONAL: Fetch key event callback. 
    1.76 +                 * If NULL, not applicable.
    1.77 +                 */
    1.78 +                MPbkFetchKeyCallback* iFetchKeyCallback;
    1.79 +
    1.80 +                /**
    1.81 +                 * OPTIONAL: Fetch accept callback.
    1.82 +                 * If NULL, not applicable.
    1.83 +                 */
    1.84 +                MPbkFetchDlgAccept* iFetchDlgAccept;
    1.85 +
    1.86 +            public:  // Output parameters
    1.87 +                /**
    1.88 +                 * Returns the id of the selected entry, undefined if the dialog
    1.89 +                 * is canceled.
    1.90 +                 */
    1.91 +                TContactItemId iSelectedEntry;
    1.92 +
    1.93 +            public: // Additional input parameters
    1.94 +                /**
    1.95 +                 * OPTIONAL: Fetch softkey resource ID.
    1.96 +                 * If 0, default softkeys are used.
    1.97 +                 */
    1.98 +                TInt iCbaId;
    1.99 +
   1.100 +            public:  // Constructors
   1.101 +                /**
   1.102 +                 * C++ Constructor.
   1.103 +                 */
   1.104 +                IMPORT_C TParams();
   1.105 +
   1.106 +                // Compiler-generated destructor is ok for this class
   1.107 +
   1.108 +            private:  // Unimplemented functions
   1.109 +                /// Unimplemented copy constructor
   1.110 +                TParams(const TParams&);
   1.111 +                /// Unimplemented assignment operator
   1.112 +                TParams& operator=(const TParams&);
   1.113 +
   1.114 +            private:  // data
   1.115 +				/// Own: spare data
   1.116 +                TInt32 iSpare1;
   1.117 +            };
   1.118 +
   1.119 +    public:  // Interface
   1.120 +        /**
   1.121 +         * Creates a new single entry fetch dialog.
   1.122 +         *
   1.123 +         * @param aParams   Fetch parameters, @see TParams
   1.124 +         * @return New instance of this class.
   1.125 +         */
   1.126 +        IMPORT_C static CPbkSingleEntryFetchDlg* NewL(TParams& aParams);
   1.127 +
   1.128 +        /**
   1.129 +         * @see CCoeControl::SetMopParent(MObjectProvider* aParent)
   1.130 +         */
   1.131 +        IMPORT_C void SetMopParent(MObjectProvider* aParent);
   1.132 +
   1.133 +        /**
   1.134 +         * Sets *aSelfPtr to NULL when this dialog is destroyed.
   1.135 +         * @precond !aSelfPtr || *aSelfPtr==this
   1.136 +         */
   1.137 +        IMPORT_C void ResetWhenDestroyed(CPbkSingleEntryFetchDlg** aSelfPtr);
   1.138 +
   1.139 +        /**
   1.140 +         * Executes this dialog.
   1.141 +         * NOTE: this object is deleted when ExecuteLD returns or leaves!
   1.142 +         * NOTE: current status pane layout is replaced with the Phonebook
   1.143 +         * one. Restoring the original pane is left to be the responsibility
   1.144 +         * of the caller.
   1.145 +         *
   1.146 +         * @return A non-zero value if accepted, 0 if canceled.
   1.147 +         */
   1.148 +        IMPORT_C TInt ExecuteLD();
   1.149 +
   1.150 +        /**
   1.151 +         * Destructor. Also cancels this dialog and makes ExecuteLD return.
   1.152 +         */
   1.153 +        ~CPbkSingleEntryFetchDlg();
   1.154 +
   1.155 +    private:  // Implementation
   1.156 +        CPbkSingleEntryFetchDlg(TParams& aParams);
   1.157 +        void ConstructL();
   1.158 +        static void Panic(TInt aReason);
   1.159 +
   1.160 +    private:  // Data
   1.161 +        /// Own: parameters
   1.162 +        TParams& iParams;
   1.163 +        /// Own: fetch dialog
   1.164 +        CPbkFetchDlg* iFetchDlg;
   1.165 +        /// Ref: Phonebook engine
   1.166 +        CPbkContactEngine* iPbkEngine;
   1.167 +        /// Own: Phonebook engine
   1.168 +        CPbkContactEngine* iOwnPbkEngine;
   1.169 +        /// Ref: contact view to use for fetcing
   1.170 +        CContactViewBase* iContactView;
   1.171 +        /// Ref: set to ETrue in destructor
   1.172 +        TBool* iDestroyedPtr;
   1.173 +        /// Ref: pointer to self
   1.174 +        CPbkSingleEntryFetchDlg** iSelfPtr;
   1.175 +        /// Own: Object Provider
   1.176 +        MObjectProvider* iObjectProvider;
   1.177 +    };
   1.178 +
   1.179 +#endif // __CPbkSingleEntryFetchDlg_H__
   1.180 +
   1.181 +// End of File