epoc32/include/mw/asshddefs.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/asshddefs.h@2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
// Copyright (c) 1999-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 __ASSHDDEFS_H__
williamr@2
    17
#define __ASSHDDEFS_H__
williamr@2
    18
williamr@2
    19
/** @file
williamr@2
    20
@publishedAll
williamr@2
    21
@released */
williamr@2
    22
williamr@2
    23
// System includes
williamr@2
    24
#include <e32std.h>
williamr@2
    25
#include <babitflags.h>
williamr@2
    26
williamr@2
    27
// Constants
williamr@2
    28
williamr@2
    29
/** Maximum length of an alarm message. The message is usually displayed by the 
williamr@2
    30
alarm UI. */
williamr@2
    31
const TInt KMaxAlarmMessageLength = 0x80;
williamr@2
    32
/** Maximum length of the filename of the sound played when an alarm expires. */
williamr@2
    33
const TInt KMaxAlarmSoundNameLength = KMaxFileName;
williamr@2
    34
williamr@2
    35
// Type definitions
williamr@2
    36
/** A unique identifier allocated to each new alarm by the alarm server, so that 
williamr@2
    37
the client can identify them. By default, KNullAlarmId. */
williamr@2
    38
typedef TInt TAlarmId;
williamr@2
    39
/** A unique identifier that can optionally be used by clients to group 
williamr@2
    40
alarms into categories, for instance alarms associated with a particular application 
williamr@2
    41
or application engine. The alarm server ignores the category. It is relevant 
williamr@2
    42
to the client alone. */
williamr@2
    43
typedef TUid TAlarmCategory;
williamr@2
    44
//
williamr@2
    45
/** Flags that define an alarm's characteristics.
williamr@2
    46
williamr@2
    47
@see TAlarmCharacteristics */
williamr@2
    48
typedef TBitFlags8 TAlarmCharacteristicsFlags;
williamr@2
    49
//
williamr@2
    50
williamr@2
    51
/** A type to identify what kind of alarms should be deleted when using the API
williamr@2
    52
RASCliSession::AlarmDeleteByCategory()
williamr@2
    53
@see TTDeleteTypeEnum */
williamr@2
    54
typedef TInt TDeleteType;
williamr@2
    55
 
williamr@2
    56
/** Stores the text message associated with an alarm. */
williamr@2
    57
typedef TBuf<KMaxAlarmMessageLength> TAlarmMessage;
williamr@2
    58
/** Stores the name of a sound file which is played when an alarm activates. */
williamr@2
    59
typedef TBuf<KMaxAlarmSoundNameLength> TAlarmSoundName;
williamr@2
    60
//
williamr@2
    61
/** Defines a null alarm identifier. */
williamr@2
    62
const TAlarmId KNullAlarmId	= 0;
williamr@2
    63
//
williamr@2
    64
/** Defines the length in seconds of an alarm sound offset. */
williamr@2
    65
const TInt KDefaultSoundPlayOffsetInSeconds	= 0;
williamr@2
    66
/** Defines the length in seconds of an alarm sound duration. */
williamr@2
    67
const TInt KDefaultSoundPlayDurationInSeconds = 30;
williamr@2
    68
williamr@2
    69
// Constants
williamr@2
    70
/** A category that can be assigned to identify clock alarms to the client. The 
williamr@2
    71
server does not distinguish between alarm types. */
williamr@2
    72
const TAlarmCategory KASCliCategoryClock		= { 0x101F5030 };
williamr@2
    73
williamr@2
    74
/** Defines whether an alarm is enabled or disabled: 
williamr@2
    75
williamr@2
    76
An enabled alarm activates at a specified time. 
williamr@2
    77
williamr@2
    78
A disabled alarm remains in the alarm server queue but is not active. 
williamr@2
    79
williamr@2
    80
You can get or set an alarm's status using the RASCliSession class. */
williamr@2
    81
enum TAlarmStatus
williamr@2
    82
	{
williamr@2
    83
	/** The alarm is currently enabled. */
williamr@2
    84
	EAlarmStatusEnabled = 0,
williamr@2
    85
williamr@2
    86
	/** The alarm is currently disabled, and will not expire. */
williamr@2
    87
	EAlarmStatusDisabled,
williamr@2
    88
	};
williamr@2
    89
williamr@2
    90
/** Represents an alarm's state. Alarms can have only one state. */
williamr@2
    91
enum TAlarmState
williamr@2
    92
	{
williamr@2
    93
	/** The alarm state is not currently known by the alarm server. */
williamr@2
    94
	EAlarmStateInPreparation = -1,
williamr@2
    95
williamr@2
    96
	/** The alarm is waiting for its expiry time to be reached. */
williamr@2
    97
	EAlarmStateQueued = 0,
williamr@2
    98
williamr@2
    99
	/** The alarm is snoozed. When the snooze period is over, the alarm expires again. */
williamr@2
   100
	EAlarmStateSnoozed,
williamr@2
   101
williamr@2
   102
	/** The alarm is waiting to be notified. 
williamr@2
   103
	
williamr@2
   104
	This state occurs when an alarm expires while another is being notified. When 
williamr@2
   105
	this happens, the alarm being notified changes state to EAlarmStateWaitingToNotify. 
williamr@2
   106
	This means that if it is set to be the next alarm to be notified, notification 
williamr@2
   107
	will happen after the newly expired alarm has been notified and dismissed. */
williamr@2
   108
	EAlarmStateWaitingToNotify,
williamr@2
   109
williamr@2
   110
	/** The alarm is currently notifying. */
williamr@2
   111
	EAlarmStateNotifying,
williamr@2
   112
williamr@2
   113
	/** The alarm has already notified and has been dismissed. Any alarm which remains 
williamr@2
   114
	in this state is dead. */
williamr@2
   115
	EAlarmStateNotified
williamr@2
   116
	};
williamr@2
   117
williamr@2
   118
/** Defines an alarm session type as timed or untimed. This property is ignored by 
williamr@2
   119
the alarm server, and is for use by the client only. */
williamr@2
   120
enum TAlarmDayOrTimed
williamr@2
   121
	{
williamr@2
   122
	/** Timed alarm type (default). This alarm belongs to a timed event. This is an event 
williamr@2
   123
	with a defined start and finish time. The alarm notification 
williamr@2
   124
	time is specified as an offset from the event's start time, so that when the 
williamr@2
   125
	event time changes, so does the alarm time. */
williamr@2
   126
	EASShdAlarmTypeTimed = 0,
williamr@2
   127
williamr@2
   128
	/** Day alarm type. This alarm belongs to untimed events; these do not have 
williamr@2
   129
	a defined start and finish time, but have an activation time. */
williamr@2
   130
	EASShdAlarmTypeDay
williamr@2
   131
	};
williamr@2
   132
williamr@2
   133
/** Defines the sound state of the global alarm server . */
williamr@2
   134
enum TAlarmGlobalSoundState
williamr@2
   135
	{
williamr@2
   136
	/** When an alarm expires, the alarm sound is played. */
williamr@2
   137
	EAlarmGlobalSoundStateOn = 0,
williamr@2
   138
williamr@2
   139
	/** When an alarm expires, no sound plays. */
williamr@2
   140
	EAlarmGlobalSoundStateOff
williamr@2
   141
	};
williamr@2
   142
williamr@2
   143
/** Defines how an alarm is to be repeated. */
williamr@2
   144
enum TAlarmRepeatDefinition
williamr@2
   145
	{
williamr@2
   146
	/** The alarm expires only once, and is then deleted from the alarm server. By 
williamr@2
   147
	default, all alarms behave this way. 
williamr@2
   148
	
williamr@2
   149
	Standard repeat-once alarms are date relative, that is, they occur on a fixed 
williamr@2
   150
	date and point in time. 
williamr@2
   151
	
williamr@2
   152
	If the user changes the system date or time so that the new time is in the 
williamr@2
   153
	future, and the new time is after the previously calculated expiry time:
williamr@2
   154
	
williamr@2
   155
	By less than 12 hours, the alarm expires immediately. 
williamr@2
   156
	
williamr@2
   157
	By more than 12 horus, the alarm is silently discarded. 
williamr@2
   158
	
williamr@2
   159
	If the user changes the system date or time so that the new time is before 
williamr@2
   160
	the next calculated expiry time, the alarm type continues to be a
williamr@2
   161
	"Repeat once" alarm*/
williamr@2
   162
	EAlarmRepeatDefintionRepeatOnce	= 0,
williamr@2
   163
williamr@2
   164
	/** When initially scheduling the alarm, the date is always within the 
williamr@2
   165
	next 24 hours. For example:
williamr@2
   166
	
williamr@2
   167
	The current time is 15:00, and the alarm time specified is 14:00. The 
williamr@2
   168
	alarm expires tomorrow at 14:00. 
williamr@2
   169
	
williamr@2
   170
	The current time is 15:00, and the alarm time specified is 16:00. The 
williamr@2
   171
	alarm expires today at 16:00. 
williamr@2
   172
	
williamr@2
   173
	If the alarm is missed, i.e. because the alarm server is inactive, then 
williamr@2
   174
	the alarm changes its type from "Repeat in the next 24 Hours" to "Repeat once".
williamr@2
   175
	
williamr@2
   176
	If the user changes the system date or time so that the new time is in the 
williamr@2
   177
	future, and the new time is after the previously calculated expiry time:
williamr@2
   178
	
williamr@2
   179
	By less than 12 hours, the alarm expires immediately. 
williamr@2
   180
	
williamr@2
   181
	By more than 12 horus, the alarm is silently discarded. 
williamr@2
   182
	
williamr@2
   183
	If the user changes the system date or time so that the new time is 
williamr@2
   184
	before the next calculated expiry time:
williamr@2
   185
williamr@2
   186
	By less than 12 hours, no change in alarm type, and the alarm 
williamr@2
   187
	remains queued.
williamr@2
   188
williamr@2
   189
	By greater than 12 hours, the alarm changes its type from 
williamr@2
   190
	"Repeat in the next 24 Hours" to "Repeat once".	Subsequent changes in system 
williamr@2
   191
	time result in the behaviour described by the EAlarmRepeatDefintionRepeatOnce 
williamr@2
   192
	characteristic. */
williamr@2
   193
	EAlarmRepeatDefintionRepeatNext24Hours,
williamr@2
   194
williamr@2
   195
	/** The alarm repeats every day at the same time. If the user changes the system 
williamr@2
   196
	date or time, this alarm behaves in the same way as a "Repeat once" alarm, 
williamr@2
   197
	except that the alarm is not deleted, but rescheduled for the next available 
williamr@2
   198
	time. 
williamr@2
   199
	
williamr@2
   200
	If the user changes the system date or time to a point in the past, there 
williamr@2
   201
	are no phantom alarm expiries. */
williamr@2
   202
	EAlarmRepeatDefintionRepeatDaily,
williamr@2
   203
williamr@2
   204
	/** The alarm repeats every work day at the same time. If the user changes the 
williamr@2
   205
	system date or time, this alarm behaves in the same way as a "Repeat once" 
williamr@2
   206
	alarm, except that the alarm is not deleted, but rescheduled for the next 
williamr@2
   207
	available time. 
williamr@2
   208
	
williamr@2
   209
	If the user changes the system date or time to a point in the past, there 
williamr@2
   210
	are no phantom alarm expiries. */
williamr@2
   211
	EAlarmRepeatDefintionRepeatWorkday,
williamr@2
   212
williamr@2
   213
	/** The alarm repeats every week, on the same day at the same time. If the user 
williamr@2
   214
	changes the system date or time, this alarm behaves in the same way as a "Repeat 
williamr@2
   215
	once" alarm, except that the alarm is not deleted, but rescheduled for the 
williamr@2
   216
	next available time.
williamr@2
   217
	
williamr@2
   218
	If the user changes the system date or time to a point in the past, there 
williamr@2
   219
	are no phantom alarm expiries. */
williamr@2
   220
	EAlarmRepeatDefintionRepeatWeekly,
williamr@2
   221
williamr@2
   222
	/** The alarm repeats every specified day at the same time. If the user
williamr@2
   223
	changes the system date or time, this alarm behaves in the same way as a
williamr@2
   224
	"repeat once" alarm, except that the alarm is not deleted, but rescheduled
williamr@2
   225
	for the next available time.
williamr@2
   226
	 
williamr@2
   227
    If the user changes the system date or time to a point in the past, there
williamr@2
   228
    are no phantom alarm expiries.*/ 
williamr@2
   229
	EAlarmRepeatDefinitionRepeatDailyOnGivenDays
williamr@2
   230
	};
williamr@2
   231
williamr@2
   232
/** Defines various alarm characteristics. */
williamr@2
   233
enum TAlarmCharacteristics
williamr@2
   234
	{
williamr@2
   235
	/** Sets an alarm to be session-only. This alarm only exists as long as a session 
williamr@2
   236
	is maintained with the alarm server. Session alarms are removed from the alarm 
williamr@2
   237
	queue when the originating session disconnects from the server. By default, 
williamr@2
   238
	all alarms are persistent and remain so, even after the initiating session 
williamr@2
   239
	has disconnected. */
williamr@2
   240
	EAlarmCharacteristicsSessionSpecific = 0,
williamr@2
   241
williamr@2
   242
	/** Do not display a screen. By default, all alarms result in a suitable screen 
williamr@2
   243
	being displayed, depending on the device. Use this flag to disable this default 
williamr@2
   244
	behaviour. */
williamr@2
   245
	EAlarmCharacteristicsDoNotNotifyAlarmAlertServer = 1,
williamr@2
   246
williamr@2
   247
	/** Sets an alarm to be floating - floating alarms expire at the current local time,
williamr@2
   248
	regardless of the current locale or DST rules.*/
williamr@2
   249
	EAlarmCharacteristicsIsFixed = 2,
williamr@2
   250
	
williamr@2
   251
	/** Do not notify if its due time is in the past.*/
williamr@2
   252
	EAlarmCharacteristicsDeQueueIfDueTimeInPast = 3,
williamr@2
   253
	//
williamr@2
   254
	EAlarmCharacteristicsLast
williamr@2
   255
	};
williamr@2
   256
williamr@2
   257
/** This enumeration defines the events that can be reported by the alarm server. 
williamr@2
   258
williamr@2
   259
These events are channelled to the client using the RASCliSession::NotifyChange() 
williamr@2
   260
method. 
williamr@2
   261
williamr@2
   262
@see TAlarmState */
williamr@2
   263
enum TAlarmChangeEvent
williamr@2
   264
	{
williamr@2
   265
	/** An alarm has changed state. 
williamr@2
   266
	
williamr@2
   267
	@see TAlarmState */
williamr@2
   268
	EAlarmChangeEventState = 1,
williamr@2
   269
williamr@2
   270
	/** An alarm has changed status. 
williamr@2
   271
	
williamr@2
   272
	@see TAlarmStatus */
williamr@2
   273
	EAlarmChangeEventStatus = 2,
williamr@2
   274
williamr@2
   275
	/** An alarm has changed characteristics. 
williamr@2
   276
	
williamr@2
   277
	@see TAlarmCharacteristics */
williamr@2
   278
	EAlarmChangeEventCharacteristics = 3,
williamr@2
   279
williamr@2
   280
	/** An alarm has been deleted from the queue of alarms. */
williamr@2
   281
	EAlarmChangeEventAlarmDeletion = 4,
williamr@2
   282
williamr@2
   283
	/** An alarm has been added to the queue of alarms. */
williamr@2
   284
	EAlarmChangeEventAlarmAddition = 5,
williamr@2
   285
williamr@2
   286
	/** An alarm has expired. */
williamr@2
   287
	EAlarmChangeEventTimerExpired = 6,
williamr@2
   288
williamr@2
   289
	/** The sound for an alarm has just started playing. */
williamr@2
   290
	EAlarmChangeEventSoundPlaying = 7,
williamr@2
   291
williamr@2
   292
	/** The sound for an alarm has just stopped playing. */
williamr@2
   293
	EAlarmChangeEventSoundStopped = 8,
williamr@2
   294
williamr@2
   295
	/** The sound intervals associated with sound timing have changed. */
williamr@2
   296
	EAlarmChangeEventPlayIntervalsChanged = 9,
williamr@2
   297
williamr@2
   298
	/** The global sound state (on/off) has changed. */
williamr@2
   299
	EAlarmChangeEventGlobalSoundStateChanged = 10,
williamr@2
   300
williamr@2
   301
	/** The next alarm at the head of the alarm queue has changed. */
williamr@2
   302
	EAlarmChangeEventHeadQueueItemChanged = 11,
williamr@2
   303
williamr@2
   304
	/** The system date or time has changed, or the days defined as workdays have changed. */
williamr@2
   305
	EAlarmChangeEventSystemDateTimeChanged = 12,
williamr@2
   306
williamr@2
   307
	/** The alarm alert server has been instructed to show the 'alarm expired' display. */
williamr@2
   308
	EAlarmChangeEventAlarmUIVisible = 13,
williamr@2
   309
williamr@2
   310
	/** The alarm alert server has been instructed to hide the 'alarm expired' display. */
williamr@2
   311
	EAlarmChangeEventAlarmUIInvisible = 14,
williamr@2
   312
williamr@2
   313
	/** Alarm sounds have been temporarily silenced, the current alarm has been paused 
williamr@2
   314
	or re-enabled. */
williamr@2
   315
	EAlarmChangeEventSoundSilence = 15,
williamr@2
   316
williamr@2
   317
	/** The data associated with an alarm has changed. */
williamr@2
   318
	EAlarmChangeEventAlarmData = 16,
williamr@2
   319
williamr@2
   320
	/** A restore from backup of the alarm server has started. Alarms cannot be added/deleted 
williamr@2
   321
	until this has finished.  */
williamr@2
   322
	EAlarmChangeEventRestoreStarted = 17,
williamr@2
   323
williamr@2
   324
	/** A restore from backup of the alarm server has failed. Alarms can be added/deleted again. */
williamr@2
   325
	EAlarmChangeEventRestoreFailed = 18,
williamr@2
   326
williamr@2
   327
	/** A restore from backup of the alarm server has completed. The alarm queue has changed. */
williamr@2
   328
	EAlarmChangeEventRestoreCompleted = 19,
williamr@2
   329
williamr@2
   330
	/** Last change event (anchor). This is always at the end of the list. */
williamr@2
   331
	EAlarmChangeEventLast,
williamr@2
   332
	
williamr@2
   333
	/** An undefined alarm event has occurred. */
williamr@2
   334
	EAlarmChangeEventUndefined = 0
williamr@2
   335
	};
williamr@2
   336
williamr@2
   337
/** Identifies server-initiated panics relating to the client session. */
williamr@2
   338
enum TAlarmServerInitiatedClientPanic
williamr@2
   339
	{
williamr@2
   340
	/** This panic occurs when the client requests a copy of any data attached to an 
williamr@2
   341
	alarm, but does not supply enough buffer space to contain the data. */
williamr@2
   342
	EAlarmServerInitiatedClientPanicInsufficientRoomForAlarmData = 0,
williamr@2
   343
williamr@2
   344
	/** This panic usually occurs when a client method tries to write to a descriptor 
williamr@2
   345
	(sometimes asynchronously), and the client-supplied descriptor is not valid. */
williamr@2
   346
	EAlarmServerInitiatedClientPanicBadDescriptor = 1,
williamr@2
   347
williamr@2
   348
	/** This panic occurs when a client already has an outstanding notification request, 
williamr@2
   349
	but attempts to request another. */
williamr@2
   350
	EAlarmServerInitiatedClientPanicChangeNotificationAlreadyOutstanding = 2,
williamr@2
   351
williamr@2
   352
	/** This panic occurs when a client tries to perform an invalid operation. */
williamr@2
   353
	EAlarmServerInitiatedClientPanicInvalidOperation = 3,
williamr@2
   354
williamr@2
   355
	/** This panic occurs when a request to add an alarm contains a null alarm identiifer. 
williamr@2
   356
	In the case of alarms with notifications, the client should pre-allocate the 
williamr@2
   357
	alarm identifier before requesting the notification. */
williamr@2
   358
	EAlarmServerInitiatedClientPanicBadPreAllocatedAlarmId = 4
williamr@2
   359
williamr@2
   360
	};
williamr@2
   361
williamr@2
   362
/** Identifies what kind of alarms the client wants to delete. */
williamr@2
   363
enum TDeleteTypeEnum
williamr@2
   364
	{
williamr@2
   365
	/** All type of alarms. */
williamr@2
   366
	EAllAlarms = 0,
williamr@2
   367
	/** Alarms future of the current time */
williamr@2
   368
	EFuture = 1,
williamr@2
   369
	/** Alarms in the past of the current time but notifying, or waiting to notify, or snoozed by, the user  */
williamr@2
   370
	EActive = 2,
williamr@2
   371
	/** alarms that has been dismissed by the user  */
williamr@2
   372
	EExpired = 4
williamr@2
   373
	};
williamr@2
   374
williamr@2
   375
/**
williamr@2
   376
This enumeration indicates which days of the week an alarm with a repeat
williamr@2
   377
definition of EAlarmRepeatDefinitionRepeatDailyOnGivenDays activates on.  Days
williamr@2
   378
are combined using the bitwise OR operator.
williamr@2
   379
williamr@2
   380
@prototype
williamr@2
   381
*/
williamr@2
   382
enum TAlarmDays
williamr@2
   383
    {
williamr@2
   384
    /** Alarm is active on Monday. */
williamr@2
   385
    EAlarmDayMonday    = 0x01,
williamr@2
   386
    /** Alarm is active on Tuesday. */
williamr@2
   387
    EAlarmDayTuesday   = 0x02,
williamr@2
   388
    /** Alarm is active on Wednesday. */
williamr@2
   389
    EAlarmDayWednesday = 0x04,
williamr@2
   390
    /** Alarm is active on Thursday. */
williamr@2
   391
    EAlarmDayThursday  = 0x08,
williamr@2
   392
    /** Alarm is active on Friday. */
williamr@2
   393
    EAlarmDayFriday    = 0x10,
williamr@2
   394
    /** Alarm is active on Saturday. */
williamr@2
   395
    EAlarmDaySaturday  = 0x20,
williamr@2
   396
    /** Alarm is active on Sunday. */
williamr@2
   397
    EAlarmDaySunday    = 0x40
williamr@2
   398
    };
williamr@2
   399
williamr@2
   400
/** Identifies the type of alarm which was missed.  A UTC offset change will only
williamr@2
   401
affect floating alarms whereas a system time change may affect either floating
williamr@2
   402
or fixed alarms.
williamr@2
   403
@see TASShdAlarmedInstanceParams
williamr@2
   404
@see CASSrvAlarmQueue::MEnvChangeHandleEvent
williamr@2
   405
*/
williamr@2
   406
enum TASShdAlarmTimeType
williamr@2
   407
	{
williamr@2
   408
	/** Floating time alarm. */
williamr@2
   409
	EFloating,
williamr@2
   410
	/** Floating or fixed time alarm. */
williamr@2
   411
	EFloatingOrFixed
williamr@2
   412
	};
williamr@2
   413
williamr@2
   414
#endif