TDE personal information management applications
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.
 
 
 
 
 
 

101 lines
3.1 KiB

  1. /*
  2. identitycombo.h
  3. This file is part of KMail, the KDE mail client.
  4. Copyright (c) 2002 Marc Mutz <mutz@kde.org>
  5. KMail is free software; you can redistribute it and/or modify it
  6. under the terms of the GNU General Public License, version 2, as
  7. published by the Free Software Foundation.
  8. KMail is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  15. In addition, as a special exception, the copyright holders give
  16. permission to link the code of this program with any edition of
  17. the TQt library by Trolltech AS, Norway (or with modified versions
  18. of TQt that use the same license as TQt), and distribute linked
  19. combinations including the two. You must obey the GNU General
  20. Public License in all respects for all of the code used other than
  21. TQt. If you modify this file, you may extend this exception to
  22. your version of the file, but you are not obligated to do so. If
  23. you do not wish to do so, delete this exception statement from
  24. your version.
  25. */
  26. #ifndef _KPIM_IDENTITYCOMBO_H_
  27. #define _KPIM_IDENTITYCOMBO_H_
  28. #include <tqcombobox.h>
  29. #include <tqvaluelist.h>
  30. #include <tdepimmacros.h>
  31. class TQString;
  32. namespace KPIM {
  33. class IdentityManager;
  34. class Identity;
  35. /**
  36. * @short A combo box that always shows the up-to-date identity list.
  37. * @author Marc Mutz <mutz@kde.org>
  38. **/
  39. class KDE_EXPORT IdentityCombo : public TQComboBox {
  40. Q_OBJECT
  41. public:
  42. IdentityCombo( IdentityManager* manager, TQWidget * parent=0, const char * name=0 );
  43. TQString currentIdentityName() const;
  44. uint currentIdentity() const;
  45. void setCurrentIdentity( const TQString & identityName );
  46. void setCurrentIdentity( const Identity & identity );
  47. void setCurrentIdentity( uint uoid );
  48. signals:
  49. /** @deprecated
  50. * @em Really emitted whenever the current identity changes. Either
  51. * by user intervention or on setCurrentIdentity() or if the
  52. * current identity disappears.
  53. **/
  54. void identityChanged( const TQString & identityName );
  55. /** @em Really emitted whenever the current identity changes. Either
  56. * by user intervention or on setCurrentIdentity() or if the
  57. * current identity disappears.
  58. *
  59. * You might also want to listen to IdentityManager::changed,
  60. * IdentityManager::deleted and IdentityManager::added.
  61. **/
  62. void identityChanged( uint uoid );
  63. public slots:
  64. /** Connected to IdentityManager::changed(). Reloads the list
  65. * of identities.
  66. **/
  67. void slotIdentityManagerChanged();
  68. protected slots:
  69. void slotEmitChanged(int);
  70. protected:
  71. void reloadCombo();
  72. void reloadUoidList();
  73. protected:
  74. TQValueList<uint> mUoidList;
  75. IdentityManager* mIdentityManager;
  76. };
  77. } // namespace
  78. #endif // _KPIM_IDENTITYCOMBO_H_