TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

distributionlistdialog.h 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. This file is part of libtdeabc.
  3. Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. #ifndef KABC_DISTRIBUTIONLISTDIALOG_H
  18. #define KABC_DISTRIBUTIONLISTDIALOG_H
  19. #include <tqwidget.h>
  20. #include <kdialogbase.h>
  21. class TQListView;
  22. class TQComboBox;
  23. class TQButtonGroup;
  24. namespace TDEABC {
  25. class AddressBook;
  26. class DistributionListEditorWidget;
  27. class DistributionListManager;
  28. /**
  29. @short Frontend to create distribution lists
  30. Creating a new DistributionListDialog does automatically
  31. load all addressees and distribution lists from the config
  32. files. The changes will be saved when clicking the 'OK'
  33. button.
  34. Example:
  35. \code
  36. TDEABC::DistributionListDialog *dlg = new
  37. TDEABC::DistributionListDialog( TDEABC::StdAddressBook::self(), this );
  38. dlg->exec();
  39. \endcode
  40. */
  41. class KABC_EXPORT DistributionListDialog : public KDialogBase
  42. {
  43. Q_OBJECT
  44. public:
  45. /**
  46. Constructor.
  47. @param ab The addressbook, the addressees should be used from
  48. @param parent The parent widget
  49. */
  50. DistributionListDialog( AddressBook *ab, TQWidget *parent );
  51. /**
  52. Destructor.
  53. */
  54. virtual ~DistributionListDialog();
  55. private:
  56. DistributionListEditorWidget *mEditor;
  57. struct Data;
  58. Data *d;
  59. };
  60. /**
  61. @short Helper class
  62. */
  63. class KABC_EXPORT EmailSelector : public KDialogBase
  64. {
  65. public:
  66. EmailSelector( const TQStringList &emails, const TQString &current,
  67. TQWidget *parent );
  68. TQString selected();
  69. static TQString getEmail( const TQStringList &emails, const TQString &current,
  70. TQWidget *parent );
  71. private:
  72. TQButtonGroup *mButtonGroup;
  73. };
  74. /**
  75. @short Helper class
  76. */
  77. class KABC_EXPORT DistributionListEditorWidget : public TQWidget
  78. {
  79. Q_OBJECT
  80. public:
  81. DistributionListEditorWidget( AddressBook *, TQWidget *parent );
  82. virtual ~DistributionListEditorWidget();
  83. private slots:
  84. void newList();
  85. void editList();
  86. void removeList();
  87. void addEntry();
  88. void removeEntry();
  89. void changeEmail();
  90. void updateEntryView();
  91. void updateAddresseeView();
  92. void updateNameCombo();
  93. void slotSelectionEntryViewChanged();
  94. void slotSelectionAddresseeViewChanged();
  95. void save();
  96. private:
  97. TQComboBox *mNameCombo;
  98. TQLabel *mListLabel;
  99. TQListView *mEntryView;
  100. TQListView *mAddresseeView;
  101. AddressBook *mAddressBook;
  102. DistributionListManager *mManager;
  103. TQPushButton *mNewButton, *mEditButton, *mRemoveButton;
  104. TQPushButton *mChangeEmailButton, *mRemoveEntryButton, *mAddEntryButton;
  105. struct Data;
  106. Data *d;
  107. };
  108. }
  109. #endif