phonebookui/Phonebook2/inc/CPbk2MemoryEntryDefaultsDlg.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     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 memory entry defaults dialog.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2MEMORYENTRYDEFAULTSDLG_H
       
    20 #define CPBK2MEMORYENTRYDEFAULTSDLG_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <aknPopup.h>                       // CAknPopupList
       
    24 #include <MPbk2DefaultAttributeProcessObserver.h>
       
    25 #include <VPbkFieldTypeSelectorFactory.h>
       
    26 #include <spdefinitions.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CEikColumnListBox;
       
    30 class CPbk2PresentationContact;
       
    31 class CVPbkContactManager;
       
    32 class CPbk2DefaultAttributeProcess;
       
    33 class MVPbkStoreContactField;
       
    34 class CFbsBitmap;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39  * Phonebook 2 memory entry defaults dialog.
       
    40  * This is a custom popup for Phonebook 2 application's
       
    41  * contacts' default settings.
       
    42  *
       
    43  * Responsible for:
       
    44  * - populating the list box with correct content, this
       
    45  *   is difficult since supported defaults are heavily variated
       
    46  * - setting or removing the default attributes to/from the contact
       
    47  *   by driving default attribute processor
       
    48  */
       
    49 class CPbk2MemoryEntryDefaultsDlg :
       
    50             public CAknPopupList,
       
    51             public MPbk2DefaultAttributeProcessObserver
       
    52     {
       
    53     public: // Construction and destruction
       
    54 
       
    55         /**
       
    56          * Creates a new instance of this class.
       
    57          *
       
    58          * @param aContact  Contact whose defaults are chosen.
       
    59          * @param aManager  Virtual Phonebook contact manager.
       
    60          * @return  A new instance of this class.
       
    61          */
       
    62         IMPORT_C static CPbk2MemoryEntryDefaultsDlg* NewL(
       
    63                 CPbk2PresentationContact& aContact,
       
    64                 CVPbkContactManager& aManager );
       
    65 
       
    66         /**
       
    67          * Destructor.
       
    68          * Also cancels and dismisses this popup list, in other words makes
       
    69          * ExecuteLD return as if cancel was pressed.
       
    70          */
       
    71         ~CPbk2MemoryEntryDefaultsDlg();
       
    72 
       
    73     public: // Interface
       
    74 
       
    75         /**
       
    76          * Runs the dialog.
       
    77          */
       
    78         IMPORT_C void ExecuteLD();
       
    79 
       
    80     private: // From CAknPopupList
       
    81         void ProcessCommandL(
       
    82                 TInt aCommandId );
       
    83         void HandleListBoxEventL(
       
    84                 CEikListBox* aListBox,
       
    85                 TListBoxEvent aEventType );
       
    86 
       
    87     private: // From MPbk2DefaultAttributeProcessObserver
       
    88         void AttributeProcessCompleted();
       
    89         void AttributeProcessFailed(
       
    90                 TInt aErrorCode );
       
    91 
       
    92     private: // Implementation
       
    93         CPbk2MemoryEntryDefaultsDlg(
       
    94                 CPbk2PresentationContact& aContact,
       
    95                 CVPbkContactManager& aManager );
       
    96         void ConstructL();
       
    97         void CreateLinesL() const;
       
    98         TBool DefaultsAssignPopupL(
       
    99                 VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aSelectorID );
       
   100         void FixIndex(
       
   101                 TInt& aIndex ) const;
       
   102         TBool IsSupported(
       
   103                 const VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aSelectorID ) const;
       
   104         TBool HasMailboxAccountsL() const;
       
   105         TBool IsAvailableL(
       
   106                 const VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aSelectorID ) const;
       
   107         void SetDefaultL(
       
   108                 const VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aSelectorID,
       
   109                 MVPbkStoreContactField& aField );
       
   110         void RemoveDefaultL(
       
   111                 const VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector aSelectorID );
       
   112         void CreateTableOfDefaultsL();
       
   113         void ReadDefaultsFromRepositoryL();      
       
   114         TInt SupportedVOIPServicesL( TServiceId& aServiceId );
       
   115         void LoadVoipServiceInfoL( 
       
   116                     TServiceId aServiceId,
       
   117                     CFbsBitmap*& aBitmap, CFbsBitmap*& aMask );
       
   118         
       
   119     private: // Data
       
   120         /// Ref: The contact
       
   121         CPbk2PresentationContact& iContact;
       
   122         /// Ref: Virtual Phonebook contact manager
       
   123         CVPbkContactManager& iManager;
       
   124         /// Own: Default selection listbox
       
   125         CEikFormattedCellListBox* iListBox;
       
   126         /// Ref: Referred TBool is set ETrue in destructor
       
   127         TBool* iDestroyedPtr;
       
   128         /// Own: Contact field the default is assigned to
       
   129         MVPbkStoreContactField* iField;
       
   130         /// Own: Attribute set/remove process
       
   131         CPbk2DefaultAttributeProcess* iAttributeProcess;
       
   132         /// Own: Local variation flags
       
   133         TInt iLVFlags;
       
   134         /// Own: Table of used Defaults item
       
   135         CArrayFixFlat<VPbkFieldTypeSelectorFactory::TVPbkContactActionTypeSelector>* iDefaultsTable;
       
   136         /// Own: Indicates if focus has been dragged around the list, helps with single tap launching
       
   137         TBool iHasBeenDragged;
       
   138         /// Voip service name
       
   139         HBufC* iServiceName;
       
   140     };
       
   141 
       
   142 #endif // CPBK2MEMORYENTRYDEFAULTSDLG_H
       
   143 
       
   144 // End of File