phonebookui/Phonebook2/inc/TPbk2AddressSelectParams.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Phonebook 2 address selection parameters.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef TPBK2ADDRESSSELECTPARAMS_H
       
    20 #define TPBK2ADDRESSSELECTPARAMS_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <barsread.h>
       
    25 #include <VPbkFieldType.hrh>
       
    26 #include <RVPbkContactFieldDefaultPriorities.h>
       
    27 #include <VPbkFieldTypeSelectorFactory.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class MVPbkStoreContact;
       
    31 class MVPbkStoreContactField;
       
    32 class MPbk2ContactNameFormatter;
       
    33 class CVPbkContactManager;
       
    34 class CPbk2FieldPropertyArray;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39  * Phonebook 2 address selection parameters.
       
    40  * Responsible for carrying the parameters to the address select class.
       
    41  */
       
    42 class TPbk2AddressSelectParams
       
    43     {
       
    44     public: // Construction
       
    45 
       
    46         /**
       
    47          * Constructor.
       
    48          *
       
    49          * @param aContact            Contact from where to select
       
    50          *                            an address.
       
    51          * @param aContactManager     Virtual Phonebook contact manager.
       
    52          * @param aNameFormatter      Name formatter.
       
    53          * @param aFieldPropertyArray Phonebook 2 field property array.
       
    54          * @param aReader             Resource reader pointed to
       
    55          *                            PBK2_ADDRESS_SELECT structure.
       
    56          * @param aTitleResId         Resource id for title text.
       
    57          *                            Default = 0. If default, the memory
       
    58          *                            entry name is used as a title.
       
    59          */
       
    60          IMPORT_C TPbk2AddressSelectParams(
       
    61                 MVPbkStoreContact& aContact,
       
    62                 const CVPbkContactManager& aContactManager,
       
    63                 MPbk2ContactNameFormatter& aNameFormatter,
       
    64                 const CPbk2FieldPropertyArray& aFieldPropertyArray,
       
    65                 TResourceReader& aReader,
       
    66                 TInt aTitleResId = 0 );
       
    67 
       
    68     public: // Interface
       
    69 
       
    70         /**
       
    71          * Sets the focused field of the contact. If focused field
       
    72          * is a non-empty address field it is returned directly by
       
    73          * ExecuteLD. Defaults to NULL.
       
    74          *
       
    75          * @param aFocusedField       The focused field to set.
       
    76          */
       
    77         IMPORT_C void SetFocusedField(
       
    78                 const MVPbkStoreContactField* aFocusedField );
       
    79 
       
    80         /**
       
    81          * Sets the default to be used in address select. The
       
    82          * defaults in the array should be in priority order.
       
    83          * If the priorities array is not set, no defaults are used.
       
    84          * Focused field overrides default address if both are
       
    85          * available.
       
    86          *
       
    87          * @param aDefaultPriorities  An array of default properties in
       
    88          *                            priority order.
       
    89          */
       
    90         IMPORT_C void SetDefaultPriorities(
       
    91                 const RVPbkContactFieldDefaultPriorities& aDefaultPriorities );
       
    92 
       
    93         /**
       
    94          * Set to ETrue to use default address of the contact directly.
       
    95          * Focused field overrides default address if both are
       
    96          * available. Default value for this parameter is EFalse.
       
    97          *
       
    98          * @param aUseDefaultDirectly   Defines should the default address
       
    99          *                              be used directly.
       
   100          */
       
   101         IMPORT_C void SetUseDefaultDirectly(
       
   102                 TBool aUseDefaultDirectly );
       
   103 
       
   104         /**
       
   105          * Set to ETrue if the query should be shown always, even if
       
   106          * it possible to select only one field. This overrides defaults
       
   107          * also. Default value for this parameter is EFalse.
       
   108          *
       
   109          * @param aQueryAlways  Set to ETrue if the query should
       
   110          *                      be always shown.
       
   111          */
       
   112         IMPORT_C void SetQueryAlways(
       
   113                 TBool aQueryAlways );
       
   114 
       
   115         /**
       
   116          * Sets custom title type. Indicates whether the resource string
       
   117          * must have one "%U" in it, which the contact name will replace.
       
   118          *
       
   119          * @param aIncludeContactName   If ETrue the prompt will include
       
   120          *                              contact name in it. If EFalse,
       
   121          *                              the prompt include contact name.
       
   122          *                              Default is ETrue.
       
   123          */
       
   124         IMPORT_C void SetTitleToIncludeContactName(
       
   125                 TBool aIncludeContactName );
       
   126 
       
   127         /**
       
   128          * Set to ETrue if the warnings should be suppressed.
       
   129          * Default value for this parameter is EFalse.
       
   130          *
       
   131          * @param aSuppressWarnings     Set to ETrue if the warnings
       
   132          *                              should be suppressed.
       
   133          */
       
   134         IMPORT_C void SetSuppressWarnings(
       
   135                 TBool aSuppressWarnings );
       
   136 
       
   137     public: // Data
       
   138         /// Ref: Contact where to select an address from
       
   139         MVPbkStoreContact& iContact;
       
   140         /// Ref: Virtual Phonebook contact manager
       
   141         const CVPbkContactManager& iContactManager;
       
   142         /// Ref: Contact name formatter.
       
   143         MPbk2ContactNameFormatter& iNameFormatter;
       
   144         /// Ref: Phonebook 2 field property array.
       
   145         const CPbk2FieldPropertyArray& iFieldPropertyArray;
       
   146         /// Ref: Resource reader.
       
   147         TResourceReader& iResReader;
       
   148         /// Own: Title resource id
       
   149         TInt iTitleResId;
       
   150         /// Ref: Focused field of the contact.
       
   151         const MVPbkStoreContactField* iFocusedField;
       
   152         /// Ref: Prioritized array of defaults to use.
       
   153         const RVPbkContactFieldDefaultPriorities* iDefaultPriorities;
       
   154         /// Own: Indicates should the default address be used directly
       
   155         TBool iUseDefaultDirectly;
       
   156         /// Own: Indicates should the query be shown always
       
   157         TBool iQueryAlways;
       
   158         /// Own: Indicates whether to include contact name in custom prompt.
       
   159         ///      Custom prompt refers to iTitleResId.
       
   160         TBool iIncludeContactNameInPrompt;
       
   161         /// Own: Indicates are the warnings suppressed
       
   162         TBool iSuppressWarnings;
       
   163         /// Own: Communication method
       
   164         VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector iCommMethod;
       
   165 
       
   166     private: // Friends
       
   167         friend class CPbk2AddressSelect;
       
   168     };
       
   169 
       
   170 #endif // TPBK2ADDRESSSELECTPARAMS_H
       
   171 
       
   172 // End of File