phonebookui/Phonebook2/inc/CPbk2MergeConflictsDlg.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Provides Conflict resolution dialog
       
    15 *               for Contact Merge command.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef CPBK2MERGECONFLICTSDLG_H
       
    20 #define CPBK2MERGECONFLICTSDLG_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 #include <AknDialog.h>
       
    26 #include <eiklbo.h>
       
    27 
       
    28 // CLASS DECLARATION
       
    29 class CEikColumnListBox;
       
    30 class MPbk2MergeResolver;
       
    31 class CAknNavigationDecorator;
       
    32 
       
    33 /**
       
    34  *  CPbk2MergeConflictsDlg
       
    35  * 
       
    36  */
       
    37 NONSHARABLE_CLASS( CPbk2MergeConflictsDlg ) : public CAknDialog,
       
    38                                               private MEikListBoxObserver
       
    39     {
       
    40 public: // construction
       
    41     
       
    42     /**
       
    43      * Two-phased constructor.
       
    44      */
       
    45     IMPORT_C static CPbk2MergeConflictsDlg* NewL( MPbk2MergeResolver* aConflictResolver, TBool aPhotoConflictExpected );
       
    46     
       
    47     /**
       
    48      * Destructor.
       
    49      */
       
    50     ~CPbk2MergeConflictsDlg();
       
    51         
       
    52 private: // construction
       
    53     
       
    54     /**
       
    55      * Constructor for performing 1st stage construction
       
    56      */
       
    57     CPbk2MergeConflictsDlg( MPbk2MergeResolver* aConflictResolver, TBool aPhotoConflictExpected );
       
    58     
       
    59     /**
       
    60      * Default constructor for performing 2nd stage construction
       
    61      */
       
    62     void ConstructL();
       
    63 
       
    64 private: // from MEikListBoxObserver
       
    65     
       
    66     void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
       
    67     
       
    68 private: // from CAknDialog
       
    69         
       
    70     void PreLayoutDynInitL();
       
    71 
       
    72     TBool OkToExitL( TInt aButtonId );
       
    73 
       
    74     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    75 
       
    76 private:
       
    77 
       
    78     enum TRowType
       
    79         {
       
    80         ELabelRow = 1,
       
    81         ESelectionRow
       
    82         };
       
    83     
       
    84     struct TRadioControl
       
    85         {
       
    86         /// Own: index on list box
       
    87         TInt iBeginIndex;
       
    88         /// Own: selected radio option starting from 1
       
    89         TInt iSelected;
       
    90         };
       
    91     
       
    92 private: // new methods
       
    93     
       
    94     void SetIconsL();
       
    95 
       
    96     void SetItemsL();
       
    97     
       
    98     TInt RowType( TInt aIndex );
       
    99 
       
   100     void SwitchRadioButtonL();
       
   101     
       
   102     TBool IsRadioSelected( TInt aIndex );
       
   103     
       
   104     TInt IndexOfNewRadioControl();
       
   105     
       
   106     void ResolveConflicts();
       
   107     
       
   108     void SetNaviPaneL();
       
   109     
       
   110     void SetTitlePaneL( TBool aCustom );
       
   111     
       
   112 private: // new methods
       
   113     
       
   114     /// Not own: Pointer for list control
       
   115     CEikColumnListBox* iListBox;
       
   116     /// Not own: Pointer for list control
       
   117     MPbk2MergeResolver* iConflictResolver;
       
   118     /// Own: Stores radio buttons controls information
       
   119     RArray <TRadioControl> iRadioControls;
       
   120     /// Own: Navi pane control
       
   121     CAknNavigationDecorator* iNaviDecorator;
       
   122     /// Own: Dialog buttons are set based on this value
       
   123     TBool iPhotoConflictExpected;
       
   124     };
       
   125 
       
   126 #endif // CPBK2MERGECONFLICTSDLG_H