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.
 
 
 
 
 
 

103 lines
3.2 KiB

  1. /* -*- mode: C++; c-file-style: "gnu" -*-
  2. obtainkeysjob.h
  3. This file is part of libkleopatra, the KDE keymanagement library
  4. Copyright (c) 2005 Klarälvdalens Datakonsult AB
  5. Libkleopatra is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of the
  8. License, or (at your option) any later version.
  9. Libkleopatra is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  16. In addition, as a special exception, the copyright holders give
  17. permission to link the code of this program with any edition of
  18. the TQt library by Trolltech AS, Norway (or with modified versions
  19. of TQt that use the same license as TQt), and distribute linked
  20. combinations including the two. You must obey the GNU General
  21. Public License in all respects for all of the code used other than
  22. TQt. If you modify this file, you may extend this exception to
  23. your version of the file, but you are not obligated to do so. If
  24. you do not wish to do so, delete this exception statement from
  25. your version.
  26. */
  27. #ifndef __KLEO_OBTAINKEYSJOB_H__
  28. #define __KLEO_OBTAINKEYSJOB_H__
  29. #include "kleo/specialjob.h"
  30. #include <tqstringlist.h>
  31. #include <gpgmepp/context.h>
  32. namespace Kleo {
  33. /**
  34. @short SpecialJob for listing Chiasmus key files.
  35. In the Chiasmus system, keys are mapped 1:1 to
  36. files. Furthermore, we have to definition of the format of those
  37. keys, so we cannot display more than the filename anyway. Due to
  38. all of these limitations, we don't use KeyListJob here, but roll
  39. our own interface.
  40. The name of the function is x-obtain-keys. It takes no parameters.
  41. To use, create an ObtainKeysJob instance like this:
  42. <code>
  43. Kleo::SpecialJob * job =
  44. protocol->specialJob("x-obtain-keys", TQStringVariantMap());
  45. </code>
  46. The resulting TQVariant will contain a TQStringList containing the
  47. absolute filenames of the keys found in the configured key files.
  48. */
  49. class ObtainKeysJob : public Kleo::SpecialJob {
  50. Q_OBJECT
  51. TQ_PROPERTY( TQStringList result READ result )
  52. public:
  53. ObtainKeysJob();
  54. ~ObtainKeysJob();
  55. /*!\reimp SpecialJob */
  56. GpgME::Error start();
  57. /*!\reimp SpecialJob */
  58. GpgME::Error exec();
  59. /*!\reimp Kleo::Job */
  60. void showErrorDialog( TQWidget *, const TQString & ) const;
  61. //using SpecialJob::result;
  62. TQStringList result() const { return mResult; }
  63. public slots:
  64. void slotCancel();
  65. private slots:
  66. void slotPerform();
  67. void slotPerform( bool async );
  68. private:
  69. GpgME::Error mError;
  70. TQStringList mKeyPaths;
  71. unsigned int mIndex;
  72. TQStringList mResult;
  73. bool mCanceled;
  74. };
  75. }
  76. #endif // __KLEO_OBTAINKEYSJOB_H__