epoc32/include/app/calsession.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/calsession.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,106 @@
     1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __CALSESSION_H__
    1.20 +#define __CALSESSION_H__
    1.21 +
    1.22 +#include <badesca.h>
    1.23 +
    1.24 +#include <calchangecallback.h>
    1.25 +#include <calnotification.h>
    1.26 +
    1.27 +class CCalSessionImpl;
    1.28 +class MCalChangeCallBack2;
    1.29 +
    1.30 +/** A handle to the calendar file.
    1.31 +
    1.32 +When the client instantiates a CCalSession, it will connect to the calendar server. 
    1.33 +In turn, the client can use its APIs, for instance to create or open a calendar file.
    1.34 +
    1.35 +The agenda data in the file can be accessed as entries. To access the entries, clients should
    1.36 +use class CCalEntryView or CCalInstanceView to process the entry data. However, both view classes 
    1.37 +require the handle to the file which is represented by this class.
    1.38 +
    1.39 +A calendar file can be opened on any writable drive. Note that if the file is opened 
    1.40 +on a removable media and that media is removed, operations will leave with KErrNotReady.
    1.41 +This error can also happen when trying to access file attachments on removed media.
    1.42 +When this error occurs, the user should close the CCalSession and re-open it once the media 
    1.43 +has been replaced. 
    1.44 +It is recommended that when using a calendar file on removable media, the user should watch for when 
    1.45 +the media is removed / replaced using the RFs::NotifyChange API.
    1.46 +
    1.47 +The session object must not be destroyed until all the objects which where created by referencing it 
    1.48 +have been destroyed.
    1.49 +
    1.50 +@publishedAll
    1.51 +@released
    1.52 +*/
    1.53 +NONSHARABLE_CLASS(CCalSession) : public CBase
    1.54 +    {
    1.55 +public:
    1.56 +	IMPORT_C static CCalSession* NewL();
    1.57 +	IMPORT_C ~CCalSession();
    1.58 +
    1.59 +	IMPORT_C void CreateCalFileL(const TDesC&  aFileName) const;
    1.60 +	IMPORT_C void OpenL(const TDesC& aFileName) const;
    1.61 +	IMPORT_C void OpenL(const TDesC& aFileName, CalCommon::TCalFileVersionSupport& aFileSupportStatus) const;
    1.62 +	IMPORT_C const TDesC& DefaultFileNameL() const; 
    1.63 +	IMPORT_C void DeleteCalFileL(const TDesC& aFileName) const;
    1.64 +	IMPORT_C CDesCArray* ListCalFilesL() const;
    1.65 +
    1.66 +	IMPORT_C void StartChangeNotification(MCalChangeCallBack2& aCallBack, const CCalChangeNotificationFilter& aFilter);
    1.67 +	IMPORT_C void StopChangeNotification();
    1.68 +	IMPORT_C void DisableChangeBroadcast();
    1.69 +	IMPORT_C void EnableChangeBroadcast();
    1.70 +	
    1.71 +	IMPORT_C void EnablePubSubNotificationsL();
    1.72 +	IMPORT_C void DisablePubSubNotificationsL();
    1.73 +	
    1.74 +	IMPORT_C void FileIdL(TCalFileId& aCalFileId) const;
    1.75 +	IMPORT_C void GetFileNameL(TCalPubSubData aPubSubData, TDes& aFileName) const;
    1.76 +	IMPORT_C TBool IsFileNameL(TCalPubSubData aPubSubData, const TDesC& aFileName) const;
    1.77 +	IMPORT_C TBool IsOpenedFileL(TCalPubSubData aPubSubData) const;
    1.78 +
    1.79 +	// debug only
    1.80 +/**
    1.81 +@publishedPartner
    1.82 +@released
    1.83 +*/
    1.84 +	IMPORT_C void _DebugSetHeapFailL(RAllocator::TAllocFail aFail, TInt aRate);
    1.85 +
    1.86 +/**
    1.87 +@publishedPartner
    1.88 +@released
    1.89 +*/
    1.90 +	IMPORT_C TInt _DebugRequestAllocatedCellsL();
    1.91 +
    1.92 +	// deprecated
    1.93 +	IMPORT_C void StartChangeNotification(MCalChangeCallBack* aCallBack, MCalChangeCallBack::TChangeEntryType aChangeEntryType,	TBool aIncludeUndatedTodos,	TTime aFilterStartTime,	TTime aFilterEndTime);
    1.94 +	
    1.95 +	IMPORT_C void __dbgClearTzClientCacheL(TBool aRestartCaching);
    1.96 +
    1.97 +	IMPORT_C TInt _DebugRequestAllocatedHeapSizeL();
    1.98 +	
    1.99 +public:
   1.100 +	CCalSessionImpl& Impl() const;
   1.101 +	  
   1.102 +private:
   1.103 +	CCalSession();
   1.104 +	void ConstructL();
   1.105 +private:
   1.106 +	CCalSessionImpl* iImpl;
   1.107 +	};
   1.108 +	
   1.109 +#endif // __CALSESSION_H__