calendarui/multicaluidialog/src/multicaluidialog.cpp
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     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 : Multiple Calendars list dialog
       
    15  */
       
    16 
       
    17 // System include
       
    18 #include <calentry.h>
       
    19 
       
    20 //User include
       
    21 #include "multicaluidialog.h"
       
    22 #include "multicaluidialogimpl.h"
       
    23 #include "calendarui_debug.h"
       
    24 #include "caluidialogimpl.h"
       
    25 
       
    26 // ----------------------------------------------------------------------------
       
    27 // CMultiCalUiDialog::CMultiCalUiDialog
       
    28 // Constructor
       
    29 // ----------------------------------------------------------------------------
       
    30 //
       
    31 CMultiCalUiDialog::CMultiCalUiDialog( TBool aLaunchedFromCal )    
       
    32     {
       
    33     TRACE_ENTRY_POINT
       
    34     iLaunchedFromCal = aLaunchedFromCal;    
       
    35     TRACE_EXIT_POINT
       
    36     }
       
    37 
       
    38 // ----------------------------------------------------------------------------
       
    39 // CMultiCalUiDialog::NewL
       
    40 // First phase constructor
       
    41 // ----------------------------------------------------------------------------
       
    42 //
       
    43 EXPORT_C CMultiCalUiDialog* CMultiCalUiDialog::NewL(const RPointerArray<CCalEntry>& 
       
    44         aCalEntries, TBool aLaunchedFromCal )
       
    45     {
       
    46     TRACE_ENTRY_POINT
       
    47     CMultiCalUiDialog* self = CMultiCalUiDialog::NewLC(aCalEntries, aLaunchedFromCal);
       
    48     CleanupStack::Pop(self);
       
    49     TRACE_EXIT_POINT
       
    50     return self;
       
    51     }
       
    52 
       
    53 // ----------------------------------------------------------------------------
       
    54 // CMultiCalUiDialog::NewLC
       
    55 // First phase constructor
       
    56 // ----------------------------------------------------------------------------
       
    57 //
       
    58 EXPORT_C CMultiCalUiDialog* CMultiCalUiDialog::NewLC(const RPointerArray<CCalEntry>& 
       
    59         aCalEntries, TBool aLaunchedFromCal )
       
    60     {
       
    61     TRACE_ENTRY_POINT
       
    62     CMultiCalUiDialog* self = new(ELeave) CMultiCalUiDialog( aLaunchedFromCal );
       
    63     CleanupStack::PushL(self);
       
    64     self->ConstructL(aCalEntries);
       
    65     TRACE_EXIT_POINT
       
    66     return self;
       
    67     }
       
    68 
       
    69 // ----------------------------------------------------------------------------
       
    70 // CMultiCalUiDialog::NewLC
       
    71 // First phase constructor
       
    72 // ----------------------------------------------------------------------------
       
    73 //
       
    74 EXPORT_C TInt CMultiCalUiDialog::LaunchL()
       
    75     {
       
    76     TRACE_ENTRY_POINT
       
    77     TInt returnVal(KErrNone);
       
    78     if( iLaunchedFromCal )
       
    79         {
       
    80         returnVal = iMultiCalDialogImpl->LaunchCalenDbListDialogL();
       
    81         }
       
    82     else
       
    83         {
       
    84         returnVal = iCalDialogImpl->LaunchCalenDbListDialogL();
       
    85         }
       
    86     //Call to this above function ensures on return the object is destroyed.
       
    87     
       
    88     iCalDialogImpl = NULL;    
       
    89     iMultiCalDialogImpl = NULL;
       
    90     TRACE_EXIT_POINT
       
    91     return returnVal;
       
    92     }
       
    93 
       
    94 // ----------------------------------------------------------------------------
       
    95 // CMultiCalUiDialog::~CMultiCalUiDialog
       
    96 // Destructor
       
    97 // ----------------------------------------------------------------------------
       
    98 //
       
    99 CMultiCalUiDialog::~CMultiCalUiDialog()
       
   100     {
       
   101     TRACE_ENTRY_POINT
       
   102     
       
   103     if(iMultiCalDialogImpl)
       
   104         {
       
   105         delete iMultiCalDialogImpl;
       
   106         iMultiCalDialogImpl = NULL;
       
   107         }
       
   108     if(iCalDialogImpl)
       
   109         {
       
   110         delete iCalDialogImpl;
       
   111         iCalDialogImpl = NULL;
       
   112         }    
       
   113     
       
   114     TRACE_EXIT_POINT
       
   115     }
       
   116 
       
   117 // ----------------------------------------------------------------------------
       
   118 // CMultiCalUiDialog::ConstructL
       
   119 // Second phase constructor
       
   120 // ----------------------------------------------------------------------------
       
   121 //
       
   122 void CMultiCalUiDialog::ConstructL(const RPointerArray<CCalEntry>& aCalEntries )
       
   123     {
       
   124     TRACE_ENTRY_POINT
       
   125     
       
   126     if( iLaunchedFromCal )
       
   127         {
       
   128         iMultiCalDialogImpl = CMultiCalUiDialogImpl::NewL(aCalEntries);
       
   129         }
       
   130     else
       
   131         {
       
   132         iCalDialogImpl = CCalUiDialogImpl::NewL(aCalEntries);
       
   133         }
       
   134     
       
   135     
       
   136     TRACE_EXIT_POINT
       
   137     }
       
   138 
       
   139 // End of file.