javaextensions/pim/framework/inc.s60/cpimeventitem.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19: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:  Event item implementation.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPIMEVENTITEM_H
       
    20 #define CPIMEVENTITEM_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include "cpimitem.h"
       
    24 #include "mpimeventitem.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MPIMEventAdapterManager;
       
    28 class MPIMEventListAdapter;
       
    29 class CPIMRepeatRule;
       
    30 class CPIMEventValidator;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35  *  PIM item Event specialization.
       
    36  */
       
    37 NONSHARABLE_CLASS(CPIMEventItem): public CPIMItem, public MPIMEventItem
       
    38 {
       
    39 
       
    40 public: // Constructors and destructor
       
    41 
       
    42     /**
       
    43      * Two-phased constructor.
       
    44      */
       
    45     static CPIMEventItem* NewL(
       
    46         const CPIMEventValidator& aValidator);
       
    47 
       
    48     static CPIMEventItem* NewLC(
       
    49         const CPIMEventValidator& aValidator);
       
    50 
       
    51     /**
       
    52      * Destructor.
       
    53      */
       
    54     virtual ~CPIMEventItem();
       
    55 
       
    56 public: // New functions
       
    57 
       
    58     /**
       
    59      * Sets the associated event adapter manager and event list
       
    60      * adapter.
       
    61      *
       
    62      * @param aEventAdapterManager Adapter manager. Must not be NULL.
       
    63      * @param aEventListAdapter List adapter. May be NULL.
       
    64      */
       
    65     void SetEventAdapterAssociation(
       
    66         MPIMEventAdapterManager* aEventAdapterManager,
       
    67         MPIMEventListAdapter* aEventListAdapter);
       
    68 
       
    69     /**
       
    70      * Removes the event adapter associations.
       
    71      * Performs any housekeeping related to removing the adapter
       
    72      * associations, if necessary.
       
    73      */
       
    74     void RemoveAdapterAssociation();
       
    75 
       
    76     /**
       
    77      * Gets pointer to the Repeat Rule owned by this object and transfers
       
    78      * the ownership to the caller.
       
    79      */
       
    80     CPIMRepeatRule* GetRepeatTransferOwnership();
       
    81 
       
    82     int getRepeatHandle();
       
    83 
       
    84 public: // Functions from CPIMItem
       
    85 
       
    86     TPIMListType ItemType() const;
       
    87     void commit();
       
    88     void ListClosed();
       
    89     TBool IsReadOnly(const TPIMField& aField);
       
    90 
       
    91 public: // Functions from MPIMEventItem
       
    92 
       
    93     /**
       
    94      * Returns item data representation of this class
       
    95      * There are non-const and const version of this
       
    96      * method available
       
    97      */
       
    98     MPIMItemData& ItemData();
       
    99     const MPIMItemData& ItemData() const;
       
   100 
       
   101     MPIMRepeatRuleData* GetRepeat();
       
   102     const MPIMRepeatRuleData* GetRepeat() const;
       
   103     TBool IsRepeating() const;
       
   104 
       
   105     bool isItemRepeating()const;
       
   106 
       
   107     void SetRepeating(TBool aSetRepeating);
       
   108 
       
   109     void setItemRepeating(jboolean aSetRepeating);
       
   110 
       
   111     /**
       
   112      * Sets event item id. This functions was introduces because
       
   113      * event item ids are handled as strings
       
   114      *
       
   115      * @param aEventItemId New event item id. If one exists, it will
       
   116      *        be overwriten
       
   117      */
       
   118     void SetEventItemIdL(const TPIMItemID& aEventItemId);
       
   119 
       
   120     /**
       
   121      * Returns the item id of this event item. This function was
       
   122      * introduced because event item ids are handled as strings
       
   123      *
       
   124      * @return Event item id
       
   125      */
       
   126     const TPIMItemID EventItemId() const;
       
   127 
       
   128     /**
       
   129      * Sets the last modified date/time of the item
       
   130      * @param aLastModified Last modification date of this item
       
   131      */
       
   132     void SetLastModifiedL(TPIMDate aLastModified);
       
   133 
       
   134     /**
       
   135      * Resets the item's internal state and remove all data
       
   136      * associated with this item. The item is ready for use
       
   137      * after reset
       
   138      */
       
   139     void PrepareForLoadL();
       
   140 
       
   141 public: // functions from cpimbase item
       
   142 
       
   143     int getPreferredIndex(TPIMField aField) const;
       
   144 
       
   145 protected: // Constructors
       
   146 
       
   147     /**
       
   148      * C++ constructor.
       
   149      */
       
   150     CPIMEventItem(const CPIMEventValidator& aValidator);
       
   151 
       
   152     /**
       
   153      * By default Symbian 2nd phase constructor is private.
       
   154      */
       
   155     void ConstructL();
       
   156 
       
   157 private: // Data
       
   158 
       
   159     /** Associated event adapter manager. Not owned. May be NULL. */
       
   160     MPIMEventAdapterManager* iEventAdapterManager;
       
   161 
       
   162     /** Associated event list adapter. Not owned. May be NULL. */
       
   163     MPIMEventListAdapter* iEventListAdapter;
       
   164 
       
   165     /** Repeat rule, \b owned by this object. */
       
   166     CPIMRepeatRule* iRepeatRule;
       
   167 
       
   168     /** Repeating flag. */
       
   169     TBool iIsRepeating;
       
   170 
       
   171     /** Repeat rule ownership flag. */
       
   172     TBool iIsRepeatRuleOwned;
       
   173 };
       
   174 
       
   175 #endif // CPIMEVENTITEM_H
       
   176 // End of File