sapi_calendar/calendarservice/inc/calendarheader.h
changeset 0 14df0fbfcc4e
equal deleted inserted replaced
-1:000000000000 0:14df0fbfcc4e
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Support for header information retrieval 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CALENDARHEADER_H
       
    20 #define __CALENDARHEADER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <badesca.h>
       
    24 #include <calcommon.h>
       
    25 
       
    26 class CCalSession;
       
    27 class CCalEntryView;
       
    28 class CCalInstanceView;
       
    29 class CCalenInterimUtils2;
       
    30 class CCalEntry;
       
    31 class CCalInstance;
       
    32 
       
    33 /**
       
    34  * struct to Output Details of the Imported Entries Both LocalUid and Global UID
       
    35 */
       
    36 struct TUIDSet 
       
    37 	{
       
    38 	
       
    39 	TCalLocalUid iLocalUID;
       
    40 	HBufC8*  iGlobalUID;
       
    41 	
       
    42 	TUIDSet():iGlobalUID(NULL){}
       
    43 	
       
    44 	~TUIDSet()
       
    45 		{
       
    46 		delete iGlobalUID;
       
    47 		}
       
    48 	};
       
    49 
       
    50 /**
       
    51  * Contains information about session for a calendar
       
    52 */
       
    53 class CCalendarASyncRequest : public CActive
       
    54 	{
       
    55 	protected: 
       
    56 		CCalendarASyncRequest():CActive( EPriorityStandard )
       
    57 			{
       
    58 			}
       
    59 			
       
    60 	public:	
       
    61 		virtual TBool IsInProgress() 
       
    62 			{
       
    63 			return EFalse;
       
    64 			}
       
    65 	};
       
    66 
       
    67 /**
       
    68  * Contains information about session for a calendar
       
    69 */
       
    70 class CCalendarSessionInfo : public CBase
       
    71 	{
       
    72 	public: 
       
    73 
       
    74 		/**
       
    75 		 * Two Phase Constructor
       
    76 		*/ 
       
    77 		static CCalendarSessionInfo* NewL( const TDesC& aCalendar );
       
    78 
       
    79 		/**
       
    80 		 * Destructor
       
    81 		*/ 
       
    82 		~CCalendarSessionInfo();
       
    83 		
       
    84 		/**
       
    85 		 * Returns the calendar Name
       
    86 		 * @return Calendar Name to which this object is associated
       
    87 		*/ 
       
    88 		TPtrC Calendar();
       
    89 
       
    90 		/**
       
    91 		 * Returns the calendar session
       
    92 		 * @return Calendar session
       
    93 		*/ 
       
    94 		CCalSession* Session();
       
    95 
       
    96 		/**
       
    97 		 * Returns the calendar entry view
       
    98 		 * @return Calendar entry view
       
    99 		*/ 
       
   100 		CCalEntryView* EntryView();
       
   101 
       
   102 		/**
       
   103 		 * Returns the calendar instance view
       
   104 		 * @return Calendar instance view
       
   105 		*/ 
       
   106 		CCalInstanceView* InstanceView();
       
   107 		
       
   108 	private:
       
   109 	
       
   110 		/**
       
   111 		 * Constructor
       
   112 		*/ 
       
   113 		CCalendarSessionInfo();
       
   114 		
       
   115 		/**
       
   116 		 * Two Phase Constructor
       
   117 		 * @param aCalendar Calendar name
       
   118 		 * @return void
       
   119 		*/ 
       
   120 		void ConstructL( const TDesC& aCalendar );
       
   121 		
       
   122 		
       
   123 	private:
       
   124 
       
   125 		/**
       
   126 		 * Calendar Name
       
   127 	  	*/ 
       
   128 		HBufC* 				iCalName;
       
   129 
       
   130 		/**
       
   131 		 * Calendar Session
       
   132 	  	*/ 
       
   133 		CCalSession*		iCalSession;
       
   134 
       
   135 		/**
       
   136 		 * Calendar Entry View
       
   137 	  	*/ 
       
   138 		CCalEntryView*		iCalEntView;
       
   139 
       
   140 		/**
       
   141 		 * Calendar Instance View
       
   142 	  	*/ 
       
   143 		CCalInstanceView*	iCalInstView;
       
   144 		
       
   145 	};
       
   146 	
       
   147 /**
       
   148  * Calendar Filer options
       
   149 */
       
   150 enum TCalendarFilerFlags
       
   151 	{
       
   152 	EFilterGUid		= 0x1,
       
   153 	EFilterLUid		= 0x2,
       
   154 	EFilterText 	= 0x4,
       
   155 	EFilterType		= 0x8,
       
   156 	EFilterStTime 	= 0x10,
       
   157 	EFilterEndTime 	= 0x20,
       
   158 	EFlagDeleteAll 	= 0x40,
       
   159 	EFlagUnDateToDo	= 0x80,
       
   160 	};	
       
   161 	
       
   162 /**
       
   163  * Contains Filter information for an operation(GetList/Delete/ChangeNotification)
       
   164 */
       
   165 class CCalendarFilter : public CBase
       
   166 	{
       
   167 	public:
       
   168 
       
   169 		/**
       
   170 		 * Two Phase Constructor
       
   171 		*/ 
       
   172 		IMPORT_C static CCalendarFilter* NewL();
       
   173 
       
   174 		/**
       
   175 		 * Destructor
       
   176 		*/ 
       
   177 		~CCalendarFilter();
       
   178 
       
   179 		/**
       
   180 		 * Sets Start time for time range 
       
   181 		 * @param aStartTime Start Time
       
   182 		 * @return void
       
   183 		*/ 
       
   184 		IMPORT_C void SetStartTimeL( const TTime& aStartTime );
       
   185 
       
   186 		/**
       
   187 		 * Sets End time for time range 
       
   188 		 * @param aEndTime Start Time
       
   189 		 * @return void
       
   190 		*/ 
       
   191 		IMPORT_C void SetEndTimeL( const TTime& aStartTime );
       
   192 
       
   193 		/**
       
   194 		 * Sets Filter type
       
   195 		 * @param aFilterType filter type
       
   196 		 * @return void
       
   197 		*/ 
       
   198 		IMPORT_C void SetFilterTypeL( const TDesC& aFilterType );
       
   199 
       
   200 		/**
       
   201 		 * Sets Filter text
       
   202 		 * @param aTextToSearch Filter text
       
   203 		 * @return void
       
   204 		*/ 
       
   205 		IMPORT_C void SetFilterTextL( const TDesC& aTextToSearch );
       
   206 
       
   207 		/**
       
   208 		 * Adds Global Uid to filter criteria
       
   209 		 * @param aGuid Global Uid
       
   210 		 * @return void
       
   211 		*/ 
       
   212 		IMPORT_C void AddGuidL( const TDesC8& aGuid );
       
   213 
       
   214 		/**
       
   215 		 * Adds Local Uid to filter criteria
       
   216 		 * @param aLocalUid Local Uid
       
   217 		 * @return void
       
   218 		*/ 
       
   219 		IMPORT_C void AddLocalUid( const TCalLocalUid aLocalUid );
       
   220 
       
   221 		/**
       
   222 		 * Sets Delete all flag. Valid for Remove operations only.
       
   223 		 * @param aDeleteAll Delete All flag
       
   224 		 * @return void
       
   225 		*/ 
       
   226 		IMPORT_C void SetDeleteAll( TBool aDeleteAll = ETrue );
       
   227 
       
   228 		/**
       
   229 		 * Sets IncludeUnDateToDo to filter.Valid for Change Notification cmd only.
       
   230 		 * @param aInclude 
       
   231 		 * @return void
       
   232 		*/ 
       
   233 		IMPORT_C void SetIncludeUnDateToDo( TBool aInclude = ETrue );
       
   234 		
       
   235 		/**
       
   236 		 * Returns time range 
       
   237 		 * @return CalCommon::TCalTimeRange 
       
   238 		*/ 
       
   239 		IMPORT_C CalCommon::TCalTimeRange TimeRange() const;
       
   240 		
       
   241 		/**
       
   242 		 * Returns Entry type filter
       
   243 		 * @return TUint 
       
   244 		*/ 
       
   245 		IMPORT_C TUint FilterType() const;
       
   246 
       
   247 		/**
       
   248 		 * Returns filter text
       
   249 		 * @return TPtrC 
       
   250 		*/ 
       
   251 		IMPORT_C TPtrC FilterText() const;
       
   252 
       
   253 		/**
       
   254 		 * Returns Global UID list
       
   255 		 * @return CDesC8Array* 
       
   256 		*/ 
       
   257 		IMPORT_C const CDesC8Array* GuidList() const;
       
   258 
       
   259 		/**
       
   260 		 * Returns Local Uid List
       
   261 		 * @return RArray<TCalLocalUid>
       
   262 		*/ 
       
   263 		IMPORT_C const RArray<TCalLocalUid>& LocalUidList() const;
       
   264 
       
   265 		/**
       
   266 		 * Returns Filter options selected
       
   267 		 * @return TInt32
       
   268 		*/ 
       
   269 		IMPORT_C TInt32 Filter() const;
       
   270 		
       
   271 	
       
   272         /** 
       
   273         * Assignment operator. 
       
   274         * @param aFilterParamInfo Item to assign.
       
   275         * @return The source object.
       
   276         */
       
   277 		CCalendarFilter& operator=(const CCalendarFilter& aFilterParamInfo);
       
   278 		
       
   279 	private:
       
   280 	
       
   281 		/**
       
   282 		 * Constructor
       
   283 		*/ 
       
   284 		CCalendarFilter();
       
   285 		
       
   286 		/**
       
   287 		 * Constructor
       
   288 		*/ 
       
   289 		void ConstructL();
       
   290 
       
   291 	private:
       
   292 	
       
   293 		/**
       
   294 		 * Global Uid List
       
   295 		*/ 
       
   296 		CDesC8Array* iGuidList;
       
   297 
       
   298 		/**
       
   299 		 * Local Uid List
       
   300 		*/ 
       
   301 		RArray<TCalLocalUid> iLocalUidList;		
       
   302 	
       
   303 		/**
       
   304 		 * Start time
       
   305 		*/ 
       
   306 		TCalTime 	iStartTimeRange;
       
   307 
       
   308 		/**
       
   309 		 * End time
       
   310 		*/ 
       
   311 		TCalTime 	iEndTimeRange;
       
   312 
       
   313 		/**
       
   314 		 * Filter Type
       
   315 		*/ 
       
   316 		TUint 		iFilterType;
       
   317 
       
   318 		/**
       
   319 		 * Filter text
       
   320 		*/ 
       
   321 		HBufC*		iTextToSearch;
       
   322 		
       
   323 		/**
       
   324 		 * Filter options selected
       
   325 		*/ 
       
   326 		TInt32		iFilterFlags;
       
   327 	};
       
   328 
       
   329 /**
       
   330  * Callback base class
       
   331 */
       
   332 class MCalCallbackBase 
       
   333 	{
       
   334 	public:
       
   335 
       
   336 	/**
       
   337 	   * Gives the result
       
   338 	   * @param aErrCode Error code
       
   339 	   * @param aResult Result 
       
   340 	   * @return void
       
   341   	*/
       
   342 		virtual void NotifyResultL(TInt aErrCode, TAny* aResult) = 0;
       
   343 		
       
   344 	/**
       
   345 	  * Input param 
       
   346   	*/		
       
   347 		const TAny* iPtrInParamList; 
       
   348 
       
   349 	/**
       
   350 	  * Callback 
       
   351   	*/		
       
   352 		TAny* iPtrNotifyCallback; 
       
   353 		
       
   354 	/**
       
   355 	  * Transaction Id
       
   356   	*/		
       
   357 		TInt32 iTransactionId;
       
   358 	};
       
   359 	
       
   360 	
       
   361 
       
   362 /**
       
   363  * Contains Input Params information for Export
       
   364 */
       
   365 class CCalendarExportParams : public CBase
       
   366 	{
       
   367 	
       
   368 	public:
       
   369 	
       
   370 		/**
       
   371 		 * Calendar Export Parameter options
       
   372 		*/
       
   373 		enum TCalendarExportParams
       
   374 			{
       
   375 			EParamsGUid				= 0x1,
       
   376 			EParamsLUid				= 0x2,
       
   377 			EParamsFileName		 	= 0x4,
       
   378 			};
       
   379 			
       
   380 
       
   381 		/**
       
   382 		 * Two Phase Constructor
       
   383 		*/ 
       
   384 		IMPORT_C static CCalendarExportParams* NewL();
       
   385 
       
   386 		/**
       
   387 		 * Destructor
       
   388 		*/ 
       
   389 		~CCalendarExportParams();
       
   390 
       
   391 		/**
       
   392 		 * Adds Global Uid to Params
       
   393 		 * @param aGuid Global Uid
       
   394 		 * @return void
       
   395 		*/ 
       
   396 		IMPORT_C void AddGuidL( const TDesC8& aGuid );
       
   397 
       
   398 		/**
       
   399 		 * Adds Global Uid to Params
       
   400 		 * @param CDesC8Array*
       
   401 		 * @return void
       
   402 		*/ 
       
   403 		IMPORT_C void AddGuidL( const CDesC8Array* aInputGUIDArray );
       
   404 		
       
   405 		/**
       
   406 		 * Adds Local Uid to Params
       
   407 		 * @param aLocalUid Local Uid
       
   408 		 * @return void
       
   409 		*/ 
       
   410 		IMPORT_C void AddLocalUid( const TCalLocalUid aLocalUid );
       
   411 
       
   412 		/**
       
   413 		 * Adds Local Uid to Params
       
   414 		 * @param RArray<TCalLocalUid>&
       
   415 		 * @return void
       
   416 		*/ 
       
   417 		IMPORT_C void AddLocalUid( const RArray<TCalLocalUid>& aInputLocalUIDArray );
       
   418 		
       
   419 		/**
       
   420 		 * Adds Local Uid to Params
       
   421 		 * @param aLocalUid Local Uid
       
   422 		 * @return void
       
   423 		*/ 
       
   424 		IMPORT_C void SetExportFileNameL( const TDesC& aExportFileName );
       
   425 		
       
   426 		/**
       
   427 		 * Returns Global UID Array
       
   428 		 * @return CDesC8Array* 
       
   429 		*/ 
       
   430 		IMPORT_C const CDesC8Array* GuidArray() const;
       
   431 
       
   432 		/**
       
   433 		 * Returns Local Uid Array
       
   434 		 * @return RArray<TCalLocalUid>
       
   435 		*/ 
       
   436 		IMPORT_C const RArray<TCalLocalUid>& LocalUidArray() const;
       
   437 
       
   438 		/**
       
   439 		 * Returns implementor of MCalCallbackBase Mixin Class(Interface)
       
   440 		 * @return MCalCallbackBase*
       
   441 		*/ 
       
   442 		IMPORT_C TPtrC ExportFileName();
       
   443 		
       
   444 		/**
       
   445 		 * Returns Params options selected
       
   446 		 * @return TInt32
       
   447 		*/ 
       
   448 		IMPORT_C TInt32 Params() const;
       
   449 		
       
   450 		/**
       
   451 		 * Returns CCalendarExportParams object which is the exact copy of this object
       
   452 		 * @return CCalendarExportParams*
       
   453 		*/ 
       
   454 		IMPORT_C CCalendarExportParams* CloneL();
       
   455 		
       
   456 	private:
       
   457 	
       
   458 		/**
       
   459 		 * Constructor
       
   460 		*/ 
       
   461 		CCalendarExportParams();
       
   462 		
       
   463 	private:
       
   464 	
       
   465 		/**
       
   466 		 * Global Uid Array
       
   467 		*/ 
       
   468 		CDesC8Array* iInputGUIDArray;
       
   469 
       
   470 		/**
       
   471 		 * Local Uid Array
       
   472 		*/ 
       
   473 		RArray<TCalLocalUid> iInputLocalUIDArray;		
       
   474 	
       
   475 		/**
       
   476 		 * Start time
       
   477 		*/ 
       
   478 		HBufC* 		iFileName;
       
   479 
       
   480 		/**
       
   481 		 * Params options selected
       
   482 		*/ 
       
   483 		TInt32		iParamsFlags;
       
   484 
       
   485 	};
       
   486 
       
   487 #endif __CALENDARHEADER_H