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.

slaveconfig.h 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // -*- c++ -*-
  2. /*
  3. * This file is part of the KDE libraries
  4. * Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License version 2 as published by the Free Software Foundation.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Library General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Library General Public License
  16. * along with this library; see the file COPYING.LIB. If not, write to
  17. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18. * Boston, MA 02110-1301, USA.
  19. **/
  20. #ifndef KIO_SLAVE_CONFIG_H
  21. #define KIO_SLAVE_CONFIG_H
  22. #include <tqobject.h>
  23. #include <tdeio/global.h>
  24. namespace TDEIO {
  25. class SlaveConfigPrivate;
  26. /**
  27. * SlaveConfig
  28. *
  29. * This class manages the configuration for io-slaves based on protocol
  30. * and host. The Scheduler makes use of this class to configure the slave
  31. * whenever it has to connect to a new host.
  32. *
  33. * You only need to use this class if you want to override specific
  34. * configuration items of an io-slave when the io-slave is used by
  35. * your application.
  36. *
  37. * Normally io-slaves are being configured by "tdeio_<protocol>rc"
  38. * configuration files. Groups defined in such files are treated as host
  39. * or domain specification. Configuration items defined in a group are
  40. * only applied when the slave is connecting with a host that matches with
  41. * the host and/or domain specified by the group.
  42. */
  43. class TDEIO_EXPORT SlaveConfig : public TQObject
  44. {
  45. Q_OBJECT
  46. public:
  47. static SlaveConfig *self();
  48. ~SlaveConfig();
  49. /**
  50. * Configure slaves of type @p protocol by setting @p key to @p value.
  51. * If @p host is specified the configuration only applies when dealing
  52. * with @p host.
  53. *
  54. * Changes made to the slave configuration only apply to slaves
  55. * used by the current process.
  56. */
  57. void setConfigData(const TQString &protocol, const TQString &host, const TQString &key, const TQString &value );
  58. /**
  59. * Configure slaves of type @p protocol with @p config.
  60. * If @p host is specified the configuration only applies when dealing
  61. * with @p host.
  62. *
  63. * Changes made to the slave configuration only apply to slaves
  64. * used by the current process.
  65. */
  66. void setConfigData(const TQString &protocol, const TQString &host, const MetaData &config );
  67. /**
  68. * Query slave configuration for slaves of type @p protocol when
  69. * dealing with @p host.
  70. */
  71. MetaData configData(const TQString &protocol, const TQString &host);
  72. /**
  73. * Query a specific configuration key for slaves of type @p protocol when
  74. * dealing with @p host.
  75. */
  76. TQString configData(const TQString &protocol, const TQString &host, const TQString &key);
  77. /**
  78. * Undo any changes made by calls to setConfigData.
  79. */
  80. void reset();
  81. signals:
  82. /**
  83. * This signal is raised when a slave of type @p protocol deals
  84. * with @p host for the first time.
  85. *
  86. * Your application can use this signal to make some last minute
  87. * configuration changes with setConfigData based on the
  88. * host.
  89. */
  90. void configNeeded(const TQString &protocol, const TQString &host);
  91. protected:
  92. SlaveConfig();
  93. static SlaveConfig *_self;
  94. SlaveConfigPrivate *d;
  95. };
  96. }
  97. #endif