calendarui/controller/inc/calendeleteui.h
changeset 26 a949c2543c15
parent 18 c198609911f9
child 50 579cc610882e
equal deleted inserted replaced
23:fd30d51f876b 26:a949c2543c15
    27 
    27 
    28 //User Includes
    28 //User Includes
    29 #include "calenactionuiutils.h"
    29 #include "calenactionuiutils.h"
    30 #include "calennotificationhandler.h"
    30 #include "calennotificationhandler.h"
    31 #include "calencommandhandler.h"
    31 #include "calencommandhandler.h"
    32 
    32 #include "hb_calencommands.hrh"
    33 
    33 
    34 // FORWARD DECLARATIONS
    34 // FORWARD DECLARATIONS
    35 class CCalenController;
    35 class CCalenController;
    36 
    36 class HbAction;
       
    37 
       
    38 enum TDeleteConfirmationType
       
    39 {
       
    40 	EDeleteEntry = 1,
       
    41 	EDeleteToDo,
       
    42 	EDeleteToDos,
       
    43 	EDeleteAll
       
    44 };
    37 
    45 
    38 // CLASS DECLARATION
    46 // CLASS DECLARATION
    39 /**
    47 /**
    40  * CalenDeleteUi encapsulates deleting related behavior
    48  * CalenDeleteUi encapsulates deleting related behavior
    41  * in Calendar application.
    49  * in Calendar application.
   119      * e.g all-day notes that extends to next day's midnight.
   127      * e.g all-day notes that extends to next day's midnight.
   120      */
   128      */
   121     void deleteEntriesEndingAtMidnight( QDateTime aMidnight );
   129     void deleteEntriesEndingAtMidnight( QDateTime aMidnight );
   122 
   130 
   123     /**
   131     /**
   124      * Delete entry by passing CCalEntryView and CCalEntry
       
   125      * Will query user for confirmation before deletion
       
   126      * @return ETrue user confirms to delete EFalse otherwise 
       
   127      */
       
   128     TBool DeleteEntryL( AgendaEntry& aEntry );
       
   129     
       
   130     /**
       
   131      * Delete entry without querying the user
   132      * Delete entry without querying the user
   132      */
   133      */
   133     TBool DeleteEntryWithoutQueryL();
   134     TBool DeleteEntryWithoutQueryL();
   134 
   135     
   135     /**
   136     /**
   136      * Delete the given entry. Ask the user whether to delete the
   137      * Delete the given entry. Ask the user whether to delete the
   137      * instance or the entire series.
   138      * instance or the entire series.
   138      */
   139      */
   139     TBool DeleteSingleInstanceL( AgendaEntry& aInstance );
   140     void DeleteSingleInstanceL( AgendaEntry& aInstance );
   140 
   141 
   141     /**
   142     /**
   142      * Delete the given entry, using aRepeatType to determine
   143      * Delete the given entry, using aRepeatType to determine
   143      * whether to delete the instance or the entire series.
   144      * whether to delete the instance or the entire series.
   144      */
   145      */
   145     TBool DeleteSingleInstanceL( AgendaEntry& aInstance, 
   146     void DeleteSingleInstanceL( AgendaEntry& aInstance, 
   146             AgendaUtil::RecurrenceRange aRepeatType );
   147             AgendaUtil::RecurrenceRange aRepeatType );
   147     
   148     
   148     /**
   149     /**
   149      * Delete single instance.
   150      * Delete single instance.
   150      * @param aInstance Pointer to the instance to be deleted
   151      * @param aInstance Pointer to the instance to be deleted
   151      * @param aHasRepeatType Whether or not the instance is repeating
   152      * @param aHasRepeatType Whether or not the instance is repeating
   152      * @param aRepeatType Repeat type choosen to apply on delete
   153      * @param aRepeatType Repeat type choosen to apply on delete
   153      * @return ETrue is user confirms to delete, EFalse otherwise
   154      * @return ETrue is user confirms to delete, EFalse otherwise
   154      */
   155      */
   155     TBool DoDeleteSingleInstanceL( AgendaEntry& aInstance,
   156     void DoDeleteSingleInstanceL( AgendaEntry& aInstance,
   156                                    bool aHasRepeatType,
   157                                    bool aHasRepeatType,
   157                                    AgendaUtil::RecurrenceRange aRepeatType );
   158                                    AgendaUtil::RecurrenceRange aRepeatType );
   158     
   159     
   159     /**
   160     /**
   160      * Leaving function, handle ECalenNotifyViewCreated
   161      * Leaving function, handle ECalenNotifyViewCreated
   161      */
   162      */
   162     void HandleECalenNotifyViewCreatedL();
   163     void HandleECalenNotifyViewCreatedL();
   163     
       
   164    /**
       
   165     * Multiple entries delete query
       
   166     */ 
       
   167     TInt ShowMultipleEntriesDeleteQueryL(int aCount);
       
   168     
   164     
   169    /**
   165    /**
   170     * Get the date from user.
   166     * Get the date from user.
   171     */
   167     */
   172     void dateQuery();
   168     void dateQuery();
   175      * Shows a confirmation query to the user if
   171      * Shows a confirmation query to the user if
   176      * he/she wants to delete the particular instance
   172      * he/she wants to delete the particular instance
   177      * or the entire series of a repeating entry
   173      * or the entire series of a repeating entry
   178      */
   174      */
   179     void showRepeatingEntryDeleteQuery();
   175     void showRepeatingEntryDeleteQuery();
       
   176     
       
   177     /**
       
   178      * Shows a confirmation query to the user if
       
   179      * he/she wants to delete instance/instances
       
   180      */
       
   181     void showDeleteQuery(const TDeleteConfirmationType type,
       
   182                          const int count = 0);
       
   183     
       
   184     /**
       
   185      * Deletes the entries before the selected date
       
   186      */
       
   187     void getSelectedDateAndDelete();
   180 
   188 
   181 private: // own methods
   189 private: // own methods
   182     /**
   190     /**
   183      * C++ constructor
   191      * C++ constructor
   184      */
   192      */
   198     void DialogDismissedL( const int aButtonId );
   206     void DialogDismissedL( const int aButtonId );
   199 
   207 
   200 public slots:
   208 public slots:
   201 
   209 
   202     void doCompleted( int aFirstPassError );
   210     void doCompleted( int aFirstPassError );
   203     void getSelectedDate();
   211     void handleDateQuery(HbAction* action);
       
   212     void handleDeletion(HbAction* action);
       
   213     void handleDeleteCancel();
   204     
   214     
   205 private slots:
   215 private slots:
   206     void handleRepeatedEntryDelete(int index);
   216     void handleRepeatedEntryDelete(int index);
   207     void entryDeleted(ulong id);
   217     void entryDeleted(ulong id);
   208 
   218 
   226 private: // data
   236 private: // data
   227     
   237     
   228     bool iIsDeleting; // True, if asynchronous delete is running
   238     bool iIsDeleting; // True, if asynchronous delete is running
   229     QDateTime iStartTime;
   239     QDateTime iStartTime;
   230     QDateTime iEndTime;
   240     QDateTime iEndTime;
   231     QDateTime mDateTime; // Get the date selected by user.
       
   232     HbDateTimePicker *mDatePicker;
   241     HbDateTimePicker *mDatePicker;
   233     // Confirmation note id is stored here. Note is shown when asynchronous
   242     // Confirmation note id is stored here. Note is shown when asynchronous
   234     // delete completes.
   243     // delete completes.
   235     int iConfirmationNoteId;
   244     int iConfirmationNoteId;
   236     CCalenController& iController;
   245     CCalenController& iController;
   237 
   246     TCalenCommandId mDeleteCommand;
       
   247     AgendaUtil::RecurrenceRange mRecurrenceRange;
       
   248     
   238     // Stored command if the entry view
   249     // Stored command if the entry view
   239     // needs to constructed asyncronously
   250     // needs to constructed asyncronously
   240     TCalenCommand iStoredCommand;
   251     TCalenCommand iStoredCommand;
   241     int iMutlipleContextIdsCount;
   252     int iMutlipleContextIdsCount;
   242     bool iMoreEntriesToDelete;
   253     bool iMoreEntriesToDelete;
   243     bool iDisplayQuery;
   254     bool iDisplayQuery;
   244     bool mIsDateValid;
       
   245     int iEntriesToDelete;
   255     int iEntriesToDelete;
   246     };
   256     };
   247 
   257 
   248 #endif // CALENDELETEUI_H
   258 #endif // CALENDELETEUI_H
   249 
   259