calendarengines/caldav/src/caldavclient.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 client API for Caldav server
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 "caldavclient.h"
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    19
#include "caldavserver.h"
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    20
#include "caldavutils.h"
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    21
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    22
const TUint KDefaultMessageSlots = 4;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    23
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    24
// testing ************
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    25
#include <e32base.h>
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    26
#include <e32cons.h>
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    27
#include <e32cmn.h>
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    30
 * RCalDavServer::RCalDavServer
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    31
 * default constructor
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
EXPORT_C RCalDavServer::RCalDavServer()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    34
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    35
	}
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    38
 * RCalDavServer::Connect
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    39
 * connect to server
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    40
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    41
EXPORT_C TInt RCalDavServer::Connect()
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
	TInt retry = 2;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    44
	for (;;)
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
		TInt r = CreateSession(KCalDavServerName, Version(),
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    47
				KDefaultMessageSlots);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    48
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    49
		if ((KErrNotFound != r) && (KErrServerTerminated != r))
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    50
			return (r);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    51
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    52
		if (--retry == 0)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    53
			return (r);
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
		r = StartServer();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    56
		if ((KErrNone != r) && (KErrAlreadyExists != r))
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    57
			return (r);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    58
		}
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
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
 * RCalDavServer::Enable
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    63
 * enable Caldav sync
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
EXPORT_C TInt RCalDavServer::Enable(const TDesC &aCalendar)
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
	TIpcArgs args(&aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    68
	return SendReceive(ECalDavEnable, args);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    69
	}
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    72
 * RCalDavServer::Disable
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    73
 * disable Caldav sync
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
EXPORT_C TInt RCalDavServer::Disable(const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    76
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    77
	TIpcArgs args(&aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    78
	return SendReceive(ECalDavDisable, args);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    79
	}
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
 * RCalDavServer::EnabledSync
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    83
 * check for enabled sync
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    84
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    85
EXPORT_C TInt RCalDavServer::EnabledSync(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    86
		TBool &aEnabled)
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
	TPckg<TBool> enabled(aEnabled);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    89
	TIpcArgs args(&aCalendar, &enabled);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    90
	return (SendReceive(ECalDavEnabled, args));
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    94
 * RCalDavServer::Sync
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    95
 * sync now a specific calendar
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    96
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    97
EXPORT_C TInt RCalDavServer::Sync(const TDesC &aCalendar)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    98
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
    99
	TIpcArgs args(&aCalendar);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   100
	return SendReceive(ECalDavSync, args);
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   103
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   104
 * RCalDavServer::SyncAll
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   105
 * sync now all calendars
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
EXPORT_C TInt RCalDavServer::SyncAll()
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
	return SendReceive(ECalDavSyncAll);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   110
	}
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   113
 * RCalDavServer::Url
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   114
 * get caldav sync url
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   115
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   116
EXPORT_C TInt RCalDavServer::Url(const TDesC &aCalendar, TDes8 &aUrl)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   117
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   118
	TIpcArgs args(&aCalendar, &aUrl);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   119
	return SendReceive(ECalDavUrl, args);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   120
	}
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   123
 * RCalDavServer::SetUrl
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   124
 * set url
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
EXPORT_C TInt RCalDavServer::SetUrl(const TDesC &aCalendar, const TDesC8 &aUrl)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   127
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   128
	TIpcArgs args(&aCalendar, &aUrl);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   129
	return SendReceive(ECalDavSetUrl, args);
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   132
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   133
 * RCalDavServer::Username
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   134
 * get username
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
EXPORT_C TInt RCalDavServer::Username(const TDesC &aCalendar, TDes8 &aUsername)
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
	TIpcArgs args(&aCalendar, &aUsername);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   139
	return SendReceive(ECalDavUsername, args);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   140
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   141
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
 * RCalDavServer::SetUsername
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   144
 * set username
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
EXPORT_C TInt RCalDavServer::SetUsername(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   147
		const TDesC8 &aUsername)
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
	TIpcArgs args(&aCalendar, &aUsername);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   150
	return SendReceive(ECalDavSetUsername, args);
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
 * RCalDavServer::Password
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   155
 * get password
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
EXPORT_C TInt RCalDavServer::Password(const TDesC &aCalendar, TDes8 &aPassword)
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
	TIpcArgs args(&aCalendar, &aPassword);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   160
	return SendReceive(ECalDavPassword, args);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   161
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   162
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
 * RCalDavServer::SetPassword
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   165
 * set password
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
EXPORT_C TInt RCalDavServer::SetPassword(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   168
		const TDesC8 &aPassword)
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
	TIpcArgs args(&aCalendar, &aPassword);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   171
	return SendReceive(ECalDavSetPassword, args);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   172
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   173
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   174
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   175
 * RCalDavServer::SyncInterval
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   176
 * get SyncInterval
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
EXPORT_C TInt RCalDavServer::SyncInterval(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   179
		TTimeIntervalMinutes& aSyncInterval)
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
	TPckg<TTimeIntervalMinutes> syncinterval(aSyncInterval);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   182
	TIpcArgs args(&aCalendar, &syncinterval);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   183
	return (SendReceive(ECalDavSyncInterval, args));
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   187
 * RCalDavServer::SetSyncInterval
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   188
 * set SyncInterval
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   189
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   190
EXPORT_C TInt RCalDavServer::SetSyncInterval(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   191
		TTimeIntervalMinutes aSyncInterval)
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
	TPckg<TTimeIntervalMinutes> syncinterval(aSyncInterval);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   194
	TIpcArgs args(&aCalendar, &syncinterval);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   195
	return (SendReceive(ECalDavSetSyncInterval, args));
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   196
	}
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
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   199
 * RCalDavServer::PastDays
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   200
 * get past days
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   201
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   202
EXPORT_C TInt RCalDavServer::PastDays(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   203
		TTimeIntervalDays &aDays)
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
	TPckg<TTimeIntervalDays> pastdays(aDays);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   206
	TIpcArgs args(&aCalendar, &pastdays);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   207
	return (SendReceive(ECalDavPastDays, args));
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
 * RCalDavServer::SetPastDays
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   212
 * set past days
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   213
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   214
EXPORT_C TInt RCalDavServer::SetPastDays(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   215
		TTimeIntervalDays aDays)
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
	TPckg<TTimeIntervalDays> pastdays(aDays);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   218
	TIpcArgs args(&aCalendar, &pastdays);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   219
	return (SendReceive(ECalDavSetPastDays, args));
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
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
 * RCalDavServer::ImmediateSync
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   224
 * get Immediate Sync
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   225
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   226
EXPORT_C TInt RCalDavServer::ImmediateSync(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   227
		TBool &aImmediateSyc)
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
	TPckg<TBool> syncimmediate(aImmediateSyc);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   230
	TIpcArgs args(&aCalendar, &syncimmediate);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   231
	return (SendReceive(ECalDavImmediateSync, args));
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   234
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   235
 * RCalDavServer::SetImmediateSync
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   236
 * set immediate Sync
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
EXPORT_C TInt RCalDavServer::SetImmediateSync(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   239
		TBool aImmediateSyc)
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
	TPckg<TBool> syncimmediate(aImmediateSyc);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   242
	TIpcArgs args(&aCalendar, &syncimmediate);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   243
	return SendReceive(ECalDavSetImmediateSync, args);
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   246
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   247
 * RCalDavServer::KeepServerEntry
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   248
 * get KeepServerEntry
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
EXPORT_C TInt RCalDavServer::KeepServerEntry(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   251
		TBool &aKeepServerEntry)
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
	TPckg<TBool> keepserverentry(aKeepServerEntry);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   254
	TIpcArgs args(&aCalendar, &keepserverentry);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   255
	return SendReceive(ECalDavKeepServer, args);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   256
	}
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   257
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
 * RCalDavServer::SetKeepServerEntry
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   260
 * set KeepServerEntry
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
EXPORT_C TInt RCalDavServer::SetKeepServerEntry(const TDesC &aCalendar,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   263
		TBool aKeepServerEntry)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   264
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   265
	TPckg<TBool> keepserverentry(aKeepServerEntry);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   266
	TIpcArgs args(&aCalendar, &keepserverentry);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   267
	return SendReceive(ECalDavSetKeepServer, args);
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
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
 * RCalDavServer::Version
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   272
 * get version
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   273
 */
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   274
TVersion RCalDavServer::Version(void) const
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
	return (TVersion(KCalDavServerMajorVersionNumber,
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   277
			KCalDavServerMinorVersionNumber, KCalDavServerBuildVersionNumber));
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   280
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   281
 * RCalDavServer::UnsupportedRequest()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   282
 *  A server request to stop the server.
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   283
 *  This is a request that is NOT implemented by the server; it is here to show
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   284
 *  the handling of non-implemented requests.
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
TInt RCalDavServer::UnsupportedRequest()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   287
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   288
	return SendReceive(ECalDavUnsupportedRequest);
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
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   291
/**
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   292
 * RCalDavServer::BadRequest()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   293
 * A request that the server knows nothing about.
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
void RCalDavServer::BadRequest()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   296
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   297
	SendReceive(9999);
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
static TInt StartServer()
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   301
	{
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   302
	RProcess server;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   303
	TInt r = server.Create(KCalDavServerFilename, KNullDesC);
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   304
	if (r != KErrNone)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   305
		return r;
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
	TRequestStatus stat;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   308
	server.Rendezvous(stat);
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
	if (stat != KRequestPending)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   311
		server.Kill(0); // abort startup
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   312
	else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   313
		server.Resume(); // logon OK - start the server
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
	User::WaitForRequest(stat); // wait for start or death
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
	// Check the exit type.
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   318
	// We can't use the 'exit reason' because if the server panicked this
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   319
	// is set to the panic 'reason' (which may be '0' and cannot thus be distinguished
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   320
	// from KErrNone)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   321
	r = server.ExitType();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   322
	if (EExitPanic == r)
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   323
		r = KErrGeneral;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   324
	else
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   325
		r = stat.Int();
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   326
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   327
	server.Close(); // This is no longer needed
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   328
	return r;
5a04f2ceabfe Merge in fix for Bug 1908
Maximilian Odendahl <maxodendahl@gmail.com>
parents: 1
diff changeset
   329
	}