calendarui/globaldata/src/calenfilemapping.cpp
changeset 0 f979ecb2b13e
child 14 21239b3bcd78
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2  * Copyright (c) 2002-2008 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:  Global Data for Calendar application
       
    15  *
       
    16  */
       
    17 #include "calendarui_debug.h"
       
    18 #include "calenfilemapping.h"
       
    19 
       
    20 #include <calsession.h>
       
    21 #include <calentryview.h>           // Calendar Entry view
       
    22 
       
    23 // -----------------------------------------------------------------------------
       
    24 // CCalenFileMapping::CCalenFileMapping
       
    25 // -----------------------------------------------------------------------------
       
    26 CCalenFileMapping::CCalenFileMapping( ) 
       
    27     {
       
    28     TRACE_ENTRY_POINT
       
    29     TRACE_EXIT_POINT        
       
    30     }
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // CCalenFileMapping::NewL
       
    34 // -----------------------------------------------------------------------------
       
    35 CCalenFileMapping* CCalenFileMapping::NewL()
       
    36     {
       
    37     TRACE_ENTRY_POINT    
       
    38     CCalenFileMapping* selfPtr = new(ELeave) CCalenFileMapping();
       
    39     CleanupStack::PushL(selfPtr);
       
    40     selfPtr->ConstructL();
       
    41     CleanupStack::Pop(selfPtr);
       
    42     TRACE_EXIT_POINT       
       
    43     return selfPtr;
       
    44     }
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // CCalenFileMapping::ConstructL
       
    48 // -----------------------------------------------------------------------------
       
    49 void CCalenFileMapping::ConstructL() // second-phase constructor
       
    50     {
       
    51     TRACE_ENTRY_POINT
       
    52     iStatus = EFalse;
       
    53     iSessionPtr = NULL;
       
    54     iEntryView = NULL;
       
    55 
       
    56     if(iCalendarFileName)
       
    57         {
       
    58         delete iCalendarFileName;
       
    59         iCalendarFileName = NULL;
       
    60         }
       
    61     TRACE_EXIT_POINT           
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 // CCalenFileMapping::~CCalenFileMapping
       
    66 // -----------------------------------------------------------------------------
       
    67 CCalenFileMapping::~CCalenFileMapping()
       
    68     {
       
    69     TRACE_ENTRY_POINT
       
    70     
       
    71     if(iEntryView)
       
    72         {
       
    73         delete iEntryView;
       
    74         iEntryView = NULL;
       
    75         }
       
    76 
       
    77     if(iSessionPtr)
       
    78         {
       
    79         delete iSessionPtr;
       
    80         iSessionPtr = NULL;
       
    81         }
       
    82 
       
    83     if(iCalendarFileName)
       
    84         {
       
    85         delete iCalendarFileName;
       
    86         iCalendarFileName = NULL;
       
    87         }
       
    88 
       
    89     TRACE_EXIT_POINT 
       
    90     }
       
    91 
       
    92 
       
    93 // -----------------------------------------------------------------------------
       
    94 // CCalenFileMapping::GetCalendarFileName
       
    95 // -----------------------------------------------------------------------------      
       
    96 const TDesC& CCalenFileMapping::GetCalendarFileName() const
       
    97     {
       
    98     TRACE_ENTRY_POINT
       
    99     TRACE_EXIT_POINT
       
   100     return *iCalendarFileName;
       
   101     }
       
   102 
       
   103 // -----------------------------------------------------------------------------
       
   104 // CCalenFileMapping::SetCalendarFileNameL
       
   105 // ----------------------------------------------------------------------------- 
       
   106 void CCalenFileMapping::SetCalendarFileNameL(const TDesC& aCalendarFilename)
       
   107     {
       
   108     TRACE_ENTRY_POINT
       
   109     if(iCalendarFileName)
       
   110         {
       
   111         delete iCalendarFileName;
       
   112         iCalendarFileName = NULL;
       
   113         }
       
   114     iCalendarFileName = aCalendarFilename.AllocL();
       
   115     TRACE_EXIT_POINT
       
   116     }
       
   117 
       
   118 // -----------------------------------------------------------------------------
       
   119 // CCalenFileMapping::SetCollectionId
       
   120 // ----------------------------------------------------------------------------- 
       
   121 void CCalenFileMapping::SetCollectionId(TCalCollectionId aColId)
       
   122     {
       
   123     TRACE_ENTRY_POINT    
       
   124     iColId = aColId;    
       
   125     TRACE_EXIT_POINT    
       
   126     }
       
   127 
       
   128 // -----------------------------------------------------------------------------
       
   129 // CCalenFileMapping::GetCollectionId
       
   130 // -----------------------------------------------------------------------------   
       
   131 TCalCollectionId CCalenFileMapping::GetCollectionId() const
       
   132     {
       
   133     TRACE_ENTRY_POINT
       
   134     TRACE_EXIT_POINT    
       
   135     return iColId;
       
   136     }
       
   137 
       
   138 // -----------------------------------------------------------------------------
       
   139 // CCalenFileMapping::GetStatus
       
   140 // ----------------------------------------------------------------------------- 
       
   141 TBool CCalenFileMapping::GetStatus()
       
   142     {
       
   143     TRACE_ENTRY_POINT
       
   144     TRACE_EXIT_POINT
       
   145     return iStatus;    
       
   146     }
       
   147 
       
   148 // -----------------------------------------------------------------------------
       
   149 // CCalenFileMapping::SetStatus
       
   150 // ----------------------------------------------------------------------------- 
       
   151 void CCalenFileMapping::SetStatus(TBool aStatus)
       
   152     {
       
   153     TRACE_ENTRY_POINT
       
   154     iStatus = aStatus;
       
   155     TRACE_EXIT_POINT
       
   156     }
       
   157 
       
   158 // -----------------------------------------------------------------------------
       
   159 // CCalenFileMapping::SetEntryView
       
   160 // ----------------------------------------------------------------------------- 
       
   161 void CCalenFileMapping::SetEntryView(CCalEntryView* aEntryView)
       
   162     {
       
   163     TRACE_ENTRY_POINT
       
   164     iEntryView = aEntryView;
       
   165     TRACE_EXIT_POINT
       
   166     }
       
   167 
       
   168 // -----------------------------------------------------------------------------
       
   169 // CCalenFileMapping::GetEntryView
       
   170 // ----------------------------------------------------------------------------- 
       
   171 CCalEntryView* CCalenFileMapping::GetEntryView()
       
   172     {
       
   173     TRACE_ENTRY_POINT
       
   174     TRACE_EXIT_POINT
       
   175     return iEntryView;
       
   176     }
       
   177 
       
   178 // -----------------------------------------------------------------------------
       
   179 // CCalenFileMapping::SetSessionPtr
       
   180 // ----------------------------------------------------------------------------- 
       
   181 void CCalenFileMapping::SetSessionPtr(CCalSession* aSessionPtr)
       
   182     {
       
   183     TRACE_ENTRY_POINT
       
   184     iSessionPtr = aSessionPtr;
       
   185     TRACE_EXIT_POINT
       
   186     }
       
   187 
       
   188 // -----------------------------------------------------------------------------
       
   189 // CCalenFileMapping::GetSessionPtr
       
   190 // ----------------------------------------------------------------------------- 
       
   191 CCalSession* CCalenFileMapping::GetSessionPtr()
       
   192     {
       
   193     TRACE_ENTRY_POINT
       
   194     TRACE_EXIT_POINT
       
   195     return iSessionPtr;
       
   196     }
       
   197 
       
   198 //End