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.

backgroundthread.h 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * backgroundthread.h
  3. *
  4. * Copyright (C) 2004 Zack Rusin <zack@kde.org>
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. */
  21. #ifndef TDESPELL_BACKGROUNDTHREAD_H
  22. #define TDESPELL_BACKGROUNDTHREAD_H
  23. #include "broker.h"
  24. #include <tqthread.h>
  25. #include <tqmutex.h>
  26. class TQObject;
  27. namespace KSpell2
  28. {
  29. class Filter;
  30. class Broker;
  31. class Dictionary;
  32. class BackgroundThread : public TQThread
  33. {
  34. public:
  35. BackgroundThread();
  36. void setReceiver( TQObject *parent );
  37. TQObject *receiver() const { return m_recv; }
  38. void setBroker( const Broker::Ptr& broker );
  39. Broker *broker() const { return m_broker; }
  40. void setText( const TQString& );
  41. TQString text() const;
  42. void changeLanguage( const TQString& );
  43. TQString language() const;
  44. void setFilter( Filter *filter );
  45. Filter *filter() const { return m_filter; }
  46. TQStringList suggest( const TQString& ) const;
  47. virtual void run();
  48. void stop();
  49. private:
  50. TQObject *m_recv;
  51. TQMutex m_mutex;
  52. Filter *m_filter;
  53. Broker::Ptr m_broker;
  54. Dictionary *m_dict;
  55. bool m_done;
  56. };
  57. }
  58. #endif