epoc32/include/app/calsession.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/calsession.h@2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // 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
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __CALSESSION_H__
    17 #define __CALSESSION_H__
    18 
    19 #include <badesca.h>
    20 
    21 #include <calchangecallback.h>
    22 #include <calnotification.h>
    23 
    24 class CCalSessionImpl;
    25 class MCalChangeCallBack2;
    26 
    27 /** A handle to the calendar file.
    28 
    29 When the client instantiates a CCalSession, it will connect to the calendar server. 
    30 In turn, the client can use its APIs, for instance to create or open a calendar file.
    31 
    32 The agenda data in the file can be accessed as entries. To access the entries, clients should
    33 use class CCalEntryView or CCalInstanceView to process the entry data. However, both view classes 
    34 require the handle to the file which is represented by this class.
    35 
    36 A calendar file can be opened on any writable drive. Note that if the file is opened 
    37 on a removable media and that media is removed, operations will leave with KErrNotReady.
    38 This error can also happen when trying to access file attachments on removed media.
    39 When this error occurs, the user should close the CCalSession and re-open it once the media 
    40 has been replaced. 
    41 It is recommended that when using a calendar file on removable media, the user should watch for when 
    42 the media is removed / replaced using the RFs::NotifyChange API.
    43 
    44 The session object must not be destroyed until all the objects which where created by referencing it 
    45 have been destroyed.
    46 
    47 @publishedAll
    48 @released
    49 */
    50 NONSHARABLE_CLASS(CCalSession) : public CBase
    51     {
    52 public:
    53 	IMPORT_C static CCalSession* NewL();
    54 	IMPORT_C ~CCalSession();
    55 
    56 	IMPORT_C void CreateCalFileL(const TDesC&  aFileName) const;
    57 	IMPORT_C void OpenL(const TDesC& aFileName) const;
    58 	IMPORT_C void OpenL(const TDesC& aFileName, CalCommon::TCalFileVersionSupport& aFileSupportStatus) const;
    59 	IMPORT_C const TDesC& DefaultFileNameL() const; 
    60 	IMPORT_C void DeleteCalFileL(const TDesC& aFileName) const;
    61 	IMPORT_C CDesCArray* ListCalFilesL() const;
    62 
    63 	IMPORT_C void StartChangeNotification(MCalChangeCallBack2& aCallBack, const CCalChangeNotificationFilter& aFilter);
    64 	IMPORT_C void StopChangeNotification();
    65 	IMPORT_C void DisableChangeBroadcast();
    66 	IMPORT_C void EnableChangeBroadcast();
    67 	
    68 	IMPORT_C void EnablePubSubNotificationsL();
    69 	IMPORT_C void DisablePubSubNotificationsL();
    70 	
    71 	IMPORT_C void FileIdL(TCalFileId& aCalFileId) const;
    72 	IMPORT_C void GetFileNameL(TCalPubSubData aPubSubData, TDes& aFileName) const;
    73 	IMPORT_C TBool IsFileNameL(TCalPubSubData aPubSubData, const TDesC& aFileName) const;
    74 	IMPORT_C TBool IsOpenedFileL(TCalPubSubData aPubSubData) const;
    75 
    76 	// debug only
    77 /**
    78 @publishedPartner
    79 @released
    80 */
    81 	IMPORT_C void _DebugSetHeapFailL(RAllocator::TAllocFail aFail, TInt aRate);
    82 
    83 /**
    84 @publishedPartner
    85 @released
    86 */
    87 	IMPORT_C TInt _DebugRequestAllocatedCellsL();
    88 
    89 	// deprecated
    90 	IMPORT_C void StartChangeNotification(MCalChangeCallBack* aCallBack, MCalChangeCallBack::TChangeEntryType aChangeEntryType,	TBool aIncludeUndatedTodos,	TTime aFilterStartTime,	TTime aFilterEndTime);
    91 	
    92 	IMPORT_C void __dbgClearTzClientCacheL(TBool aRestartCaching);
    93 
    94 	IMPORT_C TInt _DebugRequestAllocatedHeapSizeL();
    95 	
    96 public:
    97 	CCalSessionImpl& Impl() const;
    98 	  
    99 private:
   100 	CCalSession();
   101 	void ConstructL();
   102 private:
   103 	CCalSessionImpl* iImpl;
   104 	};
   105 	
   106 #endif // __CALSESSION_H__