epoc32/include/calchangecallback.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// 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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#ifndef __CALCHANGECALLBACK_H__
williamr@2
    17
#define __CALCHANGECALLBACK_H__
williamr@2
    18
williamr@2
    19
#include <calcommon.h>
williamr@2
    20
williamr@2
    21
class TCalChangeEntry;
williamr@2
    22
williamr@2
    23
class MCalChangeCallBack
williamr@2
    24
/** A call back class for observing changes in the model view.
williamr@2
    25
williamr@2
    26
A client will not be notified of a change if it is the source of
williamr@2
    27
the change.
williamr@2
    28
williamr@2
    29
@publishedAll
williamr@2
    30
@deprecated
williamr@2
    31
*/
williamr@2
    32
	{
williamr@2
    33
public:
williamr@2
    34
	/** Instance view change type
williamr@2
    35
	@publishedAll
williamr@2
    36
	@deprecated
williamr@2
    37
	*/
williamr@2
    38
	enum TChangeType
williamr@2
    39
		{
williamr@2
    40
		/**	Entries are added */
williamr@2
    41
		EChangeAdd,
williamr@2
    42
		/** Entries are deleted */
williamr@2
    43
		EChangeDelete,
williamr@2
    44
		/** Entries are modified */
williamr@2
    45
		EChangeModify,
williamr@2
    46
		/** Undefined entries */
williamr@2
    47
		EChangeUndefined,
williamr@2
    48
		/** Entries cause overflow error */
williamr@2
    49
		EChangeOverflowError
williamr@2
    50
		};
williamr@2
    51
williamr@2
    52
	/** Instance view entry type
williamr@2
    53
	@publishedAll
williamr@2
    54
	@deprecated
williamr@2
    55
	*/
williamr@2
    56
	enum TChangeEntryType
williamr@2
    57
		{
williamr@2
    58
		/** Entry type is todo */
williamr@2
    59
		EChangeEntryTodo,
williamr@2
    60
		/** Entry type is event */
williamr@2
    61
		EChangeEntryEvent,
williamr@2
    62
		/** All entry types */
williamr@2
    63
		EChangeEntryAll
williamr@2
    64
		};
williamr@2
    65
	/** A call back function for change notification
williamr@2
    66
	@param aChangeEntryType Filters notifications to only notify about entries of this type (event/todo/all).
williamr@2
    67
williamr@2
    68
	*/
williamr@2
    69
	virtual void CalChangeNotification(TChangeEntryType aChangeEntryType) = 0;
williamr@2
    70
	};
williamr@2
    71
williamr@2
    72
/** A call back class for observing changes in the model view.
williamr@2
    73
williamr@2
    74
The call back returns an array containing information about at least
williamr@2
    75
one change to the database. The information includes the type of change
williamr@2
    76
and the identity of the item being changed.
williamr@2
    77
williamr@2
    78
A client will not be notified of a change if it is the source of
williamr@2
    79
the change.
williamr@2
    80
williamr@2
    81
@publishedAll
williamr@2
    82
@released
williamr@2
    83
*/
williamr@2
    84
class MCalChangeCallBack2
williamr@2
    85
	{
williamr@2
    86
public:
williamr@2
    87
	/** Instance view change type
williamr@2
    88
	@publishedAll
williamr@2
    89
	@released
williamr@2
    90
	*/
williamr@2
    91
	enum TChangeType
williamr@2
    92
		{
williamr@2
    93
		/**	Entries are added */
williamr@2
    94
		EChangeAdd,
williamr@2
    95
		/** Entries are deleted */
williamr@2
    96
		EChangeDelete,
williamr@2
    97
		/** Entries are modified */
williamr@2
    98
		EChangeModify,
williamr@2
    99
		/** Undefined entries */
williamr@2
   100
		EChangeUndefined
williamr@2
   101
		};
williamr@2
   102
williamr@2
   103
	/** Instance view entry type
williamr@2
   104
	@publishedAll
williamr@2
   105
	@released
williamr@2
   106
	*/
williamr@2
   107
	enum TChangeEntryType
williamr@2
   108
		{
williamr@2
   109
		/** Entry type is todo */
williamr@2
   110
		EChangeEntryTodo,
williamr@2
   111
		/** Entry type is event */
williamr@2
   112
		EChangeEntryEvent,
williamr@2
   113
		/** All entry types */
williamr@2
   114
		EChangeEntryAll
williamr@2
   115
		};
williamr@2
   116
	/** A call back function for change notification
williamr@2
   117
	@param aChangeItems  List of changes since the last notification.
williamr@2
   118
williamr@2
   119
	*/
williamr@2
   120
	virtual void CalChangeNotification(RArray<TCalChangeEntry>& aChangeItems) = 0;
williamr@2
   121
	};
williamr@2
   122
williamr@2
   123
/** Struct for storing change notification data.
williamr@2
   124
This contains the calendar local ID, the type of change and the entry type.
williamr@2
   125
williamr@2
   126
The iChangeType will only be set to EChangeEntryTodo or EChangeEntryEvent
williamr@2
   127
values. EChangeEntryAll is provided for callback registration only.
williamr@2
   128
williamr@2
   129
If iChangeType is EChangeUndefined or EChangeOverflowError, iEntryId and
williamr@2
   130
iEntryType are undefined and should not be used by clients.
williamr@2
   131
williamr@2
   132
@publishedAll
williamr@2
   133
@released
williamr@2
   134
*/
williamr@2
   135
struct TCalChangeEntry
williamr@2
   136
	{
williamr@2
   137
	/** Local UID of the entry */
williamr@2
   138
	TCalLocalUid iEntryId;
williamr@2
   139
	/** Type of change to the entry */
williamr@2
   140
	MCalChangeCallBack2::TChangeType iChangeType;
williamr@2
   141
	/** Type of entry */
williamr@2
   142
	MCalChangeCallBack2::TChangeEntryType iEntryType;
williamr@2
   143
	};
williamr@2
   144
williamr@2
   145
/** Class to encapsulate call back registration parameters.
williamr@2
   146
williamr@2
   147
The type of entries, the date range and whether undated todos are included
williamr@2
   148
can be specified.
williamr@2
   149
williamr@2
   150
@publishedAll
williamr@2
   151
@released
williamr@2
   152
*/
williamr@2
   153
class CCalChangeNotificationFilter
williamr@2
   154
	{
williamr@2
   155
public:
williamr@2
   156
	IMPORT_C static CCalChangeNotificationFilter* NewL(MCalChangeCallBack2::TChangeEntryType aChangeEntryType, TBool aIncludeUndatedTodos, const CalCommon::TCalTimeRange& aTimeRange);
williamr@2
   157
	IMPORT_C ~CCalChangeNotificationFilter();
williamr@2
   158
williamr@2
   159
	MCalChangeCallBack2::TChangeEntryType ChangeEntryType() const;
williamr@2
   160
	TCalTime StartTime() const;
williamr@2
   161
	TCalTime EndTime() const;
williamr@2
   162
	TBool IncludeUndatedTodos() const;
williamr@2
   163
williamr@2
   164
private:
williamr@2
   165
	CCalChangeNotificationFilter(MCalChangeCallBack2::TChangeEntryType aChangeEntryType, TBool aIncludeUndatedTodos, const CalCommon::TCalTimeRange& aTimeRange);
williamr@2
   166
williamr@2
   167
	MCalChangeCallBack2::TChangeEntryType iChangeEntryType;
williamr@2
   168
	CalCommon::TCalTimeRange iTimeRange;
williamr@2
   169
	TBool iIncludeUndatedTodos;
williamr@2
   170
	};
williamr@2
   171
williamr@2
   172
#endif // __CALCHANGECALLBACK_H__