serviceproviders/sapi_calendar/tsrc/testing/tcalendarservice/tcal_changenotify/inc/calendarinterface.h
changeset 22 fc9cf246af83
parent 19 989d2f495d90
child 24 f4292e0e20df
equal deleted inserted replaced
19:989d2f495d90 22:fc9cf246af83
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:   Defination of class CCalendarInterface
    14 * Description:  Defination of class CCalendarInterface
    15 *
    15 *
    16 */
    16 */
    17 
       
    18 
    17 
    19 
    18 
    20 #ifndef __CALENDARINTERFACE_H
    19 #ifndef __CALENDARINTERFACE_H
    21 #define __CALENDARINTERFACE_H
    20 #define __CALENDARINTERFACE_H
    22 
    21 
    29 #include <caluser.h>
    28 #include <caluser.h>
    30 #include <calentry.h>
    29 #include <calentry.h>
    31 #include <calchangecallback.h>
    30 #include <calchangecallback.h>
    32 
    31 
    33 #include "calendarheader.h"
    32 #include "calendarheader.h"
       
    33 #include "calendarconstants.h"
    34 
    34 
    35 class CCalendarService;
    35 class CCalendarService;
       
    36 class CIterableCalEntryList;
    36 class CEntryAttributes;
    37 class CEntryAttributes;
    37 class TUIDSet;
    38 class TUIDSet;
    38 
    39 
    39 /**
    40 /**
    40  * This class provides the Calendar SAPI interface to LIW Framework 
    41  * This class provides the Calendar SAPI interface to LIW Framework 
   113 	     * @return void
   114 	     * @return void
   114 	    */
   115 	    */
   115 		static void SetImportOutputL( RPointerArray<TUIDSet>& aOutputUIDSet, 
   116 		static void SetImportOutputL( RPointerArray<TUIDSet>& aOutputUIDSet, 
   116 												CLiwGenericParamList& aOutParamList );
   117 												CLiwGenericParamList& aOutParamList );
   117 
   118 
       
   119         /**
       
   120          * Set Getlist output to output parameter
       
   121          * @param aOutputCalEntry getlist output
       
   122          * @param aOutParamList Output parammeter
       
   123          *
       
   124          * @return void
       
   125         */
       
   126         void SetCalEntryOutputL( RPointerArray<CCalEntry>& aOutputCalEntry, 
       
   127                                                 CLiwGenericParamList& aOutParamList, 
       
   128                                                 const TDesC& aCalendarName );
       
   129         /**
       
   130          * Set Getlist output to output parameter
       
   131          * @param aOutputCalEntry getlist output
       
   132          * @param aOutParamList Output parammeter
       
   133          *
       
   134          * @return void
       
   135         */
       
   136         void SetCalInstanceOutputL( RPointerArray<CCalInstance>& aOutputCalEntry, 
       
   137                                                 CLiwGenericParamList& aOutParamList, 
       
   138                                                 const TDesC& aCalendarName );
       
   139         
       
   140 		
   118 		/**
   141 		/**
   119 	     * Set Change Notification output to output parameter
   142 	     * Set Change Notification output to output parameter
   120 	     * @param aOutputChangeSet Notifications list
   143 	     * @param aOutputChangeSet Notifications list
   121 	     * @param aOutParamList Output parammeter
   144 	     * @param aOutParamList Output parammeter
   122 		 *
   145 		 *
   238 	     * @param aMethod Entry Method
   261 	     * @param aMethod Entry Method
   239 		 *
   262 		 *
   240 	     * @return TPtrC Entry Method
   263 	     * @return TPtrC Entry Method
   241 	    */
   264 	    */
   242 		static TPtrC GetMethodL( const CCalEntry::TMethod aMethod );
   265 		static TPtrC GetMethodL( const CCalEntry::TMethod aMethod );
       
   266 
       
   267 		/**
       
   268 	     * Removes the reference of CIterableCalEntryList from the table maintained 
       
   269 	     * by interface
       
   270 	     * @param aCalEntryList Element that need to be removed from the table
       
   271 		 *
       
   272 	     * @return void
       
   273 	    */
       
   274 		void RemoveCalEntryListFromArray( CIterableCalEntryList* aCalEntryList );
   243 
   275 
   244 
   276 
   245 	private:
   277 	private:
   246 	
   278 	
   247 		/**
   279 		/**
   315 	     * @param aPosBased ETrue for position pased parameters
   347 	     * @param aPosBased ETrue for position pased parameters
   316 		 *
   348 		 *
   317 	     * @return void
   349 	     * @return void
   318 	    */
   350 	    */
   319 		void GetListCalendarEntryL(const CLiwGenericParamList& aInParamList, 
   351 		void GetListCalendarEntryL(const CLiwGenericParamList& aInParamList, 
   320 												CLiwGenericParamList& aOutParamList, 
   352 												CLiwGenericParamList& aOutParamList,
   321 												const TBool aPosBased );
   353 												TUint aCmdOptions,
       
   354 												MLiwNotifyCallback* aCallback ,
       
   355 												const TBool aPosBased,
       
   356 												TInt32& aTransactionId  );
   322 												
   357 												
   323 		/**
   358 		/**
   324 	     * Issues Import Calendar Entry request to Calendar Service
   359 	     * Issues Import Calendar Entry request to Calendar Service
   325 	     * @param aInParamList Input param list
   360 	     * @param aInParamList Input param list
   326 	     * @param aOutParamList Output param list
   361 	     * @param aOutParamList Output param list
   386 	     * @param aGlobalUid Input string
   421 	     * @param aGlobalUid Input string
   387 	     * @param aOutGlobalUid output param for GlobalUid
   422 	     * @param aOutGlobalUid output param for GlobalUid
   388 		 *
   423 		 *
   389 	     * @return void
   424 	     * @return void
   390 	    */
   425 	    */
   391 		void GetGlobalUid( const TDesC& aGlobalUid, TDes8& aOutGlobalUid );
   426 		void GetGlobalUid( const TDesC& aGlobalUid, TPtr8 aOutGlobalUid );
   392 
   427 
   393 		/**
   428 		/**
   394 	     * Extracts ContentType from the input param list
   429 	     * Extracts ContentType from the input param list
   395 	     * @param aInParamList Input param list
   430 	     * @param aInParamList Input param list
   396 	     * @param aPosBased ETrue for position pased parameters
   431 	     * @param aPosBased ETrue for position pased parameters
   405 	     * @param aInParamList Input param list
   440 	     * @param aInParamList Input param list
   406 	     * @param aTransactionId output param fromtransactiod id
   441 	     * @param aTransactionId output param fromtransactiod id
   407 		 *
   442 		 *
   408 	     * @return void
   443 	     * @return void
   409 	    */
   444 	    */
   410 		TInt GetTransactionId( const CLiwGenericParamList& aInParamList, 
   445 		void GetTransactionIdL( const CLiwGenericParamList& aInParamList, 
   411 												TInt32& aTransactionId );
   446 												TInt32& aTransactionId );
   412 
   447 
   413 		/**
   448 		/**
   414 	     * Extracts CalendarName from the input param list
   449 	     * Extracts CalendarName from the input param list
   415 	     * @param aInParamList Input param list
   450 	     * @param aInParamList Input param list
       
   451 	     * @param aCmdName Command Name
       
   452 	     * @param aField ParameterName to read
   416 	     * @param aPosBased ETrue for position pased parameters
   453 	     * @param aPosBased ETrue for position pased parameters
   417 	     * @param aCalendarName Output param for Calendar Name
   454 	     * @param aCalendarName Output param for Calendar Name
   418 		 *
   455 		 *
   419 	     * @return void
   456 	     * @return void
   420 	    */
   457 	    */
   421 	    void GetCalendarNameL( const CLiwGenericParamList& aInParamList, 
   458 	    void GetCalendarNameL( const CLiwGenericParamList& aInParamList,
       
   459 	    										const TDesC8& aCmdName,  
       
   460 	    										const TDesC8& aField, 
   422 	    										TBool aPosBased, 
   461 	    										TBool aPosBased, 
   423 	    										TDes& aCalendarName );
   462 	    										HBufC*& aCalendarName );
       
   463 
       
   464 		/**
       
   465 	     * Extracts Descriptor Field from Map in input param list
       
   466 	     * @param aInParamList Input param list
       
   467 	     * @param aCmdName Command Name
       
   468 	     * @param aMapName Map name in input param list
       
   469 	     * @param aFieldName Filed name to read from map
       
   470 	     * @param aPosBased ETrue for position pased parameters
       
   471 	     * @param aOutputField Output param for Field value
       
   472 		 *
       
   473 	     * @return void
       
   474 	    */
       
   475 		void CCalendarInterface::GetDesCFieldFromMapL( const CLiwGenericParamList& aInParamList, 
       
   476 														const TDesC8& aCmdName, 
       
   477 														const TDesC8& aMapName, 
       
   478 														const TDesC8& aFieldName, 
       
   479 														TBool aPosBased, 
       
   480 														HBufC*& aOutputField );
       
   481 
       
   482 		/**
       
   483 	     * Extracts 8-bit Descriptor Field from Map in input param list
       
   484 	     * @param aInParamList Input param list
       
   485 	     * @param aCmdName Command Name
       
   486 	     * @param aMapName Map name in input param list
       
   487 	     * @param aFieldName Filed name to read from map
       
   488 	     * @param aPosBased ETrue for position pased parameters
       
   489 	     * @param aOutputField Output param for Field value
       
   490 		 *
       
   491 	     * @return void
       
   492 	    */
       
   493 		void CCalendarInterface::GetDesC8FieldFromMapL( const CLiwGenericParamList& aInParamList, 
       
   494 														const TDesC8& aCmdName, 
       
   495 														const TDesC8& aMapName, 
       
   496 														const TDesC8& aFieldName, 
       
   497 														TBool aPosBased, 
       
   498 														HBufC8*& aOutputField );
   424 
   499 
   425 		/**
   500 		/**
   426 	     * Extracts Entry attributes for Add/Update request
   501 	     * Extracts Entry attributes for Add/Update request
   427 	     * @param aInParamList Input param list
   502 	     * @param aInParamList Input param list
   428 	     * @param aPosBased ETrue for position pased parameters
   503 	     * @param aCalendarName CalendarName
   429 	     * @param aCalendar Output param for Calendar Name
   504 	     * @param aPosBased ETrue for position pased parameters
   430 		 *
   505 		 *
   431 	     * @return CEntryAttributes* EntryAttributes object
   506 	     * @return CEntryAttributes* EntryAttributes object
   432 	    */
   507 	    */
   433 		CEntryAttributes* GetAddParametersL( const CLiwGenericParamList& aInParamList, 
   508 		CEntryAttributes* GetAddParametersL( const CLiwGenericParamList& aInParamList, 
   434 												TBool aPosBased, 
   509 												const TDesC& aCalendarName,
   435 												TDes& aCalendar );
   510 												TBool aPosBased);
   436 		
   511 		
   437 		/**
   512 		/**
   438 	     * Extracts Filter for Delete request
   513 	     * Extracts Filter for Delete request
   439 	     * @param aInParamList Input param list
   514 	     * @param aInParamList Input param list
   440 	     * @param aCalendarName Output param for Calendar Name
       
   441 	     * @param aFilter Output param for Filter
   515 	     * @param aFilter Output param for Filter
   442 	     * @param aPosBased ETrue for position pased parameters
   516 	     * @param aPosBased ETrue for position pased parameters
   443 		 *
   517 		 *
   444 	     * @return void
   518 	     * @return void
   445 	    */
   519 	    */
   446 		void GetDeleteEntryFilterL(const CLiwGenericParamList& aInParamList, 
   520 		void GetDeleteEntryFilterL(const CLiwGenericParamList& aInParamList, 
   447 												TDes& aCalendarName,
       
   448 												CCalendarFilter& aFilter, 
   521 												CCalendarFilter& aFilter, 
   449 												const TBool aPosBased );
   522 												const TBool aPosBased );
   450 
   523 
   451 		/**
   524 		/**
   452 	     * Extracts Inputs for Import request
   525 	     * Extracts Inputs for Import request
   469 		/**
   542 		/**
   470 	     * Extracts Inputs for Export request
   543 	     * Extracts Inputs for Export request
   471 	     * @param aInParamList Input param list
   544 	     * @param aInParamList Input param list
   472 	     * @param aPosBased ETrue for position pased parameters
   545 	     * @param aPosBased ETrue for position pased parameters
   473 	     * @param aCalExportParams Output param for Export parameters
   546 	     * @param aCalExportParams Output param for Export parameters
   474 	     * @param aCalendarFormat Output param for Calendar Format to be used (ICal/VCal)
       
   475 	     * @param aCalendarName Output param for Calendar Name
       
   476 		 *
   547 		 *
   477 	     * @return void
   548 	     * @return void
   478 	    */
   549 	    */
   479 		void GetExportInputL( const CLiwGenericParamList& aInParamList, 
   550 		void GetExportInputL( const CLiwGenericParamList& aInParamList, 
   480 												TBool                  aPosBased, 
   551 												TBool                  aPosBased, 
   481 												CCalendarExportParams& aCalExportParams,
   552 												CCalendarExportParams& aCalExportParams);							  
   482 												TDes8&                 aCalendarFormat, 
       
   483 												TDes&                  aCalendarName );							  
       
   484 	
   553 	
   485 		/**
   554 		/**
   486 	     * Extracts Inputs for Change Notification request
   555 	     * Extracts Inputs for Change Notification request
   487 	     * @param aInParamList Input param list
   556 	     * @param aInParamList Input param list
   488 	     * @param aCalendarName Output param for Calendar Name
       
   489 	     * @param aFileter Output param for Change Notification filter
   557 	     * @param aFileter Output param for Change Notification filter
   490 	     * @param aPosBased ETrue for position pased parameters
   558 	     * @param aPosBased ETrue for position pased parameters
   491 		 *
   559 		 *
   492 	     * @return void
   560 	     * @return void
   493 	    */
   561 	    */
   494 		void GetNotificationFilterL(const CLiwGenericParamList& aInParamList, 
   562 		void GetNotificationFilterL( const CLiwGenericParamList& aInParamList, 
   495 												TDes& aCalendarName,
       
   496 												CCalendarFilter& aFilter, 
   563 												CCalendarFilter& aFilter, 
   497 												const TBool aPosBased );
   564 												const TBool aPosBased );
   498 												
   565 												
       
   566 		/**
       
   567 	     * Appends error message
       
   568 	     * @param aCmdName Command Name
       
   569 	     * @param aParameter Parameter Name
       
   570 	     * @param aMessage Error message
       
   571 		 *
       
   572 	     * @return void
       
   573 	    */
       
   574 		void AppendErrorMessageL( const TDesC8& aCmdName, 
       
   575 												const TDesC8& aParameter, 
       
   576 												const TDesC& aMessage );
   499 												
   577 												
       
   578 		/**
       
   579 	     * Checks for the valid data type of Parameter.
       
   580 	     * @param aParam Input parameter
       
   581 	     * @param aExpectedtype Expected type for input parameter
       
   582 	     * @param aCmdName Command Name
       
   583 	     * @param aParameter Parameter Name
       
   584 	     * @param aErrorMessage Error message in case of type mismatch
       
   585 		 *
       
   586 	     * @return void
       
   587 	    */
       
   588 		void ValidateParamTypeL( TLiwVariant& aParam, 
       
   589 												LIW::TVariantTypeId aExpectedtype, 
       
   590 												const TDesC8& aCmdName, 
       
   591 												const TDesC8& aParameter,
       
   592 												const TDesC& aMessage );
       
   593 
       
   594 		/**
       
   595 	     * Returns entry type for given LocalUid.
       
   596 	     * @param aCalendarName CalendarName
       
   597 	     * @param aLocalUid LocalUid
       
   598 		 *
       
   599 	     * @return Entry type
       
   600 	    */
       
   601 		TInt GetEntryType( const TDesC& aCalendarName, TCalLocalUid aLocalUid );
       
   602         /**
       
   603          * Returns entry type for given LocalUid.
       
   604          * @param aCalendarName CalendarName
       
   605          * @param aLocalUid LocalUid
       
   606          *
       
   607          * @return Entry type
       
   608         */
       
   609         TInt GetEntryType( const TDesC& aCalendarName, const TDesC8& aGuid );
       
   610 		
       
   611 		
       
   612 		/**
       
   613 	     * Check if given calendar is in use.
       
   614 	     * @param aCalendarName CalendarName
       
   615 		 *
       
   616 	     * @return True if given calendar is in use
       
   617 	    */
       
   618 		TBool CCalendarInterface::CheckCalendarInUse( const TDesC& aCalendarName );
       
   619 		
   500 	private:
   620 	private:
   501 
   621 
   502 	  	/**
   622 	  	/**
   503 	     * CCalendarService class pointer
   623 	     * CCalendarService class pointer
       
   624 	     * @internal
   504 	    */		
   625 	    */		
   505 		CCalendarService* iCalService;
   626 		CCalendarService* iCalService;
   506 
   627 
       
   628 	  	/**
       
   629 	     * Error Message object
       
   630 	     * @internal
       
   631 	    */		
       
   632 		HBufC* iErrorMessage;
       
   633 
       
   634 	  	/**
       
   635 	     * Array containing the list of CalEntryList.
       
   636 	     * @internal
       
   637 	    */		
       
   638 		RPointerArray<CIterableCalEntryList> iArrayCalEntryList;
       
   639 
   507 	};
   640 	};
   508 
   641 
   509 
   642 
   510 #endif __CALENDARINTERFACE_H
   643 #endif __CALENDARINTERFACE_H