calendarui/caldav/src/caldavsettingitems.cpp
author Maximilian Odendahl <maxodendahl@gmail.com>
Fri, 26 Feb 2010 17:47:09 +0000
branchRCL_3
changeset 6 5a04f2ceabfe
parent 1 4927282092b4
permissions -rw-r--r--
Merge in fix for Bug 1908
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
     1
/*
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
     2
* Copyright (c) 2010 Sun Microsystems, Inc. and/or its subsidiary(-ies).
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
     3
* All rights reserved.
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
     4
* This component and the accompanying materials are made available
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
     6
* which accompanies this distribution, and is available
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
     8
*
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
     9
* Initial Contributor:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    10
* Maximilian Odendahl
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    11
*
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    12
* Contributors:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    13
* 
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    14
* Description: Caldav setting items
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    15
*
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    16
*/
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    17
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    18
#include "caldavsettingitems.h"
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    19
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    20
#include <StringLoader.h>
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    21
#include <aknnotewrappers.h>
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    22
#include <cmapplicationsettingsui.h>
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    23
#include <CommDbConnPref.h>
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    24
#include <UTF.H>
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    25
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    26
#include <caldavsession.h>
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    27
#include "calencaldavplugin.h"
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    28
#include <calencaldavplugindata.rsg>
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    29
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    30
#define KMAXSETTINGLENGTH	500
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    31
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    32
#define KTIMETWOWEEKS 	14
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    33
#define KTIMETHREEMONTH	30*3
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    34
#define KTIMESIXMONTH	30*6
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    35
#define KTIMEALL		1000
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    36
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    37
#define KTIMEALWAYSON		0
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    38
#define	KTIMEONEMINUTE		1
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    39
#define	KTIMEFIVEMINUTES	5
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    40
#define	KTIMEFIFTEENMINUTES	15
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    41
#define KTIMETHIRTYMINUTES	30
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    42
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    43
/**
1
4927282092b4 Bug 208: inital CalDAV support for Symbian
Maximilian Odendahl <maximilian.odendahl@sun.com>
parents:
diff changeset
    44
 * show a global info note
6
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    45
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    46
void ShowNoteL(TInt aResource)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    47
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    48
	HBufC* text = StringLoader::LoadLC(aResource);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    49
	CAknConfirmationNote* note = new (ELeave) CAknConfirmationNote();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    50
	note->ExecuteLD(*text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    51
	CleanupStack::PopAndDestroy(text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    52
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    53
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    54
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    55
 * CCalDavTextSettingItem::CCalDavTextSettingItem 
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    56
 * default constructor
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    57
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    58
CCalDavTextSettingItem::CCalDavTextSettingItem(TInt aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    59
		CCalDavSession* aSession) :
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    60
	CAknTextSettingItem(aId, iInternalValue), iSession(aSession)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    61
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    62
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    63
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    64
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    65
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    66
 * CCalDavTextSettingItem::~CCalDavTextSettingItem 
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    67
 * destructor
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    68
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    69
CCalDavTextSettingItem::~CCalDavTextSettingItem()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    70
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    71
	delete iCalendar;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    72
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    73
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    74
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    75
 * CCalDavTextSettingItem::NewLC 
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    76
 * 1st-phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    77
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    78
CCalDavTextSettingItem* CCalDavTextSettingItem::NewLC(TInt aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    79
		CCalDavSession* aSession, const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    80
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    81
	CCalDavTextSettingItem* self = new (ELeave) CCalDavTextSettingItem(aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    82
			aSession);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    83
	CleanupStack::PushL(self);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    84
	self->ConstructL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    85
	return self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    86
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    87
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    88
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    89
 * CCalDavTextSettingItem::NewL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    90
 *  1st-phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    91
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    92
CCalDavTextSettingItem* CCalDavTextSettingItem::NewL(TInt aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    93
		CCalDavSession* aSession, const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    94
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    95
	CCalDavTextSettingItem* self = CCalDavTextSettingItem::NewLC(aId, aSession,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    96
			aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    97
	CleanupStack::Pop(); // self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    98
	return self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    99
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   100
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   101
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   102
 * CCalDavTextSettingItem::ConstructL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   103
 * 2nd-phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   104
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   105
void CCalDavTextSettingItem::ConstructL(const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   106
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   107
	iCalendar = aCalendar.AllocL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   108
	HBufC* title = NULL;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   109
	TInt page = 0;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   110
	switch (Identifier())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   111
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   112
		case ECalDavSettingUrl:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   113
			title = StringLoader::LoadLC(R_CALDAV_URL);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   114
			page = R_URL_SETTING_PAGE;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   115
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   116
		case ECalDavSettingUser:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   117
			title = StringLoader::LoadLC(R_CALDAV_USERNAME);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   118
			page = R_USERNAME_SETTING_PAGE;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   119
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   120
		case ECalDavSettingPassword:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   121
			title = StringLoader::LoadLC(R_CALDAV_PASSWORD);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   122
			page = R_PASSWORD_SETTING_PAGE;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   123
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   124
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   125
	SetEmptyItemTextL(KNullDesC);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   126
	CAknTextSettingItem::ConstructL(EFalse, 0, *title, NULL,page, -1);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   127
	CleanupStack::PopAndDestroy(title);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   128
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   129
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   130
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   131
 * CCalDavTextSettingItem::EditItemL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   132
 * Edits the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   133
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   134
void CCalDavTextSettingItem::EditItemL(TBool aCalledFromMenu)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   135
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   136
	TBool enabled;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   137
	iSession->EnabledSync(*iCalendar, enabled);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   138
	if (enabled)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   139
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   140
		HBufC* text = StringLoader::LoadLC(R_CALDAV_QUERY_DISCONNECT);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   141
		CAknQueryDialog* dlg = CAknQueryDialog::NewL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   142
		if (dlg->ExecuteLD(R_QUERY, *text))
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   143
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   144
			CAknTextSettingItem::EditItemL(aCalledFromMenu);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   145
			// TODO: disable Enabled-Setting-Item	
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   146
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   147
		CleanupStack::PopAndDestroy(text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   148
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   149
	else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   150
		CAknTextSettingItem::EditItemL(aCalledFromMenu);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   151
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   152
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   153
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   154
 * CCalDavTextSettingItem::StoreL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   155
 * Stores the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   156
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   157
void CCalDavTextSettingItem::StoreL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   158
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   159
	CAknTextSettingItem::StoreL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   160
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   161
	HBufC8* text = CnvUtfConverter::ConvertFromUnicodeToUtf8L(iInternalValue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   162
	CleanupStack::PushL(text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   163
	
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   164
	switch (Identifier())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   165
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   166
		case ECalDavSettingUrl:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   167
			iSession->SetUrl(*iCalendar, *text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   168
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   169
		case ECalDavSettingUser:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   170
			iSession->SetUsername(*iCalendar, *text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   171
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   172
		case ECalDavSettingPassword:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   173
			iSession->SetPassword(*iCalendar, *text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   174
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   175
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   176
	CleanupStack::PopAndDestroy(text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   177
	
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   178
	if (iEnableSettingItem)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   179
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   180
		iEnableSettingItem->LoadL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   181
		iEnableSettingItem->UpdateListBoxTextL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   182
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   183
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   184
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   185
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   186
 * CCalDavTextSettingItem::LoadL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   187
 * loades the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   188
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   189
void CCalDavTextSettingItem::LoadL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   190
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   191
	HBufC8* buf = HBufC8::NewL(KMAXSETTINGLENGTH);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   192
	TPtr8 ptr(buf->Des());
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   193
	switch (Identifier())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   194
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   195
		case ECalDavSettingUrl:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   196
			iSession->Url(*iCalendar, ptr);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   197
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   198
		case ECalDavSettingUser:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   199
			iSession->Username(*iCalendar, ptr);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   200
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   201
		case ECalDavSettingPassword:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   202
			iSession->Password(*iCalendar, ptr);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   203
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   204
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   205
	CnvUtfConverter::ConvertToUnicodeFromUtf8(iInternalValue, ptr);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   206
	delete buf;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   207
	CAknTextSettingItem::LoadL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   208
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   209
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   210
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   211
 * CCalDavTextSettingItem::StoreL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   212
 * Save a pointer to the Enable Item, this is used to set current
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   213
 * enable/disable state
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   214
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   215
void CCalDavTextSettingItem::SetEnableSettingItem(CAknSettingItem* aItem)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   216
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   217
	iEnableSettingItem = aItem;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   218
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   219
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   220
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   221
 * CCalDavPasswordSettingItem::CCalDavPasswordSettingItem
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   222
 * default constructor
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   223
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   224
CCalDavPasswordSettingItem::CCalDavPasswordSettingItem(TInt aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   225
		CCalDavSession* aSession) :
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   226
	CAknPasswordSettingItem(aId, CAknPasswordSettingItem::EAlpha,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   227
			iInternalValue), iSession(aSession)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   228
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   229
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   230
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   231
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   232
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   233
 * CCalDavPasswordSettingItem::~CCalDavPasswordSettingItem
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   234
 * default destructor
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   235
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   236
CCalDavPasswordSettingItem::~CCalDavPasswordSettingItem()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   237
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   238
	delete iCalendar;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   239
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   240
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   241
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   242
 * CCalDavPasswordSettingItem::NewLC
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   243
 * first phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   244
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   245
CCalDavPasswordSettingItem* CCalDavPasswordSettingItem::NewLC(TInt aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   246
		CCalDavSession* aSession, const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   247
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   248
	CCalDavPasswordSettingItem* self = new (ELeave) CCalDavPasswordSettingItem(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   249
			aId, aSession);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   250
	CleanupStack::PushL(self);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   251
	self->ConstructL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   252
	return self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   253
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   254
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   255
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   256
 * CCalDavPasswordSettingItem::NewL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   257
 * first phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   258
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   259
CCalDavPasswordSettingItem* CCalDavPasswordSettingItem::NewL(TInt aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   260
		CCalDavSession* aSession, const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   261
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   262
	CCalDavPasswordSettingItem* self = CCalDavPasswordSettingItem::NewLC(aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   263
			aSession, aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   264
	CleanupStack::Pop(); // self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   265
	return self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   266
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   267
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   268
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   269
 * CCalDavPasswordSettingItem::SetEnableSettingItem
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   270
 * Save a pointer to the Enable Item, this is used to set current
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   271
 * enable/disable state
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   272
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   273
void CCalDavPasswordSettingItem::SetEnableSettingItem(CAknSettingItem* aItem)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   274
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   275
	iEnableSettingItem = aItem;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   276
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   277
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   278
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   279
 * CCalDavPasswordSettingItem::ConstructL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   280
 * second phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   281
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   282
void CCalDavPasswordSettingItem::ConstructL(const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   283
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   284
	iCalendar = aCalendar.AllocL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   285
	HBufC* title = NULL;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   286
	TInt page = 0;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   287
	switch (Identifier())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   288
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   289
		case ECalDavSettingPassword:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   290
			title = StringLoader::LoadLC(R_CALDAV_PASSWORD);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   291
			page = R_PASSWORD_SETTING_PAGE;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   292
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   293
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   294
	SetEmptyItemTextL(KNullDesC);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   295
	CAknPasswordSettingItem::ConstructL(EFalse, 0, *title, NULL,page, -1);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   296
	CleanupStack::PopAndDestroy(title);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   297
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   298
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   299
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   300
 * CCalDavPasswordSettingItem::EditItemL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   301
 * edits the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   302
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   303
void CCalDavPasswordSettingItem::EditItemL(TBool aCalledFromMenu)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   304
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   305
	TBool enabled;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   306
	iSession->EnabledSync(*iCalendar, enabled);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   307
	if (enabled)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   308
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   309
		HBufC* text = StringLoader::LoadLC(R_CALDAV_QUERY_DISCONNECT);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   310
		CAknQueryDialog* dlg = CAknQueryDialog::NewL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   311
		if (dlg->ExecuteLD(R_QUERY, *text))
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   312
			CAknPasswordSettingItem::EditItemL(aCalledFromMenu);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   313
		CleanupStack::PopAndDestroy(text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   314
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   315
	else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   316
		CAknPasswordSettingItem::EditItemL(aCalledFromMenu);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   317
	CAknSettingItem::UpdateListBoxTextL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   318
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   319
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   320
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   321
 * CCalDavPasswordSettingItem::StoreL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   322
 * stores the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   323
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   324
void CCalDavPasswordSettingItem::StoreL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   325
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   326
	CAknPasswordSettingItem::StoreL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   327
	
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   328
	HBufC8* text = CnvUtfConverter::ConvertFromUnicodeToUtf8L(iInternalValue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   329
	CleanupStack::PushL(text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   330
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   331
	switch (Identifier())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   332
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   333
		case ECalDavSettingPassword:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   334
			iSession->SetPassword(*iCalendar, *text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   335
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   336
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   337
	CleanupStack::PopAndDestroy(text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   338
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   339
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   340
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   341
 * CCalDavPasswordSettingItem::LoadL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   342
 * loads the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   343
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   344
void CCalDavPasswordSettingItem::LoadL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   345
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   346
	HBufC8* buf = HBufC8::NewL(KMAXSETTINGLENGTH);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   347
	TPtr8 ptr(buf->Des());
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   348
	switch (Identifier())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   349
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   350
		case ECalDavSettingPassword:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   351
			iSession->Password(*iCalendar, ptr);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   352
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   353
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   354
	CnvUtfConverter::ConvertToUnicodeFromUtf8(iInternalValue, ptr);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   355
	delete buf;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   356
	CAknPasswordSettingItem::LoadL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   357
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   358
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   359
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   360
 * CCalDavBooleanSettingItem::CCalDavBooleanSettingItem
1
4927282092b4 Bug 208: inital CalDAV support for Symbian
Maximilian Odendahl <maximilian.odendahl@sun.com>
parents:
diff changeset
   361
 * default constructor
6
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   362
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   363
CCalDavBooleanSettingItem::CCalDavBooleanSettingItem(TInt aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   364
		CCalDavSession* aSession) :
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   365
	CAknBinaryPopupSettingItem(aId, iInternalValue), iSession(aSession)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   366
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   367
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   368
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   369
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   370
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   371
 * CCalDavBooleanSettingItem::~CCalDavBooleanSettingItem
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   372
 * default destructor
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   373
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   374
CCalDavBooleanSettingItem::~CCalDavBooleanSettingItem()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   375
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   376
	delete iCalendar;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   377
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   378
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   379
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   380
 * CCalDavBooleanSettingItem::NewLC
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   381
 * first phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   382
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   383
CCalDavBooleanSettingItem* CCalDavBooleanSettingItem::NewLC(TInt aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   384
		CCalDavSession* aSession, const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   385
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   386
	CCalDavBooleanSettingItem* self = new (ELeave) CCalDavBooleanSettingItem(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   387
			aId, aSession);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   388
	CleanupStack::PushL(self);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   389
	self->ConstructL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   390
	return self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   391
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   392
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   393
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   394
 * CCalDavBooleanSettingItem::NewLC
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   395
 * first phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   396
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   397
CCalDavBooleanSettingItem* CCalDavBooleanSettingItem::NewL(TInt aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   398
		CCalDavSession* aSession, const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   399
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   400
	CCalDavBooleanSettingItem* self = CCalDavBooleanSettingItem::NewLC(aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   401
			aSession, aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   402
	CleanupStack::Pop(); // self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   403
	return self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   404
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   405
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   406
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   407
 * CCalDavBooleanSettingItem::ConstructL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   408
 * second phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   409
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   410
void CCalDavBooleanSettingItem::ConstructL(const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   411
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   412
	iCalendar = aCalendar.AllocL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   413
	HBufC* title = NULL;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   414
	TInt text = 0;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   415
	TInt page = R_CALDAV_BINARY_PAGE;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   416
	switch (Identifier())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   417
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   418
		case ECalDavSettingKeepServer:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   419
			title = StringLoader::LoadLC(R_CALDAV_CONFLICTACTION);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   420
			text = R_CALDAV_CONFLICTACTION_TEXTS;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   421
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   422
		case ECalDavSettingSyncImmediate:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   423
			title = StringLoader::LoadLC(R_CALDAV_IMMEDIATESYNC);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   424
			text = R_CALDAV_IMMEDIATESYNC_TEXTS;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   425
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   426
		case ECalDavSettingEnable:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   427
			title = StringLoader::LoadLC(R_CALDAV_ENABLE);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   428
			text = R_CALDAV_ENABLE_TEXTS;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   429
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   430
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   431
	SetEmptyItemTextL(KNullDesC);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   432
	CAknBinaryPopupSettingItem::ConstructL(EFalse, 0, *title, NULL,page,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   433
			EAknCtPopupSettingList, NULL, text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   434
	CleanupStack::PopAndDestroy(title);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   435
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   436
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   437
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   438
 * CCalDavBooleanSettingItem::EditItemL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   439
 * edits the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   440
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   441
void CCalDavBooleanSettingItem::EditItemL(TBool aCalledFromMenu)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   442
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   443
	if (Identifier() == ECalDavSettingEnable)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   444
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   445
		TBool enabled_old;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   446
		iSession->EnabledSync(*iCalendar, enabled_old);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   447
		if (enabled_old)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   448
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   449
			HBufC* text = StringLoader::LoadLC(R_CALDAV_QUERY_DISCONNECT);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   450
			CAknQueryDialog* dlg = CAknQueryDialog::NewL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   451
			if (dlg->ExecuteLD(R_QUERY, *text))
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   452
				{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   453
				iSession->Disable(*iCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   454
				CAknBinaryPopupSettingItem::EditItemL(aCalledFromMenu);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   455
				}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   456
			CleanupStack::PopAndDestroy(text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   457
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   458
		else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   459
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   460
			iSession->Enable(*iCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   461
			// TODO: progressbar
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   462
			TBool enabled_new;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   463
			iSession->EnabledSync(*iCalendar, enabled_new);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   464
			if (!enabled_new)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   465
				{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   466
				ShowNoteL(R_CALDAV_QUERY_FAIL);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   467
				}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   468
			else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   469
				{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   470
				ShowNoteL(R_CALDAV_QUERY_SUCCESS);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   471
				CAknBinaryPopupSettingItem::EditItemL(aCalledFromMenu);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   472
				}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   473
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   474
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   475
	else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   476
		CAknBinaryPopupSettingItem::EditItemL(aCalledFromMenu);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   477
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   478
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   479
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   480
 * CCalDavBooleanSettingItem::StoreL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   481
 * stores the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   482
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   483
void CCalDavBooleanSettingItem::StoreL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   484
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   485
	CAknBinaryPopupSettingItem::StoreL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   486
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   487
	switch (Identifier())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   488
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   489
		case ECalDavSettingKeepServer:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   490
			iSession->SetKeepServerEntry(*iCalendar, iInternalValue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   491
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   492
		case ECalDavSettingSyncImmediate:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   493
			iSession->SetImmediateSync(*iCalendar, iInternalValue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   494
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   495
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   496
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   497
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   498
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   499
 * CCalDavBooleanSettingItem::LoadL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   500
 * loads the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   501
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   502
void CCalDavBooleanSettingItem::LoadL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   503
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   504
	switch (Identifier())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   505
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   506
		case ECalDavSettingKeepServer:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   507
			iSession->KeepServerEntry(*iCalendar, iInternalValue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   508
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   509
		case ECalDavSettingSyncImmediate:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   510
			iSession->ImmediateSync(*iCalendar, iInternalValue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   511
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   512
		case ECalDavSettingEnable:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   513
			iSession->EnabledSync(*iCalendar, iInternalValue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   514
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   515
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   516
	CAknBinaryPopupSettingItem::LoadL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   517
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   518
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   519
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   520
 * CCalDavEnumeratedTextSettingItem::CCalDavEnumeratedTextSettingItem
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   521
 * default constructor
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   522
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   523
CCalDavEnumeratedTextSettingItem::CCalDavEnumeratedTextSettingItem(TInt aId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   524
		CCalDavSession* aSession) :
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   525
	CAknEnumeratedTextPopupSettingItem(aId, iInternalValue), iSession(aSession)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   526
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   527
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   528
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   529
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   530
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   531
 * CCalDavEnumeratedTextSettingItem::~CCalDavEnumeratedTextSettingItem
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   532
 * default destructor
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   533
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   534
CCalDavEnumeratedTextSettingItem::~CCalDavEnumeratedTextSettingItem()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   535
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   536
	delete iCalendar;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   537
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   538
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   539
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   540
 * CCalDavEnumeratedTextSettingItem::NewLC
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   541
 * first phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   542
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   543
CCalDavEnumeratedTextSettingItem* CCalDavEnumeratedTextSettingItem::NewLC(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   544
		TInt aId, CCalDavSession* aSession, const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   545
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   546
	CCalDavEnumeratedTextSettingItem* self =
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   547
			new (ELeave) CCalDavEnumeratedTextSettingItem(aId, aSession);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   548
	CleanupStack::PushL(self);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   549
	self->ConstructL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   550
	return self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   551
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   552
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   553
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   554
 * CCalDavEnumeratedTextSettingItem::NewL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   555
 * first phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   556
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   557
CCalDavEnumeratedTextSettingItem* CCalDavEnumeratedTextSettingItem::NewL(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   558
		TInt aId, CCalDavSession* aSession, const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   559
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   560
	CCalDavEnumeratedTextSettingItem* self =
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   561
			CCalDavEnumeratedTextSettingItem::NewLC(aId, aSession, aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   562
	CleanupStack::Pop(); // self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   563
	return self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   564
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   565
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   566
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   567
 * CCalDavEnumeratedTextSettingItem::ConstructL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   568
 * second phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   569
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   570
void CCalDavEnumeratedTextSettingItem::ConstructL(const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   571
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   572
	iCalendar = aCalendar.AllocL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   573
	HBufC* title = NULL;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   574
	TInt text = 0;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   575
	TInt page = R_CALDAV_BINARY_PAGE;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   576
	switch (Identifier())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   577
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   578
		case ECalDavSettingSyncRange:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   579
			title = StringLoader::LoadLC(R_CALDAV_RANGE);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   580
			text = R_CALDAV_RANGE_TEXTS;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   581
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   582
		case ECalDavSettingSyncInterval:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   583
			title = StringLoader::LoadLC(R_CALDAV_TIME);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   584
			text = R_CALDAV_TIME_TEXTS;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   585
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   586
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   587
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   588
	SetEmptyItemTextL(KNullDesC);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   589
	CAknEnumeratedTextSettingItem::ConstructL(EFalse, 0, *title, NULL,page,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   590
			EAknCtPopupSettingList, NULL, text);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   591
	CleanupStack::PopAndDestroy(title);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   592
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   593
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   594
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   595
 * CCalDavEnumeratedTextSettingItem::EditItemL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   596
 * edits the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   597
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   598
void CCalDavEnumeratedTextSettingItem::EditItemL(TBool aCalledFromMenu)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   599
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   600
	CAknEnumeratedTextPopupSettingItem::EditItemL(aCalledFromMenu);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   601
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   602
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   603
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   604
 * CCalDavEnumeratedTextSettingItem::StoreL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   605
 * stores the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   606
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   607
void CCalDavEnumeratedTextSettingItem::StoreL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   608
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   609
	CAknEnumeratedTextPopupSettingItem::StoreL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   610
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   611
	switch (iInternalValue)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   612
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   613
		case 0:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   614
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   615
			if (Identifier() == ECalDavSettingSyncRange)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   616
				iSession->SetPastDays(*iCalendar, TTimeIntervalDays(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   617
						KTIMETWOWEEKS));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   618
			else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   619
				iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   620
						KTIMEALWAYSON));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   621
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   622
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   623
		case 1:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   624
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   625
			if (Identifier() == ECalDavSettingSyncRange)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   626
				iSession->SetPastDays(*iCalendar, TTimeIntervalDays(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   627
						KTIMETHREEMONTH));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   628
			else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   629
				iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   630
						KTIMEONEMINUTE));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   631
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   632
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   633
		case 2:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   634
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   635
			if (Identifier() == ECalDavSettingSyncRange)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   636
				iSession->SetPastDays(*iCalendar, TTimeIntervalDays(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   637
						KTIMESIXMONTH));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   638
			else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   639
				iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   640
						KTIMEFIVEMINUTES));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   641
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   642
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   643
		case 3:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   644
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   645
			if (Identifier() == ECalDavSettingSyncRange)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   646
				iSession->SetPastDays(*iCalendar, TTimeIntervalDays(KTIMEALL));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   647
			else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   648
				iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   649
						KTIMEFIFTEENMINUTES));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   650
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   651
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   652
		case 4:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   653
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   654
			if (Identifier() == ECalDavSettingSyncInterval)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   655
				iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   656
						KTIMETHIRTYMINUTES));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   657
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   658
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   659
		default:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   660
			if (Identifier() == ECalDavSettingSyncRange)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   661
				iSession->SetPastDays(*iCalendar, TTimeIntervalDays(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   662
						KTIMETWOWEEKS));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   663
			else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   664
				iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   665
						KTIMEALWAYSON));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   666
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   667
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   668
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   669
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   670
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   671
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   672
 * CCalDavEnumeratedTextSettingItem::LoadL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   673
 * loads the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   674
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   675
void CCalDavEnumeratedTextSettingItem::LoadL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   676
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   677
	switch (Identifier())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   678
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   679
		case ECalDavSettingSyncRange:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   680
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   681
			TTimeIntervalDays days;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   682
			iSession->PastDays(*iCalendar, days);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   683
			switch (days.Int())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   684
				{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   685
				case KTIMETWOWEEKS:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   686
					{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   687
					iInternalValue = 0;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   688
					break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   689
					}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   690
				case KTIMETHREEMONTH:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   691
					{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   692
					iInternalValue = 1;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   693
					break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   694
					}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   695
				case KTIMESIXMONTH:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   696
					{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   697
					iInternalValue = 2;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   698
					break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   699
					}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   700
				case KTIMEALL:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   701
					{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   702
					iInternalValue = 3;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   703
					break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   704
					}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   705
				default:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   706
					iInternalValue = 0;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   707
					break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   708
				}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   709
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   710
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   711
		case ECalDavSettingSyncInterval:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   712
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   713
			TTimeIntervalMinutes minutes;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   714
			iSession->SyncInterval(*iCalendar, minutes);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   715
			switch (minutes.Int())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   716
				{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   717
				case KTIMEALWAYSON:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   718
					{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   719
					iInternalValue = 0;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   720
					break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   721
					}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   722
				case KTIMEONEMINUTE:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   723
					{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   724
					iInternalValue = 1;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   725
					break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   726
					}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   727
				case KTIMEFIVEMINUTES:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   728
					{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   729
					iInternalValue = 2;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   730
					break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   731
					}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   732
				case KTIMEFIFTEENMINUTES:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   733
					{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   734
					iInternalValue = 3;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   735
					break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   736
					}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   737
				case KTIMETHIRTYMINUTES:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   738
					{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   739
					iInternalValue = 4;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   740
					break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   741
					}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   742
				default:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   743
					iInternalValue = 0;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   744
					break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   745
				}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   746
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   747
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   748
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   749
	CAknEnumeratedTextPopupSettingItem::LoadL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   750
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   751
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   752
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   753
 * CCalDavAccessPointSettingItem::NewL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   754
 * first phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   755
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   756
CCalDavAccessPointSettingItem* CCalDavAccessPointSettingItem::NewL(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   757
		TInt aSettingId, CCalDavSession* aSession, const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   758
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   759
	CCalDavAccessPointSettingItem * item =
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   760
			new (ELeave) CCalDavAccessPointSettingItem(aSettingId, aSession);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   761
	CleanupStack::PushL(item);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   762
	item->ConstructL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   763
	CleanupStack::Pop(item);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   764
	return item;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   765
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   766
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   767
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   768
 * CCalDavAccessPointSettingItem::CCalDavAccessPointSettingItem
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   769
 * default constructor
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   770
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   771
CCalDavAccessPointSettingItem::CCalDavAccessPointSettingItem(TInt aSettingId,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   772
		CCalDavSession* aSession) :
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   773
	CAknSettingItem(aSettingId), iSession(aSession)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   774
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   775
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   776
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   777
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   778
 * CCalDavAccessPointSettingItem::~CCalDavAccessPointSettingItem
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   779
 * default destructor
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   780
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   781
CCalDavAccessPointSettingItem::~CCalDavAccessPointSettingItem()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   782
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   783
	delete iSettingText;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   784
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   785
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   786
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   787
 * CCalDavAccessPointSettingItem::ConstructL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   788
 * second phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   789
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   790
void CCalDavAccessPointSettingItem::ConstructL(const TDesC &/*aCalendar*/)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   791
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   792
	SetEmptyItemTextL(KNullDesC);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   793
	HBufC* title = StringLoader::LoadLC(R_CALDAV_ACCESS_POINT);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   794
	CAknSettingItem::ConstructL(EFalse, 0, *title, NULL,0, 0);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   795
	CleanupStack::PopAndDestroy(title);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   796
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   797
	_LIT(hi,"Default Connection");
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   798
	iSettingText = hi().Alloc();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   799
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   800
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   801
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   802
 * CCalDavAccessPointSettingItem::EditItemL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   803
 * edits the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   804
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   805
void CCalDavAccessPointSettingItem::EditItemL(TBool /*aCalledFromMenu*/)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   806
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   807
	delete iSettingText;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   808
	iSettingText = NULL;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   809
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   810
	TCmSettingSelection userSelection;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   811
	userSelection.iId = 0;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   812
	userSelection.iResult = CMManager::EDefaultConnection;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   813
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   814
	CCmApplicationSettingsUi* settings = CCmApplicationSettingsUi::NewL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   815
	CleanupStack::PushL(settings);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   816
	TUint listedItems = CMManager::EShowDefaultConnection
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   817
			| CMManager::EShowDestinations | CMManager::EShowConnectionMethods;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   818
	TBearerFilterArray filter;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   819
	settings->RunApplicationSettingsL(userSelection, listedItems, filter);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   820
	CleanupStack::PopAndDestroy(settings);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   821
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   822
	switch (userSelection.iResult)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   823
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   824
		case CMManager::EDestination:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   825
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   826
			TConnSnapPref prefs;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   827
			prefs.SetSnap(userSelection.iId);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   828
			// iSettingText =
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   829
			// iConnection.Start( prefs, iStatus );
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   830
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   831
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   832
		case CMManager::EConnectionMethod:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   833
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   834
			TCommDbConnPref prefs;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   835
			prefs.SetIapId(userSelection.iId);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   836
			prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   837
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   838
			// iConnection.Start( prefs, iStatus );
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   839
			// iSettingText =
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   840
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   841
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   842
		case CMManager::EDefaultConnection:
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   843
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   844
			// iConnection.Start( iStatus );
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   845
			// iSettingText = 
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   846
			break;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   847
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   848
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   849
	UpdateListBoxTextL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   850
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   851
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   852
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   853
 * CCalDavAccessPointSettingItem::SettingTextL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   854
 * returns the setting text
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   855
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   856
const TDesC& CCalDavAccessPointSettingItem::SettingTextL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   857
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   858
	if (!iSettingText)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   859
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   860
		return CAknSettingItem::SettingTextL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   861
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   862
	else if (iSettingText->Length() == 0)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   863
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   864
		return CAknSettingItem::SettingTextL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   865
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   866
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   867
	return *iSettingText;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   868
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   869
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   870
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   871
 * CCalDavAccessPointSettingItem::StoreL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   872
 * stores the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   873
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   874
void CCalDavAccessPointSettingItem::StoreL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   875
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   876
	CAknSettingItem::StoreL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   877
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   878
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   879
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   880
 * CCalDavAccessPointSettingItem::LoadL
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   881
 * loads the item
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   882
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   883
void CCalDavAccessPointSettingItem::LoadL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   884
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   885
	//CAknSettingItem::Load();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   886
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   887
//  End of File