calendarengines/caldav/src/caldavenginemgr.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: provides a manager to keep track of all available engines
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 "caldavenginemgr.h"
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    19
#include "caldavengine.h"
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    20
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    21
#include <calsession.h>
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    22
#include <calcalendarinfo.h>
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    23
#include "calenglobaldata.h"
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    24
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
 * CCalDavEngineMgr::CCalDavEngineMgr()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    27
 * default constructor
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    28
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    29
CCalDavEngineMgr::CCalDavEngineMgr()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    30
	{
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    33
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    34
 * CCalDavEngineMgr::~CCalDavEngineMgr()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    35
 * default destructor
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
CCalDavEngineMgr::~CCalDavEngineMgr()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    38
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    39
	for (TInt i = iEngines.Count() - 1; i >= 0; --i)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    40
		delete iEngines[i];
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    41
	iEngines.Close();
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    44
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    45
 * CCalDavEngineMgr::NewLC()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    46
 * first phase construction
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
CCalDavEngineMgr* CCalDavEngineMgr::NewLC()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    49
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    50
	CCalDavEngineMgr* self = new (ELeave) CCalDavEngineMgr();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    51
	CleanupStack::PushL(self);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    52
	self->ConstructL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    53
	return self;
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    56
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    57
 * CCalDavEngineMgr::NewL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    58
 * first phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    59
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    60
CCalDavEngineMgr* CCalDavEngineMgr::NewL()
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
	CCalDavEngineMgr* self = CCalDavEngineMgr::NewLC();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    63
	CleanupStack::Pop(); // self;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    64
	return self;
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    67
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    68
 * CCalDavEngineMgr::Progress()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    69
 * progress callback
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
void CCalDavEngineMgr::Progress(TInt /*aPercentageCompleted*/)
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    76
 * CCalDavEngineMgr::Completed()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    77
 * completed callback
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    78
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    79
void CCalDavEngineMgr::Completed(TInt /*aError*/)
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
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    82
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    83
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    84
 * CCalDavEngineMgr::NotifyProgress()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    85
 * NotifyProgress callback
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
TBool CCalDavEngineMgr::NotifyProgress()
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
	return EFalse;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    90
	}
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    93
 * CCalDavEngineMgr::ConstructL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    94
 * second phase construction
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    95
 * check all calendar files, for each one which has caldav sync enabled, 
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    96
 * create a CCalDavengine and enable sync
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    97
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    98
void CCalDavEngineMgr::ConstructL()
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
	RPointerArray<CCalCalendarInfo> calendarInfoList;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   101
	CCalenGlobalData* data = CCalenGlobalData::NewL(*this);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   102
	data->InitializeGlobalDataL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   103
	CleanupStack::PushL(data);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   104
	data->GetAllCalendarInfoL(calendarInfoList);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   105
	CleanupClosePushL(calendarInfoList);
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
	for (TInt i = 0; i < calendarInfoList.Count(); i++)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   108
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   109
		CDesC8Array* propertyKeys = calendarInfoList[i]->PropertyKeysL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   110
		CleanupStack::PushL(propertyKeys);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   111
		TInt pos = 0;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   112
		if (propertyKeys->Find(KCaldavEnabled, pos, ECmpNormal) == KErrNone)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   113
			{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   114
			CCalDavEngine* engine = CCalDavEngine::NewL(
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   115
					calendarInfoList[i]->FileNameL());
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   116
			iEngines.Append(engine);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   117
			if (engine->EnabledSync())
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   118
				engine->EnableL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   119
			}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   120
		CleanupStack::PopAndDestroy(propertyKeys);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   121
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   122
	CleanupStack::PopAndDestroy(&calendarInfoList);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   123
	CleanupStack::PopAndDestroy(data);
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   126
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   127
 * CCalDavEngineMgr::FindEngineL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   128
 * find engines inside engine array, create if neccessary
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
TInt CCalDavEngineMgr::FindEngineL(const TDesC &aName, TBool aCreate)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   131
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   132
	CCalSession* session = CCalSession::NewL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   133
	TRAPD(error,session->OpenL(aName));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   134
	delete session;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   135
	if (error != KErrNone)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   136
		return KErrNotFound;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   137
		
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   138
	for (TInt i = 0; i <= iEngines.Count() - 1; i++)
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
		if (iEngines[i]->CalendarName() == aName)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   141
			return i;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   142
		}
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
	if (aCreate)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   145
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   146
		iEngines.Append(CCalDavEngine::NewL(aName));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   147
		return iEngines.Count() - 1;
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
		return KErrNotFound;
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
 * CCalDavEngineMgr::SyncL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   155
 * sync specific calendar
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
TInt CCalDavEngineMgr::SyncL(const TDesC &aCalendar)
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
	TInt pos = FindEngineL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   160
	if (pos != KErrNotFound)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   161
		return iEngines[pos]->SyncL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   162
	else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   163
		return KErrNotFound;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   164
	}
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   167
 * CCalDavEngineMgr::SyncAllL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   168
 * sync all calendars
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   169
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   170
TInt CCalDavEngineMgr::SyncAllL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   171
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   172
	// sync all caldav enabled calendars
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   173
	for (TInt i = 0; i <= iEngines.Count() - 1; i++)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   174
		iEngines[i]->SyncL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   175
	return KErrNone;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   176
	}
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   179
 * CCalDavEngineMgr::DisableL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   180
 * 
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   181
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   182
TInt CCalDavEngineMgr::DisableL(const TDesC &aCalendar)
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
	TInt pos = FindEngineL(aCalendar);
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
	if (pos != KErrNotFound)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   187
		iEngines[pos]->DisableL();
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
	return pos == KErrNotFound ? KErrNotFound : KErrNone;
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   192
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   193
 * CCalDavEngineMgr::EnableL()
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
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   196
TInt CCalDavEngineMgr::EnableL(const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   197
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   198
	TInt pos = FindEngineL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   199
	if (pos != KErrNotFound)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   200
		{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   201
		return iEngines[pos]->EnableL();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   202
		}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   203
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   204
	return KErrArgument;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   205
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   206
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   207
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   208
 * CCalDavEngineMgr::UrlL()
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
TPtrC8 CCalDavEngineMgr::UrlL(const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   212
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   213
	TInt pos = FindEngineL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   214
	return (pos != KErrNotFound) ? iEngines[pos]->Url() : KNullDesC8();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   215
	}
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   218
 * CCalDavEngineMgr::SetUrlL()
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
void CCalDavEngineMgr::SetUrlL(const TDesC &aCalendar, const TDesC8 &aUrl)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   222
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   223
	TInt pos = FindEngineL(aCalendar, ETrue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   224
	if (pos != KErrNotFound)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   225
		iEngines[pos]->SetUrlL(aUrl);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   226
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   227
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
 * CCalDavEngineMgr::UsernameL()
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
TPtrC8 CCalDavEngineMgr::UsernameL(const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   233
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   234
	TInt pos = FindEngineL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   235
	return (pos != KErrNotFound) ? iEngines[pos]->User() : KNullDesC8();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   236
	}
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   239
 * CCalDavEngineMgr::SetUsernameL()
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
void CCalDavEngineMgr::SetUsernameL(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   243
		const TDesC8 &aUsername)
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
	TInt pos = FindEngineL(aCalendar, ETrue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   246
	if (pos != KErrNotFound)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   247
		iEngines[pos]->SetUserL(aUsername);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   248
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   249
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   250
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   251
 * CCalDavEngineMgr::PasswordL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   252
 * 
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
TPtrC8 CCalDavEngineMgr::PasswordL(const TDesC &aCalendar)
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
	TInt pos = FindEngineL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   257
	return (pos != KErrNotFound) ? iEngines[pos]->Password() : KNullDesC8();
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   260
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   261
 * CCalDavEngineMgr::SetPasswordL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   262
 * 
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   263
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   264
void CCalDavEngineMgr::SetPasswordL(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   265
		const TDesC8 &aPassword)
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
	TInt pos = FindEngineL(aCalendar, ETrue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   268
	if (pos != KErrNotFound)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   269
		iEngines[pos]->SetPasswordL(aPassword);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   270
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   271
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
 * CCalDavEngineMgr::SyncIntervalL()
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
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   276
TTimeIntervalMinutes CCalDavEngineMgr::SyncIntervalL(const TDesC &aCalendar)
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
	TInt pos = FindEngineL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   279
	return (pos != KErrNotFound) ? iEngines[pos]->SyncInterval()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   280
			: TTimeIntervalMinutes(DEFAULT_SYNC_MINUTES);
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
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
 * CCalDavEngineMgr::SetSyncIntervalL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   285
 * 
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   286
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   287
void CCalDavEngineMgr::SetSyncIntervalL(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   288
		TTimeIntervalMinutes aSyncInterval)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   289
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   290
	TInt pos = FindEngineL(aCalendar, ETrue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   291
	if (pos != KErrNotFound)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   292
		iEngines[pos]->SetSyncIntervalL(aSyncInterval);
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   295
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   296
 * CCalDavEngineMgr::PastDaysL()
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
TTimeIntervalDays CCalDavEngineMgr::PastDaysL(const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   300
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   301
	TInt pos = FindEngineL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   302
	return (pos != KErrNotFound) ? iEngines[pos]->PastDays()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   303
			: TTimeIntervalDays(DEFAULT_PAST_DAYS);
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   306
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   307
 * CCalDavEngineMgr::SetPastDaysL()
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
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   310
void CCalDavEngineMgr::SetPastDaysL(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   311
		TTimeIntervalDays aDays)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   312
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   313
	TInt pos = FindEngineL(aCalendar, ETrue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   314
	if (pos != KErrNotFound)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   315
		iEngines[pos]->SetPastDaysL(aDays);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   316
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   317
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
 * CCalDavEngineMgr::ImmediateSyncL()
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
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   322
TBool CCalDavEngineMgr::ImmediateSyncL(const TDesC &aCalendar)
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
	TInt pos = FindEngineL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   325
	return pos != KErrNotFound ? iEngines[pos]->ImmediateSync()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   326
			: DEFAULT_IMMEDIATE_SYNC;
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   329
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   330
 * CCalDavEngineMgr::SetImmediateSyncL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   331
 * 
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
void CCalDavEngineMgr::SetImmediateSyncL(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   334
		TBool aImmediateSyc)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   335
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   336
	TInt pos = FindEngineL(aCalendar, ETrue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   337
	if (pos != KErrNotFound)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   338
		iEngines[pos]->SetImmediateSyncL(aImmediateSyc);
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   342
 * CCalDavEngineMgr::KeepServerEntryL()
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
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   345
TBool CCalDavEngineMgr::KeepServerEntryL(const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   346
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   347
	TInt pos = FindEngineL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   348
	return pos != KErrNotFound ? iEngines[pos]->KeepServerEntry()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   349
			: DEFAULT_KEEP_SERVER_ENTRY;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   350
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   351
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   352
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   353
 * CCalDavEngineMgr::SetKeepServerEntryL()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   354
 * 
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   355
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   356
void CCalDavEngineMgr::SetKeepServerEntryL(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   357
		TBool aKeepServerEntry)
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
	TInt pos = FindEngineL(aCalendar, ETrue);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   360
	if (pos != KErrNotFound)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   361
		iEngines[pos]->SetKeepServerEntryL(aKeepServerEntry);
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   364
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   365
 * CCalDavEngineMgr::EnabledSyncL()
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
TBool CCalDavEngineMgr::EnabledSyncL(const TDesC &aCalendar)
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
	TInt pos = FindEngineL(aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   371
	return (pos != KErrNotFound) ? iEngines[pos]->EnabledSync() : EFalse;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   372
	}