javaextensions/pim/agnadapter/inc.s60/cpimagnapptadapter.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 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:  Converts PIM Event items and native calendar appointments
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPIMAGNAPPTADAPTER_H
       
    20 #define CPIMAGNAPPTADAPTER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "cpimagneventadapter.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MPIMEventItem;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 /**
       
    30  * Appointment Item Adapter
       
    31  * Converts PIM Event items and native calendar appointments
       
    32  */
       
    33 NONSHARABLE_CLASS(CPIMAgnApptAdapter): public CPIMAgnEventAdapter
       
    34 {
       
    35 public: // Constructor and destructor
       
    36 
       
    37     /**
       
    38      * Two-phased constructor.
       
    39      */
       
    40     static CPIMAgnApptAdapter* NewL(java::util::FunctionServer* aFuncServer);
       
    41 
       
    42     /**
       
    43      * Destructor.
       
    44      */
       
    45     virtual ~CPIMAgnApptAdapter();
       
    46 
       
    47 public: // new methods
       
    48 
       
    49     /**
       
    50          * Constructs a Agenda Model entry from the framework PIM item.
       
    51          *
       
    52          * @param aItem The item to convert
       
    53          *
       
    54          * @return A CCalEntry constructed according to framework item.
       
    55          * The \b ownership of the card is transferred to the caller.
       
    56          *
       
    57          * @par Leaving:
       
    58          * This method may leave.
       
    59          */
       
    60     CCalEntry* CreateItemToAgnL(const MPIMEventItem& aItem);
       
    61 
       
    62     /**
       
    63      * Converts from Agenda Model entry to the framework PIM item.
       
    64      *
       
    65      * @param aItem PIM Item data container store the entry data.
       
    66      * @param aEntry Agenda Model entry to convert.
       
    67      *
       
    68      * @par Leaving:
       
    69      * This method may leave.
       
    70      */
       
    71     void ReadAgnToItemL(MPIMEventItem& aItem,
       
    72                         CCalEntry& aEntry);
       
    73 
       
    74     /**
       
    75      * Updates the Agenda Model entry according to the framework PIM item.
       
    76      *
       
    77      * @param aItem PIM Item with the current data.
       
    78      * @param aEntry Agenda Model entry to update.
       
    79      *
       
    80      * @par Leaving:
       
    81      * This method may leave.
       
    82      */
       
    83     void UpdateItemToAgnL(const MPIMEventItem& aItem,
       
    84                           CCalEntry& aEntry);
       
    85 
       
    86 private:
       
    87 
       
    88     /**
       
    89      * C++ constructor.
       
    90      */
       
    91     CPIMAgnApptAdapter(java::util::FunctionServer* aFuncServer);
       
    92 
       
    93     /**
       
    94      * Converts the start field of an Agenda Model entry into
       
    95      * the framework PIM item field.
       
    96      * Implements the pure virtual method from the base class.
       
    97      *
       
    98      * @param aItem Framework PIM Item.
       
    99      * @param aEntry Agenda Model entry
       
   100      *
       
   101      * @par Leaving:
       
   102      * This method may leave.
       
   103      */
       
   104     void ReadStartFromAgnL(MPIMEventItem& aItem,
       
   105                            CCalEntry& aEntry);
       
   106 
       
   107     /**
       
   108      * Converts the end field of an Agenda Model entry into
       
   109      * the framework PIM item field.
       
   110      * Implements the pure virtual method from the base class.
       
   111      *
       
   112      * @param aItem Framework PIM Item.
       
   113      * @param aEntry Agenda Model entry
       
   114      *
       
   115      * @par Leaving:
       
   116      * This method may leave.
       
   117      */
       
   118     void ReadEndFromAgnL(MPIMEventItem& aItem,
       
   119                          CCalEntry& aEntry);
       
   120 
       
   121     /**
       
   122      * Adds common default values for the native calendar entries
       
   123      * Base classes must call this function if they overwrite
       
   124      * this method
       
   125      *
       
   126      * @param aItem PIM API item from which the data is extracted
       
   127      * @param aEntry Native entry which will contain the data
       
   128      */
       
   129     void AddDefaultValuesToEntryL(
       
   130         const MPIMEventItem& aItem,
       
   131         CCalEntry& aEntry) const;
       
   132 
       
   133 protected:
       
   134 
       
   135     void ConstructL();
       
   136 };
       
   137 
       
   138 #endif // CPIMAGNAPPTADAPTER_H
       
   139 // End of file