TDE personal information management applications
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

subjectsdlg.h 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. #ifndef KornSubjectsDlg_h
  2. #define KornSubjectsDlg_h
  3. #include<kdialogbase.h>
  4. #include <tdelistview.h>
  5. #include<tqvaluevector.h>
  6. #include <kpushbutton.h>
  7. class KMailDrop;
  8. class KornMailSubject;
  9. class KornMailId;
  10. class TDEListView;
  11. class KornMailDlg;
  12. class TQProgressDialog;
  13. class DoubleProgressDialog;
  14. template< class T > class TQPtrList;
  15. /**
  16. * KornSubjectsDlg loads all mail subjects and shows them in a list control.
  17. * Buttons allow the user to select several mails, delete them or to show one
  18. * of the mails.
  19. */
  20. class KornSubjectsDlg: public KDialogBase
  21. {
  22. Q_OBJECT
  23. /**
  24. * SubjectListViewItem is a helper class representing one line in the list view.
  25. * It stores the mail subject the line represents and controls the sorting.
  26. */
  27. class SubjectListViewItem : public TDEListViewItem
  28. {
  29. KornMailSubject * _mailSubject;
  30. public:
  31. /**
  32. * SubjectListViewItem Constructor
  33. * @param parent list view
  34. * @param item KornMailSubject this item should represent. It is NOT deleted
  35. * if SubjectListViewItem is deleted.
  36. */
  37. SubjectListViewItem( TQListView *parent, KornMailSubject * item);
  38. /**
  39. * SubjectListViewItem Destructor
  40. */
  41. ~SubjectListViewItem();
  42. /**
  43. * Compare to list view item. Called if the sort header are clicked.
  44. * @param item item to compare this with
  45. * @param column column to compare
  46. * @param ascending search order
  47. */
  48. int compare( TQListViewItem* item, int column, bool ascending ) const;
  49. /**
  50. * Return the mail subject.
  51. * @return the mail subject
  52. */
  53. KornMailSubject * getMailSubject() const {return _mailSubject;}
  54. };
  55. TQPtrList< KMailDrop > *_mailDrop;
  56. struct SubjectsData
  57. {
  58. TQPtrListIterator< KMailDrop > *it;
  59. TQValueVector< KornMailSubject > *subjects;
  60. DoubleProgressDialog *progress;
  61. bool atRechecking;
  62. } *_subjects;
  63. struct DeleteData
  64. {
  65. TQPtrList< KornMailSubject > *messages;
  66. TQPtrList< const KornMailId > *ids;
  67. TQProgressDialog *progress;
  68. KMailDrop *drop;
  69. int totalNumberOfMessages;
  70. } *_delete;
  71. TDEListView * _list;
  72. KPushButton * invertSelButton;
  73. KPushButton * clearSelButton;
  74. KPushButton * deleteButton;
  75. KPushButton * showButton;
  76. KornMailDlg * mailDlg;
  77. bool _loadSubjectsCanceled, _deleteMailsCanceled;
  78. bool _canDeleteMaildrop;
  79. /**
  80. * Load the mails subjects and refresh the list view.
  81. * @return false if the load process was cancled (close the dialog!), true otherwise
  82. */
  83. //bool reload();
  84. /**
  85. * Show a message in a separate dialog
  86. * @param item message to show
  87. */
  88. void showMessage(TQListViewItem * item);
  89. public:
  90. /**
  91. * KornSubjectsDlg Constructor
  92. * @param parent parent widget
  93. */
  94. KornSubjectsDlg( TQWidget *parent=0 );
  95. /**
  96. * This functions clears all available KMailDrop's.
  97. */
  98. void clear();
  99. /**
  100. * This function adds a maildrop to the list.
  101. * @param mailDrop The maildrop which have to be added.
  102. */
  103. void addMailBox(KMailDrop* mailDrop);
  104. /**
  105. * This method loads the messages and shows the dialog.
  106. */
  107. void loadMessages();
  108. /**
  109. * Show the KornSubjectsDlg as a modal dialog.
  110. * @param name The name of the box
  111. */
  112. void showSubjectsDlg( const TQString& name );
  113. /**
  114. * KornSubjectsDlg Destructor
  115. */
  116. virtual ~KornSubjectsDlg();
  117. private slots:
  118. /**
  119. * called if the cancel button was clicked while loadind the subjects
  120. */
  121. void loadSubjectsCanceled();
  122. /**
  123. * called if the selction of the list view was changed
  124. */
  125. void listSelectionChanged();
  126. /**
  127. * called if the "Invert Selection" button was clicked
  128. */
  129. void invertSelection();
  130. /**
  131. * called if the "Remove Selection" button was clicked
  132. */
  133. void removeSelection();
  134. /**
  135. * called if the "Show" button was clicked
  136. */
  137. void showMessage();
  138. /**
  139. * called if a list view item was double clicked
  140. */
  141. void doubleClicked ( TQListViewItem *item );
  142. void closeDialog();
  143. //Functions for the subjects
  144. public slots:
  145. void reloadSubjects();
  146. private:
  147. void prepareStep1Subjects( KMailDrop* );
  148. void removeStep1Subjects( KMailDrop* );
  149. void prepareStep2Subjects( KMailDrop* );
  150. void removeStep2Subjects( KMailDrop* );
  151. bool makeSubjectsStruct();
  152. void deleteSubjectsStruct();
  153. private slots:
  154. void slotReloadRechecked();
  155. void slotSubjectsCanceled();
  156. void subjectAvailable( KornMailSubject* );
  157. void subjectsReady( bool );
  158. //Functions neccesairy for delete
  159. public slots:
  160. void deleteMessage();
  161. private:
  162. void makeDeleteStruct();
  163. void deleteDeleteStruct();
  164. void fillDeleteMessageList();
  165. void fillDeleteIdList( KMailDrop *drop );
  166. void deleteNextMessage();
  167. private slots:
  168. void deleteMailsReady( bool );
  169. void slotDeleteCanceled();
  170. };
  171. #endif