calendarui/caleneditor/src/caleneditorreminderfield.cpp
author hgs
Wed, 25 Aug 2010 14:02:13 +0530
changeset 63 a3cb48f6c889
parent 57 bb2d3e476f29
child 64 1881ad52dc45
permissions -rw-r--r--
201033
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
* Definition of CalenEditorReminderField class.
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
*/
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
// System Includes
45
hgs
parents: 23
diff changeset
    21
#include <QDate>
hgs
parents: 23
diff changeset
    22
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include <hbdataformmodelitem.h>
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <hbdataformmodel.h>
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <hbdataform.h>
45
hgs
parents: 23
diff changeset
    26
#include <hbdatetimepicker.h>
hgs
parents: 23
diff changeset
    27
#include <hbextendedlocale.h>
hgs
parents: 23
diff changeset
    28
#include <hbi18ndef.h>
hgs
parents: 23
diff changeset
    29
#include <hbdialog.h>
hgs
parents: 23
diff changeset
    30
#include <hblabel.h>
hgs
parents: 23
diff changeset
    31
#include <hbaction.h>
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
// User Includes
57
hgs
parents: 55
diff changeset
    34
#include "calenagendautils.h"
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
#include "caleneditorreminderfield.h"
51
hgs
parents: 45
diff changeset
    36
#include "OstTraceDefinitions.h"
hgs
parents: 45
diff changeset
    37
#ifdef OST_TRACE_COMPILER_IN_USE
hgs
parents: 45
diff changeset
    38
#include "caleneditorreminderfieldTraces.h"
hgs
parents: 45
diff changeset
    39
#endif
hgs
parents: 45
diff changeset
    40
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
45
hgs
parents: 23
diff changeset
    42
#define numberOfMinutesInADay 1440
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
/*!
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
	\class CalenEditorReminderField
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
 */
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
/*!
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
	Constructor.
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
	\param parent QObject pointer
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
 */
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
CalenEditorReminderField::CalenEditorReminderField(
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
										CalenEditorPrivate* calenEditor,
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
										HbDataForm* form, 
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
										HbDataFormModel* model,
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
										QObject *parent)
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
	:QObject(parent),
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
	 mCalenEditor(calenEditor), 
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
	 mEditorForm(form), 
45
hgs
parents: 23
diff changeset
    60
	 mCalenEditorModel(model),
55
hgs
parents: 51
diff changeset
    61
	 mCustomReminderTimeItem(0),
45
hgs
parents: 23
diff changeset
    62
	 mReminderTimeAdded(false)
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
{
51
hgs
parents: 45
diff changeset
    64
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_CALENEDITORREMINDERFIELD_ENTRY );
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
	mReminderItem = new HbDataFormModelItem();
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
	mReminderItem->setType(HbDataFormModelItem::ComboBoxItem);
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
	mReminderItem->setData(HbDataFormModelItem::LabelRole,
45
hgs
parents: 23
diff changeset
    68
						   hbTrId("txt_calendar_setlabel_reminder"));	
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
	// Add it to the model
45
hgs
parents: 23
diff changeset
    70
	mCalenEditorModel->appendDataFormItem(mReminderItem,
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
										mCalenEditorModel->invisibleRootItem());
51
hgs
parents: 45
diff changeset
    72
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_CALENEDITORREMINDERFIELD_EXIT );
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
}
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
/*!
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
	 Destructor
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
 */
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
CalenEditorReminderField::~CalenEditorReminderField()
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
{
51
hgs
parents: 45
diff changeset
    80
	OstTraceFunctionEntry0( DUP1_CALENEDITORREMINDERFIELD_CALENEDITORREMINDERFIELD_ENTRY );
45
hgs
parents: 23
diff changeset
    81
	if(mReminderHash.count()) {
hgs
parents: 23
diff changeset
    82
		mReminderHash.clear();
hgs
parents: 23
diff changeset
    83
	}
51
hgs
parents: 45
diff changeset
    84
	OstTraceFunctionExit0( DUP1_CALENEDITORREMINDERFIELD_CALENEDITORREMINDERFIELD_EXIT );
45
hgs
parents: 23
diff changeset
    85
}
hgs
parents: 23
diff changeset
    86
hgs
parents: 23
diff changeset
    87
/*!
hgs
parents: 23
diff changeset
    88
	 Set the reminder choices.
hgs
parents: 23
diff changeset
    89
 */
hgs
parents: 23
diff changeset
    90
void CalenEditorReminderField::setReminderChoices()
hgs
parents: 23
diff changeset
    91
{
51
hgs
parents: 45
diff changeset
    92
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_SETREMINDERCHOICES_ENTRY );
45
hgs
parents: 23
diff changeset
    93
	// Create the reminder choices
hgs
parents: 23
diff changeset
    94
	QStringList reminderChoices;
hgs
parents: 23
diff changeset
    95
	reminderChoices << hbTrId("txt_calendar_setlabel_reminder_val_off")
hgs
parents: 23
diff changeset
    96
				<< hbTrId("txt_calendar_setlabel_reminder_val_at_the_start")
hgs
parents: 23
diff changeset
    97
				<< hbTrId("txt_calendar_setlabel_reminder_val_15_minutes_befo")
hgs
parents: 23
diff changeset
    98
				<< hbTrId("txt_calendar_setlabel_reminder_val_30_minutes_befo")
hgs
parents: 23
diff changeset
    99
				<< hbTrId("txt_calendar_setlabel_reminder_val_1_hour_before");
hgs
parents: 23
diff changeset
   100
51
hgs
parents: 45
diff changeset
   101
	mReminderItem->setContentWidgetData("items", reminderChoices);
hgs
parents: 45
diff changeset
   102
	mReminderItem->setContentWidgetData("objectName", "remainderItem");
45
hgs
parents: 23
diff changeset
   103
hgs
parents: 23
diff changeset
   104
	// Build the hash map for the reminder.
hgs
parents: 23
diff changeset
   105
	mReminderHash[0] = -1; // OFF.
hgs
parents: 23
diff changeset
   106
	mReminderHash[1] = 0;
hgs
parents: 23
diff changeset
   107
	mReminderHash[2] = 15;
hgs
parents: 23
diff changeset
   108
	mReminderHash[3] = 30;
hgs
parents: 23
diff changeset
   109
	mReminderHash[4] = 60;
hgs
parents: 23
diff changeset
   110
	mReminderItem->setEnabled(true);
51
hgs
parents: 45
diff changeset
   111
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_SETREMINDERCHOICES_EXIT );
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
}
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
/*!
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
	 Adds reminder item to the model
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
 */
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
void CalenEditorReminderField::addItemToModel()
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
{	
51
hgs
parents: 45
diff changeset
   119
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_ADDITEMTOMODEL_ENTRY );
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
	// Add reminder to the model
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
	mCalenEditorModel->appendDataFormItem( mReminderItem,
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
				   mCalenEditorModel->invisibleRootItem());
51
hgs
parents: 45
diff changeset
   123
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_ADDITEMTOMODEL_EXIT );
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
}
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
/*!
45
hgs
parents: 23
diff changeset
   127
	 Removes reminder item from the model
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
 */
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
void CalenEditorReminderField::removeItemFromModel()
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
{
51
hgs
parents: 45
diff changeset
   131
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_REMOVEITEMFROMMODEL_ENTRY );
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
	mCalenEditorModel->removeItem(modelIndex());
51
hgs
parents: 45
diff changeset
   133
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_REMOVEITEMFROMMODEL_EXIT );
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
}
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
/*!
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
	 Populates reminder item with available choices to the user
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
	 \param newEntry bool value to indicate if its a new entry
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
 */
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
void CalenEditorReminderField::populateReminderItem(bool newEntry)
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
{
51
hgs
parents: 45
diff changeset
   142
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_POPULATEREMINDERITEM_ENTRY );
45
hgs
parents: 23
diff changeset
   143
	AgendaAlarm reminder;
hgs
parents: 23
diff changeset
   144
	bool pastEvent =  false;
hgs
parents: 23
diff changeset
   145
	
hgs
parents: 23
diff changeset
   146
	// Set reference date to start date or repeat until date accordingly to 
hgs
parents: 23
diff changeset
   147
	// decide whether its a past event or not.
hgs
parents: 23
diff changeset
   148
	QDate referenceDate;
hgs
parents: 23
diff changeset
   149
	if (!mCalenEditor->editedEntry()->isRepeating() || 
hgs
parents: 23
diff changeset
   150
					(mCalenEditor->isEditRangeThisOnly())) {
hgs
parents: 23
diff changeset
   151
		referenceDate = mCalenEditor->editedEntry()->startTime().date();
hgs
parents: 23
diff changeset
   152
	} else {
hgs
parents: 23
diff changeset
   153
		referenceDate = mCalenEditor->editedEntry()->repeatRule().until().date();
hgs
parents: 23
diff changeset
   154
	}
hgs
parents: 23
diff changeset
   155
	
hgs
parents: 23
diff changeset
   156
	if ((referenceDate < QDate::currentDate()) || 
hgs
parents: 23
diff changeset
   157
					(referenceDate == QDate::currentDate()
hgs
parents: 23
diff changeset
   158
					&& (mCalenEditor->editedEntry()->startTime().time() < 
hgs
parents: 23
diff changeset
   159
					QTime::currentTime()))) {
hgs
parents: 23
diff changeset
   160
		pastEvent = true;
hgs
parents: 23
diff changeset
   161
	}
hgs
parents: 23
diff changeset
   162
	
hgs
parents: 23
diff changeset
   163
	if (mCalenEditor->isAllDayEvent()) {
hgs
parents: 23
diff changeset
   164
		updateReminderChoicesForAllDay(referenceDate);
hgs
parents: 23
diff changeset
   165
	} else {
hgs
parents: 23
diff changeset
   166
		setReminderChoices();
hgs
parents: 23
diff changeset
   167
	}
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
	// Set the default reminder value to 15 minutes 
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
	if (newEntry) {
45
hgs
parents: 23
diff changeset
   170
		if (!pastEvent) {
hgs
parents: 23
diff changeset
   171
			mReminderItem->setContentWidgetData("currentIndex", 2);
hgs
parents: 23
diff changeset
   172
			// Save the reminder alarm for the entry
hgs
parents: 23
diff changeset
   173
			reminder.setTimeOffset(mReminderHash.value(2));
hgs
parents: 23
diff changeset
   174
			reminder.setAlarmSoundName(QString(" "));
hgs
parents: 23
diff changeset
   175
			// Set the reminder to the entry as well as original entry.
hgs
parents: 23
diff changeset
   176
			mCalenEditor->editedEntry()->setAlarm(reminder);
hgs
parents: 23
diff changeset
   177
			mCalenEditor->originalEntry()->setAlarm(reminder);
hgs
parents: 23
diff changeset
   178
		} else {
hgs
parents: 23
diff changeset
   179
			mReminderItem->setContentWidgetData("currentIndex", 0);
hgs
parents: 23
diff changeset
   180
			mReminderItem->setEnabled(false);
hgs
parents: 23
diff changeset
   181
		}
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
	} else {
45
hgs
parents: 23
diff changeset
   183
		// If the alarm is not null,
hgs
parents: 23
diff changeset
   184
		// Check if all day event or not and then set the choices accordingly.
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
		if (mCalenEditor->editedEntry()->alarm().isNull()) {
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
			// Alarm is set off
57
hgs
parents: 55
diff changeset
   187
			mReminderItem->setContentWidgetData("currentIndex", ReminderOff);
45
hgs
parents: 23
diff changeset
   188
			if(mReminderTimeAdded) {
hgs
parents: 23
diff changeset
   189
				removeReminderTimeField();
hgs
parents: 23
diff changeset
   190
			}
57
hgs
parents: 55
diff changeset
   191
		} else if (!mCalenEditor->isAllDayEvent()) {
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
			// Get the reminder offset value.
45
hgs
parents: 23
diff changeset
   193
			int reminderOffset =
hgs
parents: 23
diff changeset
   194
			        mCalenEditor->editedEntry()->alarm().timeOffset();
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
			// Get the index value for the reminder combo box from the hash 
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
			// table.
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
			int index = mReminderHash.key(reminderOffset);
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
			mReminderItem->setContentWidgetData("currentIndex", index);
45
hgs
parents: 23
diff changeset
   199
		} else {
hgs
parents: 23
diff changeset
   200
			// Insert reminder time field and display entry's reminder time.
hgs
parents: 23
diff changeset
   201
			// If past then disable the field.
hgs
parents: 23
diff changeset
   202
			if (!mReminderTimeAdded) {
hgs
parents: 23
diff changeset
   203
				insertReminderTimeField();
57
hgs
parents: 55
diff changeset
   204
			}
hgs
parents: 55
diff changeset
   205
			if (pastEvent && mReminderTimeAdded) {
hgs
parents: 55
diff changeset
   206
				mCustomReminderTimeItem->setEnabled(false);
45
hgs
parents: 23
diff changeset
   207
			}
hgs
parents: 23
diff changeset
   208
			QTime referenceTime(0, 0, 0);
hgs
parents: 23
diff changeset
   209
			// Set the appropriate reminder depending on the value of time offset.
hgs
parents: 23
diff changeset
   210
			reminder = mCalenEditor->editedEntry()->alarm();
hgs
parents: 23
diff changeset
   211
			int offsetInMins = reminder.timeOffset();
hgs
parents: 23
diff changeset
   212
			if (offsetInMins < 0 || offsetInMins == 0) {
57
hgs
parents: 55
diff changeset
   213
				mReminderItem->setContentWidgetData("currentIndex", ReminderOnEventDay);
45
hgs
parents: 23
diff changeset
   214
				mReminderTimeForAllDay = referenceTime.addSecs(-(offsetInMins
hgs
parents: 23
diff changeset
   215
						* 60));
63
hgs
parents: 57
diff changeset
   216
			} else if (offsetInMins <= numberOfMinutesInADay) {
57
hgs
parents: 55
diff changeset
   217
				mReminderItem->setContentWidgetData("currentIndex", ReminderOneDayBefore);
45
hgs
parents: 23
diff changeset
   218
				mReminderTimeForAllDay = referenceTime.addSecs(-(offsetInMins
hgs
parents: 23
diff changeset
   219
						* 60));
hgs
parents: 23
diff changeset
   220
			} else {
57
hgs
parents: 55
diff changeset
   221
				mReminderItem->setContentWidgetData("currentIndex", ReminderTwoDaysBefore);
45
hgs
parents: 23
diff changeset
   222
				offsetInMins %= (24 * 60);
hgs
parents: 23
diff changeset
   223
				mReminderTimeForAllDay = referenceTime.addSecs(-(offsetInMins
hgs
parents: 23
diff changeset
   224
						* 60));
hgs
parents: 23
diff changeset
   225
			}
hgs
parents: 23
diff changeset
   226
			setDisplayTime();
hgs
parents: 23
diff changeset
   227
		}
hgs
parents: 23
diff changeset
   228
		if (pastEvent) {
hgs
parents: 23
diff changeset
   229
			mReminderItem->setEnabled(false);
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
		}
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
	}
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
	mEditorForm->addConnection(mReminderItem,
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
							SIGNAL(currentIndexChanged(int)), this,
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
							SLOT(handleReminderIndexChanged(int)));
51
hgs
parents: 45
diff changeset
   235
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_POPULATEREMINDERITEM_EXIT );
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
}
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
/*!
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
	Triggerd from tapping on reminder item.
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
	Handles the reminder time change and updates the same in the event.
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
	\param index The new index chosen in the reminder list.
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
 */
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
void CalenEditorReminderField::handleReminderIndexChanged(int index)
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
{
51
hgs
parents: 45
diff changeset
   245
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_HANDLEREMINDERINDEXCHANGED_ENTRY );
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
	AgendaAlarm reminder;
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
	if (!mCalenEditor->editedEntry()->alarm().isNull()) {
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
		reminder = mCalenEditor->editedEntry()->alarm();
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
	}
45
hgs
parents: 23
diff changeset
   250
	// Check whether all day event or not and store appropriately.
hgs
parents: 23
diff changeset
   251
	if (!mCalenEditor->isAllDayEvent()) {
hgs
parents: 23
diff changeset
   252
		// If value for the index in hash table is -1 i.e reminder is "OFF",
hgs
parents: 23
diff changeset
   253
		// then set the default constructed reminder to
hgs
parents: 23
diff changeset
   254
		// the entry which is Null.
hgs
parents: 23
diff changeset
   255
		if (mReminderHash.value(index) < 0) {
hgs
parents: 23
diff changeset
   256
			// Construct the default alarm which is NULL
hgs
parents: 23
diff changeset
   257
			reminder = AgendaAlarm();
hgs
parents: 23
diff changeset
   258
		} else {
hgs
parents: 23
diff changeset
   259
			// If not zero then set the reminder offset
hgs
parents: 23
diff changeset
   260
			// value to the entry.
hgs
parents: 23
diff changeset
   261
			reminder.setTimeOffset(mReminderHash.value(index));
hgs
parents: 23
diff changeset
   262
			reminder.setAlarmSoundName(QString(" "));
hgs
parents: 23
diff changeset
   263
		}
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   264
	} else {
45
hgs
parents: 23
diff changeset
   265
		QDateTime reminderDateTimeForAllDay; 
hgs
parents: 23
diff changeset
   266
		QDateTime
hgs
parents: 23
diff changeset
   267
		        startDateTimeForAllDay(
hgs
parents: 23
diff changeset
   268
		                               mCalenEditor->editedEntry()->startTime().date(),
hgs
parents: 23
diff changeset
   269
		                               QTime(0, 0, 0));
57
hgs
parents: 55
diff changeset
   270
		if (mReminderItem->contentWidgetData("currentIndex") == ReminderOff) {
45
hgs
parents: 23
diff changeset
   271
			reminder = AgendaAlarm();
57
hgs
parents: 55
diff changeset
   272
			removeReminderTimeField();
45
hgs
parents: 23
diff changeset
   273
		} else {
hgs
parents: 23
diff changeset
   274
			int offset = 0;
57
hgs
parents: 55
diff changeset
   275
			if (mReminderItem->contentWidgetData("currentIndex") == ReminderOneDayBefore) {
45
hgs
parents: 23
diff changeset
   276
				offset = 1;
57
hgs
parents: 55
diff changeset
   277
			} else if (mReminderItem->contentWidgetData("currentIndex") == ReminderTwoDaysBefore) {
45
hgs
parents: 23
diff changeset
   278
				offset = 2;
hgs
parents: 23
diff changeset
   279
			}
hgs
parents: 23
diff changeset
   280
			if(!mReminderTimeAdded) {
hgs
parents: 23
diff changeset
   281
				insertReminderTimeField()
hgs
parents: 23
diff changeset
   282
;			}
hgs
parents: 23
diff changeset
   283
			// If on same day as that of the event then check if time has been 
hgs
parents: 23
diff changeset
   284
			// changed , if changed retain that else set default time.
hgs
parents: 23
diff changeset
   285
			if (offset == 0) {
hgs
parents: 23
diff changeset
   286
				if(mReminderTimeForAllDay == QTime(18, 0, 0, 0)) {
hgs
parents: 23
diff changeset
   287
					mReminderTimeForAllDay.setHMS(8, 0, 0);
hgs
parents: 23
diff changeset
   288
					setDisplayTime();
hgs
parents: 23
diff changeset
   289
				}
hgs
parents: 23
diff changeset
   290
			}
hgs
parents: 23
diff changeset
   291
			reminderDateTimeForAllDay.setDate(
hgs
parents: 23
diff changeset
   292
					mCalenEditor->editedEntry()->startTime().date().addDays(
hgs
parents: 23
diff changeset
   293
																	-offset));
hgs
parents: 23
diff changeset
   294
			reminderDateTimeForAllDay.setTime(mReminderTimeForAllDay);
hgs
parents: 23
diff changeset
   295
			int seconds =
hgs
parents: 23
diff changeset
   296
					reminderDateTimeForAllDay.secsTo(startDateTimeForAllDay);
57
hgs
parents: 55
diff changeset
   297
			int timeOffset = seconds / 60;
45
hgs
parents: 23
diff changeset
   298
			mCustomReminderTimeItem->setEnabled(true);
57
hgs
parents: 55
diff changeset
   299
			reminder.setTimeOffset(timeOffset);
45
hgs
parents: 23
diff changeset
   300
			reminder.setAlarmSoundName(QString(" "));
hgs
parents: 23
diff changeset
   301
		}
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   302
	}
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   303
	// Set the reminder to the entry.
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   304
	mCalenEditor->editedEntry()->setAlarm(reminder);
45
hgs
parents: 23
diff changeset
   305
	if(!mCalenEditor->isNewEntry()) {
51
hgs
parents: 45
diff changeset
   306
	mCalenEditor->addDiscardAction();
45
hgs
parents: 23
diff changeset
   307
	}
51
hgs
parents: 45
diff changeset
   308
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_HANDLEREMINDERINDEXCHANGED_EXIT );
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   309
}
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   310
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   311
/*!
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   312
	 Returns the mode index of the reminder item
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   313
	 \return Mode index of the reminder item
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   314
 */
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   315
QModelIndex CalenEditorReminderField::modelIndex()
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   316
{
51
hgs
parents: 45
diff changeset
   317
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_MODELINDEX_ENTRY );
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   318
	return mCalenEditorModel->indexFromItem(mReminderItem);
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   319
}
45
hgs
parents: 23
diff changeset
   320
hgs
parents: 23
diff changeset
   321
/*!
hgs
parents: 23
diff changeset
   322
	 Set reminder off.
hgs
parents: 23
diff changeset
   323
 */
hgs
parents: 23
diff changeset
   324
void CalenEditorReminderField::setReminderOff()
hgs
parents: 23
diff changeset
   325
{
51
hgs
parents: 45
diff changeset
   326
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_SETREMINDEROFF_ENTRY );
45
hgs
parents: 23
diff changeset
   327
	// Create the remindar choices
hgs
parents: 23
diff changeset
   328
	QStringList reminderChoices;
hgs
parents: 23
diff changeset
   329
	reminderChoices << hbTrId("txt_calendar_setlabel_reminder_val_off");
hgs
parents: 23
diff changeset
   330
	mReminderItem->setContentWidgetData(QString("items"), reminderChoices);
hgs
parents: 23
diff changeset
   331
	mReminderItem->setEnabled(false); 
51
hgs
parents: 45
diff changeset
   332
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_SETREMINDEROFF_EXIT );
45
hgs
parents: 23
diff changeset
   333
}
hgs
parents: 23
diff changeset
   334
hgs
parents: 23
diff changeset
   335
/*!
hgs
parents: 23
diff changeset
   336
	 Set the default alarm for a new all day event.
hgs
parents: 23
diff changeset
   337
 */
hgs
parents: 23
diff changeset
   338
void CalenEditorReminderField::setDefaultAlarmForAllDay()
hgs
parents: 23
diff changeset
   339
{	
51
hgs
parents: 45
diff changeset
   340
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_SETDEFAULTALARMFORALLDAY_ENTRY );
45
hgs
parents: 23
diff changeset
   341
	// Set default alarm if its a new entry.
hgs
parents: 23
diff changeset
   342
	if (mCalenEditor->isNewEntry()) {
hgs
parents: 23
diff changeset
   343
		AgendaAlarm reminder;
hgs
parents: 23
diff changeset
   344
		QDate defaultDate
hgs
parents: 23
diff changeset
   345
				(mCalenEditor->editedEntry()->startTime().date().addDays(-1));
55
hgs
parents: 51
diff changeset
   346
		// Set default time as 6pm of the previous day.
45
hgs
parents: 23
diff changeset
   347
		mReminderTimeForAllDay.setHMS(18, 0, 0, 0);
hgs
parents: 23
diff changeset
   348
		setDisplayTime();
hgs
parents: 23
diff changeset
   349
		QDateTime startDateTimeForAllDay(
hgs
parents: 23
diff changeset
   350
				mCalenEditor->editedEntry()->startTime().date(), QTime(0, 0));
hgs
parents: 23
diff changeset
   351
		QDateTime defaultReminderDateTimeForAllDay
hgs
parents: 23
diff changeset
   352
				(defaultDate, mReminderTimeForAllDay);
hgs
parents: 23
diff changeset
   353
		int offsetInSecs = 
hgs
parents: 23
diff changeset
   354
				defaultReminderDateTimeForAllDay.secsTo(startDateTimeForAllDay);
hgs
parents: 23
diff changeset
   355
		int offsetInMins = offsetInSecs/60;
hgs
parents: 23
diff changeset
   356
		reminder.setTimeOffset(offsetInMins);
hgs
parents: 23
diff changeset
   357
		reminder.setAlarmSoundName(QString(" "));
hgs
parents: 23
diff changeset
   358
		// Set the reminder to the entry as well as original entry.
hgs
parents: 23
diff changeset
   359
		mCalenEditor->editedEntry()->setAlarm(reminder);
hgs
parents: 23
diff changeset
   360
		mCalenEditor->originalEntry()->setAlarm(reminder);
hgs
parents: 23
diff changeset
   361
	}
51
hgs
parents: 45
diff changeset
   362
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_SETDEFAULTALARMFORALLDAY_EXIT );
45
hgs
parents: 23
diff changeset
   363
}
hgs
parents: 23
diff changeset
   364
hgs
parents: 23
diff changeset
   365
/*!
hgs
parents: 23
diff changeset
   366
	 Updates the reminder choices for an all day event.
hgs
parents: 23
diff changeset
   367
	 \param referenceDate to indicate past or not.
hgs
parents: 23
diff changeset
   368
 */
hgs
parents: 23
diff changeset
   369
void CalenEditorReminderField::updateReminderChoicesForAllDay(QDate referenceDate)
hgs
parents: 23
diff changeset
   370
{
51
hgs
parents: 45
diff changeset
   371
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_UPDATEREMINDERCHOICESFORALLDAY_ENTRY );
45
hgs
parents: 23
diff changeset
   372
	if (!mReminderTimeAdded){
hgs
parents: 23
diff changeset
   373
		insertReminderTimeField();
hgs
parents: 23
diff changeset
   374
	}
hgs
parents: 23
diff changeset
   375
	QStringList reminderChoicesForAllDay;
hgs
parents: 23
diff changeset
   376
	QDate tomorrow = QDate::currentDate().addDays(1);
hgs
parents: 23
diff changeset
   377
	QDate theDayAfterTomorrow = QDate::currentDate().addDays(2);
hgs
parents: 23
diff changeset
   378
	
57
hgs
parents: 55
diff changeset
   379
	// Get the previous index to retain if the alarm is valid
hgs
parents: 55
diff changeset
   380
	QVariant countVariant = mReminderItem->contentWidgetData("currentIndex");
hgs
parents: 55
diff changeset
   381
	int previousIndex = countVariant.toInt();
hgs
parents: 55
diff changeset
   382
	AgendaAlarm previousAlarm = mCalenEditor->editedEntry()->alarm();
hgs
parents: 55
diff changeset
   383
	
hgs
parents: 55
diff changeset
   384
	// Update the reminder choices only if the alarm set is not valid
hgs
parents: 55
diff changeset
   385
	// Get the alarm offset to check for the validity
hgs
parents: 55
diff changeset
   386
	int offset = mCalenEditor->editedEntry()->alarm().timeOffset();
hgs
parents: 55
diff changeset
   387
	bool update =  true;
hgs
parents: 55
diff changeset
   388
	
hgs
parents: 55
diff changeset
   389
	// Calculate the alarm time
hgs
parents: 55
diff changeset
   390
	QDateTime refDateTime;
hgs
parents: 55
diff changeset
   391
	refDateTime.setDate(referenceDate);
hgs
parents: 55
diff changeset
   392
	refDateTime.setTime(mCalenEditor->editedEntry()->startTime().time());
hgs
parents: 55
diff changeset
   393
	QTime checkTime = refDateTime.time().addSecs(-(offset * 60));
hgs
parents: 55
diff changeset
   394
	refDateTime.setTime(checkTime);
hgs
parents: 55
diff changeset
   395
	// Check for valid alarm offset
hgs
parents: 55
diff changeset
   396
	if(offset >= 0) {
hgs
parents: 55
diff changeset
   397
		// If the alarm which was already set is valid, 
hgs
parents: 55
diff changeset
   398
		// then dont update the reminder choices
hgs
parents: 55
diff changeset
   399
		if ((refDateTime > QDateTime::currentDateTime()) || 
hgs
parents: 55
diff changeset
   400
				(refDateTime.date() == QDate::currentDate() && (
hgs
parents: 55
diff changeset
   401
						refDateTime.time() > QTime::currentTime()))) {
hgs
parents: 55
diff changeset
   402
			update = false;
hgs
parents: 55
diff changeset
   403
		}		
hgs
parents: 55
diff changeset
   404
	}
hgs
parents: 55
diff changeset
   405
	// If the event is on a past date the default alarm will be off.
45
hgs
parents: 23
diff changeset
   406
	if (referenceDate < QDate::currentDate() || 
hgs
parents: 23
diff changeset
   407
			referenceDate == QDate::currentDate()) {
hgs
parents: 23
diff changeset
   408
		// Set reminder off for past event.
hgs
parents: 23
diff changeset
   409
		reminderChoicesForAllDay << hbTrId("txt_calendar_setlabel_reminder_val_off");
hgs
parents: 23
diff changeset
   410
		mReminderItem->setContentWidgetData(QString("items"), 
hgs
parents: 23
diff changeset
   411
													reminderChoicesForAllDay);
57
hgs
parents: 55
diff changeset
   412
		mReminderItem->setEnabled(false);		
hgs
parents: 55
diff changeset
   413
		// Remove the reminder field if it was added
hgs
parents: 55
diff changeset
   414
		if(mReminderTimeAdded) {
hgs
parents: 55
diff changeset
   415
			removeReminderTimeField();
hgs
parents: 55
diff changeset
   416
		}
45
hgs
parents: 23
diff changeset
   417
	} else if (theDayAfterTomorrow < referenceDate || 
hgs
parents: 23
diff changeset
   418
			theDayAfterTomorrow == referenceDate) {
57
hgs
parents: 55
diff changeset
   419
		// If the event is on a future date which is two days after the current date
hgs
parents: 55
diff changeset
   420
		// The options are off, on event day, 1 day before and 2 days before
45
hgs
parents: 23
diff changeset
   421
		reminderChoicesForAllDay 
hgs
parents: 23
diff changeset
   422
				<< hbTrId("txt_calendar_setlabel_reminder_val_off")
hgs
parents: 23
diff changeset
   423
				<< hbTrId("txt_calendar_setlabel_reminder_val_on_event_day")
hgs
parents: 23
diff changeset
   424
				<< hbTrId("txt_calendar_setlabel_reminder_val_1_day_before")
hgs
parents: 23
diff changeset
   425
				<< hbTrId("txt_calendar_setlabel_reminder_val_2_days_before");
hgs
parents: 23
diff changeset
   426
		mReminderItem->setEnabled(true);
hgs
parents: 23
diff changeset
   427
		mCustomReminderTimeItem->setEnabled(true);
57
hgs
parents: 55
diff changeset
   428
		mReminderItem->setContentWidgetData(QString("items"), 
hgs
parents: 55
diff changeset
   429
													reminderChoicesForAllDay);
hgs
parents: 55
diff changeset
   430
	} else if (QTime::currentTime() < QTime(18, 0, 0, 0)) {
hgs
parents: 55
diff changeset
   431
		// If the event is on a future date which is one day after the current date
hgs
parents: 55
diff changeset
   432
		// and current time is before 6.00 pm.
hgs
parents: 55
diff changeset
   433
		// The options are off, on event day and 1 day before
45
hgs
parents: 23
diff changeset
   434
		reminderChoicesForAllDay 
57
hgs
parents: 55
diff changeset
   435
				<< hbTrId("txt_calendar_setlabel_reminder_val_off")
hgs
parents: 55
diff changeset
   436
				<< hbTrId("txt_calendar_setlabel_reminder_val_on_event_day")
hgs
parents: 55
diff changeset
   437
				<< hbTrId("txt_calendar_setlabel_reminder_val_1_day_before");
hgs
parents: 55
diff changeset
   438
		mReminderItem->setEnabled(true);
hgs
parents: 55
diff changeset
   439
		mCustomReminderTimeItem->setEnabled(true);
hgs
parents: 55
diff changeset
   440
		mReminderItem->setContentWidgetData(QString("items"), 
hgs
parents: 55
diff changeset
   441
		                                    reminderChoicesForAllDay);
hgs
parents: 55
diff changeset
   442
	}else {
hgs
parents: 55
diff changeset
   443
		// If the event is on a future date which is one day after the current date
hgs
parents: 55
diff changeset
   444
		// and current time is after 6.00 pm.
hgs
parents: 55
diff changeset
   445
		// The options are off and on event day
hgs
parents: 55
diff changeset
   446
		reminderChoicesForAllDay 
hgs
parents: 55
diff changeset
   447
				<< hbTrId("txt_calendar_setlabel_reminder_val_off")
hgs
parents: 55
diff changeset
   448
				<< hbTrId("txt_calendar_setlabel_reminder_val_on_event_day");
45
hgs
parents: 23
diff changeset
   449
		mReminderItem->setEnabled(true);
hgs
parents: 23
diff changeset
   450
		mCustomReminderTimeItem->setEnabled(true);
57
hgs
parents: 55
diff changeset
   451
		mReminderItem->setContentWidgetData(QString("items"), 
hgs
parents: 55
diff changeset
   452
		                                    reminderChoicesForAllDay);
45
hgs
parents: 23
diff changeset
   453
	}
57
hgs
parents: 55
diff changeset
   454
	// Set the proper index based on the validity of the previous index
hgs
parents: 55
diff changeset
   455
	int count = reminderItemsCount();
hgs
parents: 55
diff changeset
   456
	// By default, in case of reminder updation, its been agreed to set 
hgs
parents: 55
diff changeset
   457
	// ReminderOneDayBefore even though ReminderTwoDaysBefore holds good
hgs
parents: 55
diff changeset
   458
	// If the ReminderOneDayBefore option is available set it or 
hgs
parents: 55
diff changeset
   459
	// else set it to ReminderOff
hgs
parents: 55
diff changeset
   460
	if(count > ReminderOneDayBefore) {
hgs
parents: 55
diff changeset
   461
		// Don't make the reminder off since
hgs
parents: 55
diff changeset
   462
		// the valid reminder options are there in the combobox
hgs
parents: 55
diff changeset
   463
		// So check for ReminderOff is needed
hgs
parents: 55
diff changeset
   464
		if (update && 
hgs
parents: 55
diff changeset
   465
			(previousIndex == ReminderOff || previousIndex >= ReminderOneDayBefore)) {
hgs
parents: 55
diff changeset
   466
			// If the index has to be updated check the previous index value
hgs
parents: 55
diff changeset
   467
			// And set the default reminder as 1 day before.
hgs
parents: 55
diff changeset
   468
			mReminderItem->setContentWidgetData("currentIndex", 
hgs
parents: 55
diff changeset
   469
														ReminderOneDayBefore);
hgs
parents: 55
diff changeset
   470
		}else {
hgs
parents: 55
diff changeset
   471
			// Set the previous index since the alarm is valid
hgs
parents: 55
diff changeset
   472
			mReminderItem->setContentWidgetData("currentIndex", previousIndex);
hgs
parents: 55
diff changeset
   473
			// Set the previous alarm also as the value will be changed to default value
hgs
parents: 55
diff changeset
   474
			// when the current index is been changed
hgs
parents: 55
diff changeset
   475
			mCalenEditor->editedEntry()->setAlarm(previousAlarm);
hgs
parents: 55
diff changeset
   476
			// Get the alarm time from the offset
hgs
parents: 55
diff changeset
   477
			QTime alarmTime = refDateTime.time();
hgs
parents: 55
diff changeset
   478
			// Set the alarm time and display it on the button
hgs
parents: 55
diff changeset
   479
			mReminderTimeForAllDay.setHMS(
hgs
parents: 55
diff changeset
   480
					alarmTime.hour(),alarmTime.minute(),alarmTime.second());
hgs
parents: 55
diff changeset
   481
			setDisplayTime();
hgs
parents: 55
diff changeset
   482
		}
hgs
parents: 55
diff changeset
   483
	}else {
hgs
parents: 55
diff changeset
   484
		// Enters this condition if the previous index set is not valid or
hgs
parents: 55
diff changeset
   485
		// the index is ReminderOff
hgs
parents: 55
diff changeset
   486
		mReminderItem->setContentWidgetData("currentIndex", ReminderOff);
45
hgs
parents: 23
diff changeset
   487
	}
57
hgs
parents: 55
diff changeset
   488
	
51
hgs
parents: 45
diff changeset
   489
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_UPDATEREMINDERCHOICESFORALLDAY_EXIT );
45
hgs
parents: 23
diff changeset
   490
}
hgs
parents: 23
diff changeset
   491
hgs
parents: 23
diff changeset
   492
/*!
hgs
parents: 23
diff changeset
   493
	 Insert the reminder time field for an all day event.
hgs
parents: 23
diff changeset
   494
 */
hgs
parents: 23
diff changeset
   495
void CalenEditorReminderField::insertReminderTimeField()
hgs
parents: 23
diff changeset
   496
{
51
hgs
parents: 45
diff changeset
   497
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_INSERTREMINDERTIMEFIELD_ENTRY );
45
hgs
parents: 23
diff changeset
   498
	HbDataFormModelItem::DataItemType itemType =
hgs
parents: 23
diff changeset
   499
			static_cast<HbDataFormModelItem::DataItemType> (ReminderTimeOffset);
hgs
parents: 23
diff changeset
   500
	
hgs
parents: 23
diff changeset
   501
	// If all day item is not added then insert at one level before.
hgs
parents: 23
diff changeset
   502
	int index = CalenEditorPrivate::ReminderTimeForAllDayItem;
hgs
parents: 23
diff changeset
   503
	if(!mCalenEditor->isAllDayFieldAdded()) {
hgs
parents: 23
diff changeset
   504
		index = CalenEditorPrivate::ReminderTimeForAllDayItem - 1;
hgs
parents: 23
diff changeset
   505
	} 
hgs
parents: 23
diff changeset
   506
	mCustomReminderTimeItem = mCalenEditorModel->insertDataFormItem(
hgs
parents: 23
diff changeset
   507
							index,
hgs
parents: 23
diff changeset
   508
							itemType,
hgs
parents: 23
diff changeset
   509
							QString(hbTrId("txt_calendar_setlabel_reminder_time")),
hgs
parents: 23
diff changeset
   510
							mCalenEditorModel->invisibleRootItem());
hgs
parents: 23
diff changeset
   511
	if (currentReminderIndex() != 1){
hgs
parents: 23
diff changeset
   512
		mReminderTimeForAllDay.setHMS(18,0,0,0);
hgs
parents: 23
diff changeset
   513
	} else {
hgs
parents: 23
diff changeset
   514
		mReminderTimeForAllDay.setHMS(8,0,0,0);
hgs
parents: 23
diff changeset
   515
	}
hgs
parents: 23
diff changeset
   516
	
hgs
parents: 23
diff changeset
   517
	mEditorForm->addConnection(mCustomReminderTimeItem, SIGNAL(clicked()),
hgs
parents: 23
diff changeset
   518
	                           this, SLOT(launchReminderTimePicker()));
hgs
parents: 23
diff changeset
   519
	setDisplayTime();
hgs
parents: 23
diff changeset
   520
	mReminderTimeAdded = true;
51
hgs
parents: 45
diff changeset
   521
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_INSERTREMINDERTIMEFIELD_EXIT );
45
hgs
parents: 23
diff changeset
   522
}
hgs
parents: 23
diff changeset
   523
hgs
parents: 23
diff changeset
   524
/*!
hgs
parents: 23
diff changeset
   525
	 Set the reminder time selected by the user.
hgs
parents: 23
diff changeset
   526
 */
hgs
parents: 23
diff changeset
   527
void CalenEditorReminderField::setDisplayTime()
hgs
parents: 23
diff changeset
   528
{
51
hgs
parents: 45
diff changeset
   529
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_SETDISPLAYTIME_ENTRY );
45
hgs
parents: 23
diff changeset
   530
	HbExtendedLocale locale = HbExtendedLocale::system();
hgs
parents: 23
diff changeset
   531
	QString timeString = locale.format(
hgs
parents: 23
diff changeset
   532
			mReminderTimeForAllDay,
hgs
parents: 23
diff changeset
   533
			r_qtn_time_usual_with_zero);
hgs
parents: 23
diff changeset
   534
	mCustomReminderTimeItem->setContentWidgetData("text", timeString);
51
hgs
parents: 45
diff changeset
   535
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_SETDISPLAYTIME_EXIT );
45
hgs
parents: 23
diff changeset
   536
}
hgs
parents: 23
diff changeset
   537
hgs
parents: 23
diff changeset
   538
/*!
hgs
parents: 23
diff changeset
   539
	Remove the reminder time field if its not an all day event.
hgs
parents: 23
diff changeset
   540
 */
hgs
parents: 23
diff changeset
   541
void CalenEditorReminderField::removeReminderTimeField()
hgs
parents: 23
diff changeset
   542
{
51
hgs
parents: 45
diff changeset
   543
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_REMOVEREMINDERTIMEFIELD_ENTRY );
45
hgs
parents: 23
diff changeset
   544
	mReminderTimeAdded = false;
63
hgs
parents: 57
diff changeset
   545
	mEditorForm->removeConnection(mCustomReminderTimeItem, SIGNAL(clicked()),
hgs
parents: 57
diff changeset
   546
		                           this, SLOT(launchReminderTimePicker()));
45
hgs
parents: 23
diff changeset
   547
	if (mCustomReminderTimeItem) {
hgs
parents: 23
diff changeset
   548
		QModelIndex reminderIndex =
hgs
parents: 23
diff changeset
   549
				mCalenEditorModel->indexFromItem(mCustomReminderTimeItem);
hgs
parents: 23
diff changeset
   550
		mCalenEditorModel->removeItem(
hgs
parents: 23
diff changeset
   551
				mCalenEditorModel->index(
hgs
parents: 23
diff changeset
   552
						reminderIndex.row(), 0));
55
hgs
parents: 51
diff changeset
   553
		mCustomReminderTimeItem = 0;
45
hgs
parents: 23
diff changeset
   554
	}
51
hgs
parents: 45
diff changeset
   555
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_REMOVEREMINDERTIMEFIELD_EXIT );
45
hgs
parents: 23
diff changeset
   556
}
hgs
parents: 23
diff changeset
   557
hgs
parents: 23
diff changeset
   558
/*!
hgs
parents: 23
diff changeset
   559
	 Launches time picker to select time.
hgs
parents: 23
diff changeset
   560
 */
hgs
parents: 23
diff changeset
   561
void CalenEditorReminderField::launchReminderTimePicker()
hgs
parents: 23
diff changeset
   562
{
51
hgs
parents: 45
diff changeset
   563
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_LAUNCHREMINDERTIMEPICKER_ENTRY );
57
hgs
parents: 55
diff changeset
   564
	
45
hgs
parents: 23
diff changeset
   565
	HbDialog *popUp = new HbDialog();
hgs
parents: 23
diff changeset
   566
	popUp->setDismissPolicy(HbDialog::NoDismiss);
hgs
parents: 23
diff changeset
   567
	popUp->setTimeout(HbDialog::NoTimeout);
57
hgs
parents: 55
diff changeset
   568
	popUp->setAttribute( Qt::WA_DeleteOnClose, true );
45
hgs
parents: 23
diff changeset
   569
	popUp->setHeadingWidget( new HbLabel(
57
hgs
parents: 55
diff changeset
   570
				hbTrId("Reminder Time")));
hgs
parents: 55
diff changeset
   571
	
hgs
parents: 55
diff changeset
   572
	HbExtendedLocale locale = HbExtendedLocale::system();
hgs
parents: 55
diff changeset
   573
	mTimePicker = new HbDateTimePicker(mReminderTimeForAllDay);
hgs
parents: 55
diff changeset
   574
	if(locale.timeStyle() == HbExtendedLocale::Time12) {
hgs
parents: 55
diff changeset
   575
		mTimePicker->setDisplayFormat("hh:mm ap");	
hgs
parents: 55
diff changeset
   576
	}else {
hgs
parents: 55
diff changeset
   577
		mTimePicker->setDisplayFormat("hh:mm");
hgs
parents: 55
diff changeset
   578
	}
hgs
parents: 55
diff changeset
   579
	mTimePicker->setTime(mReminderTimeForAllDay);
hgs
parents: 55
diff changeset
   580
	popUp->setContentWidget(mTimePicker);
hgs
parents: 55
diff changeset
   581
	
hgs
parents: 55
diff changeset
   582
	HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok"), popUp);
45
hgs
parents: 23
diff changeset
   583
	popUp->addAction(okAction);
hgs
parents: 23
diff changeset
   584
	connect(okAction, SIGNAL(triggered()), this, SLOT(setReminderTimeForAllDay()));
hgs
parents: 23
diff changeset
   585
	popUp->addAction(new HbAction(hbTrId("txt_common_button_cancel"),
hgs
parents: 23
diff changeset
   586
	                                      popUp));
hgs
parents: 23
diff changeset
   587
	popUp->open();
51
hgs
parents: 45
diff changeset
   588
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_LAUNCHREMINDERTIMEPICKER_EXIT );
45
hgs
parents: 23
diff changeset
   589
}
hgs
parents: 23
diff changeset
   590
hgs
parents: 23
diff changeset
   591
/*!
hgs
parents: 23
diff changeset
   592
	 Set the reminder time chosen.
hgs
parents: 23
diff changeset
   593
 */
hgs
parents: 23
diff changeset
   594
void CalenEditorReminderField::setReminderTimeForAllDay()
hgs
parents: 23
diff changeset
   595
{
51
hgs
parents: 45
diff changeset
   596
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_SETREMINDERTIMEFORALLDAY_ENTRY );
45
hgs
parents: 23
diff changeset
   597
	mReminderTimeForAllDay = mTimePicker->time();
hgs
parents: 23
diff changeset
   598
	if (mReminderTimeForAllDay.isValid()) {
hgs
parents: 23
diff changeset
   599
		// Change the time displayed to that selected by the user.
hgs
parents: 23
diff changeset
   600
		setDisplayTime();
hgs
parents: 23
diff changeset
   601
		handleReminderIndexChanged(currentReminderIndex());
hgs
parents: 23
diff changeset
   602
	}	
51
hgs
parents: 45
diff changeset
   603
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_SETREMINDERTIMEFORALLDAY_EXIT );
45
hgs
parents: 23
diff changeset
   604
}
hgs
parents: 23
diff changeset
   605
hgs
parents: 23
diff changeset
   606
/*!
hgs
parents: 23
diff changeset
   607
	 Checks if reminder field is enabled or not.
hgs
parents: 23
diff changeset
   608
 */
hgs
parents: 23
diff changeset
   609
bool CalenEditorReminderField::isReminderFieldEnabled()
hgs
parents: 23
diff changeset
   610
{
51
hgs
parents: 45
diff changeset
   611
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_ISREMINDERFIELDENABLED_ENTRY );
45
hgs
parents: 23
diff changeset
   612
	return mReminderItem->isEnabled();
hgs
parents: 23
diff changeset
   613
}
hgs
parents: 23
diff changeset
   614
hgs
parents: 23
diff changeset
   615
/*!
hgs
parents: 23
diff changeset
   616
	 Returns the number of items present in the reminder option.
hgs
parents: 23
diff changeset
   617
 */
hgs
parents: 23
diff changeset
   618
int CalenEditorReminderField::reminderItemsCount()
hgs
parents: 23
diff changeset
   619
{
51
hgs
parents: 45
diff changeset
   620
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_REMINDERITEMSCOUNT_ENTRY );
45
hgs
parents: 23
diff changeset
   621
	QVariant strings = mReminderItem->contentWidgetData("items");
hgs
parents: 23
diff changeset
   622
	QStringList stringList(strings.toStringList());
hgs
parents: 23
diff changeset
   623
	int count = stringList.count();
51
hgs
parents: 45
diff changeset
   624
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_REMINDERITEMSCOUNT_EXIT );
45
hgs
parents: 23
diff changeset
   625
	return count;
hgs
parents: 23
diff changeset
   626
}
hgs
parents: 23
diff changeset
   627
hgs
parents: 23
diff changeset
   628
/*!
hgs
parents: 23
diff changeset
   629
	 Returns the current chosen index.
hgs
parents: 23
diff changeset
   630
 */
hgs
parents: 23
diff changeset
   631
int CalenEditorReminderField::currentReminderIndex()
hgs
parents: 23
diff changeset
   632
{
51
hgs
parents: 45
diff changeset
   633
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_CURRENTREMINDERINDEX_ENTRY );
45
hgs
parents: 23
diff changeset
   634
	QVariant countVariant = mReminderItem->contentWidgetData("currentIndex");
hgs
parents: 23
diff changeset
   635
	int index = countVariant.toInt();
51
hgs
parents: 45
diff changeset
   636
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_CURRENTREMINDERINDEX_EXIT );
45
hgs
parents: 23
diff changeset
   637
	return index;
hgs
parents: 23
diff changeset
   638
}
hgs
parents: 23
diff changeset
   639
hgs
parents: 23
diff changeset
   640
/*!
hgs
parents: 23
diff changeset
   641
	 Sets the chosen index as current index.
hgs
parents: 23
diff changeset
   642
	 /param index indicates the idex value to be set.
hgs
parents: 23
diff changeset
   643
 */
hgs
parents: 23
diff changeset
   644
void CalenEditorReminderField::setCurrentIndex(int index)
hgs
parents: 23
diff changeset
   645
{
51
hgs
parents: 45
diff changeset
   646
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_SETCURRENTINDEX_ENTRY );
45
hgs
parents: 23
diff changeset
   647
	mReminderItem->setContentWidgetData("currentIndex", index);
51
hgs
parents: 45
diff changeset
   648
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_SETCURRENTINDEX_EXIT );
45
hgs
parents: 23
diff changeset
   649
}
hgs
parents: 23
diff changeset
   650
hgs
parents: 23
diff changeset
   651
/*!
hgs
parents: 23
diff changeset
   652
	 Disables the reminder time field.
hgs
parents: 23
diff changeset
   653
 */
hgs
parents: 23
diff changeset
   654
void CalenEditorReminderField::disableReminderTimeField()
hgs
parents: 23
diff changeset
   655
{
51
hgs
parents: 45
diff changeset
   656
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_DISABLEREMINDERTIMEFIELD_ENTRY );
45
hgs
parents: 23
diff changeset
   657
	if (mReminderTimeAdded) {
hgs
parents: 23
diff changeset
   658
		mCustomReminderTimeItem->setEnabled(false);
hgs
parents: 23
diff changeset
   659
	}
51
hgs
parents: 45
diff changeset
   660
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_DISABLEREMINDERTIMEFIELD_EXIT );
45
hgs
parents: 23
diff changeset
   661
}
hgs
parents: 23
diff changeset
   662
hgs
parents: 23
diff changeset
   663
/*!
hgs
parents: 23
diff changeset
   664
	 Checks if reminder time field is added or not.
hgs
parents: 23
diff changeset
   665
 */
hgs
parents: 23
diff changeset
   666
bool CalenEditorReminderField::isReminderTimeForAllDayAdded()
hgs
parents: 23
diff changeset
   667
{
51
hgs
parents: 45
diff changeset
   668
	OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_ISREMINDERTIMEFORALLDAYADDED_ENTRY );
hgs
parents: 45
diff changeset
   669
	OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_ISREMINDERTIMEFORALLDAYADDED_EXIT );
45
hgs
parents: 23
diff changeset
   670
	return mReminderTimeAdded;
hgs
parents: 23
diff changeset
   671
}
hgs
parents: 23
diff changeset
   672
23
fd30d51f876b Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   673
// End of file	--Don't remove this.