1.1 --- a/epoc32/include/calchangecallback.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/calchangecallback.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,172 @@
1.4 -calchangecallback.h
1.5 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __CALCHANGECALLBACK_H__
1.21 +#define __CALCHANGECALLBACK_H__
1.22 +
1.23 +#include <calcommon.h>
1.24 +
1.25 +class TCalChangeEntry;
1.26 +
1.27 +class MCalChangeCallBack
1.28 +/** A call back class for observing changes in the model view.
1.29 +
1.30 +A client will not be notified of a change if it is the source of
1.31 +the change.
1.32 +
1.33 +@publishedAll
1.34 +@deprecated
1.35 +*/
1.36 + {
1.37 +public:
1.38 + /** Instance view change type
1.39 + @publishedAll
1.40 + @deprecated
1.41 + */
1.42 + enum TChangeType
1.43 + {
1.44 + /** Entries are added */
1.45 + EChangeAdd,
1.46 + /** Entries are deleted */
1.47 + EChangeDelete,
1.48 + /** Entries are modified */
1.49 + EChangeModify,
1.50 + /** Undefined entries */
1.51 + EChangeUndefined,
1.52 + /** Entries cause overflow error */
1.53 + EChangeOverflowError
1.54 + };
1.55 +
1.56 + /** Instance view entry type
1.57 + @publishedAll
1.58 + @deprecated
1.59 + */
1.60 + enum TChangeEntryType
1.61 + {
1.62 + /** Entry type is todo */
1.63 + EChangeEntryTodo,
1.64 + /** Entry type is event */
1.65 + EChangeEntryEvent,
1.66 + /** All entry types */
1.67 + EChangeEntryAll
1.68 + };
1.69 + /** A call back function for change notification
1.70 + @param aChangeEntryType Filters notifications to only notify about entries of this type (event/todo/all).
1.71 +
1.72 + */
1.73 + virtual void CalChangeNotification(TChangeEntryType aChangeEntryType) = 0;
1.74 + };
1.75 +
1.76 +/** A call back class for observing changes in the model view.
1.77 +
1.78 +The call back returns an array containing information about at least
1.79 +one change to the database. The information includes the type of change
1.80 +and the identity of the item being changed.
1.81 +
1.82 +A client will not be notified of a change if it is the source of
1.83 +the change.
1.84 +
1.85 +@publishedAll
1.86 +@released
1.87 +*/
1.88 +class MCalChangeCallBack2
1.89 + {
1.90 +public:
1.91 + /** Instance view change type
1.92 + @publishedAll
1.93 + @released
1.94 + */
1.95 + enum TChangeType
1.96 + {
1.97 + /** Entries are added */
1.98 + EChangeAdd,
1.99 + /** Entries are deleted */
1.100 + EChangeDelete,
1.101 + /** Entries are modified */
1.102 + EChangeModify,
1.103 + /** Undefined entries */
1.104 + EChangeUndefined
1.105 + };
1.106 +
1.107 + /** Instance view entry type
1.108 + @publishedAll
1.109 + @released
1.110 + */
1.111 + enum TChangeEntryType
1.112 + {
1.113 + /** Entry type is todo */
1.114 + EChangeEntryTodo,
1.115 + /** Entry type is event */
1.116 + EChangeEntryEvent,
1.117 + /** All entry types */
1.118 + EChangeEntryAll
1.119 + };
1.120 + /** A call back function for change notification
1.121 + @param aChangeItems List of changes since the last notification.
1.122 +
1.123 + */
1.124 + virtual void CalChangeNotification(RArray<TCalChangeEntry>& aChangeItems) = 0;
1.125 + };
1.126 +
1.127 +/** Struct for storing change notification data.
1.128 +This contains the calendar local ID, the type of change and the entry type.
1.129 +
1.130 +The iChangeType will only be set to EChangeEntryTodo or EChangeEntryEvent
1.131 +values. EChangeEntryAll is provided for callback registration only.
1.132 +
1.133 +If iChangeType is EChangeUndefined or EChangeOverflowError, iEntryId and
1.134 +iEntryType are undefined and should not be used by clients.
1.135 +
1.136 +@publishedAll
1.137 +@released
1.138 +*/
1.139 +struct TCalChangeEntry
1.140 + {
1.141 + /** Local UID of the entry */
1.142 + TCalLocalUid iEntryId;
1.143 + /** Type of change to the entry */
1.144 + MCalChangeCallBack2::TChangeType iChangeType;
1.145 + /** Type of entry */
1.146 + MCalChangeCallBack2::TChangeEntryType iEntryType;
1.147 + };
1.148 +
1.149 +/** Class to encapsulate call back registration parameters.
1.150 +
1.151 +The type of entries, the date range and whether undated todos are included
1.152 +can be specified.
1.153 +
1.154 +@publishedAll
1.155 +@released
1.156 +*/
1.157 +class CCalChangeNotificationFilter
1.158 + {
1.159 +public:
1.160 + IMPORT_C static CCalChangeNotificationFilter* NewL(MCalChangeCallBack2::TChangeEntryType aChangeEntryType, TBool aIncludeUndatedTodos, const CalCommon::TCalTimeRange& aTimeRange);
1.161 + IMPORT_C ~CCalChangeNotificationFilter();
1.162 +
1.163 + MCalChangeCallBack2::TChangeEntryType ChangeEntryType() const;
1.164 + TCalTime StartTime() const;
1.165 + TCalTime EndTime() const;
1.166 + TBool IncludeUndatedTodos() const;
1.167 +
1.168 +private:
1.169 + CCalChangeNotificationFilter(MCalChangeCallBack2::TChangeEntryType aChangeEntryType, TBool aIncludeUndatedTodos, const CalCommon::TCalTimeRange& aTimeRange);
1.170 +
1.171 + MCalChangeCallBack2::TChangeEntryType iChangeEntryType;
1.172 + CalCommon::TCalTimeRange iTimeRange;
1.173 + TBool iIncludeUndatedTodos;
1.174 + };
1.175 +
1.176 +#endif // __CALCHANGECALLBACK_H__