Original DBUS bindings for TQt
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.

message.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* -*- mode: C++; c-file-style: "gnu" -*- */
  2. /* message.h: TQt wrapper for DBusMessage
  3. *
  4. * Copyright (C) 2003 Zack Rusin <zack@kde.org>
  5. *
  6. * Licensed under the Academic Free License version 2.1
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. #ifndef DBUS_TQT_MESSAGE_H
  24. #define DBUS_TQT_MESSAGE_H
  25. #include <tqvariant.h>
  26. #include <tqstring.h>
  27. #include <tqstringlist.h>
  28. #include "dbus/dbus.h"
  29. namespace DBusQt {
  30. class Message
  31. {
  32. public:
  33. class iterator {
  34. public:
  35. iterator();
  36. iterator( const iterator& );
  37. iterator( DBusMessage* msg );
  38. ~iterator();
  39. iterator& operator=( const iterator& );
  40. const TQVariant& operator*() const;
  41. TQVariant& operator*();
  42. iterator& operator++();
  43. iterator operator++(int);
  44. bool operator==( const iterator& it );
  45. bool operator!=( const iterator& it );
  46. TQVariant var() const;
  47. protected:
  48. TQVariant marshallBaseType( DBusMessageIter* i );
  49. void fillVar();
  50. struct IteratorData;
  51. IteratorData *d;
  52. };
  53. Message( int messageType );
  54. Message( DBusMessage * );//hide this one from the public implementation
  55. Message( const TQString& service, const TQString& path,
  56. const TQString& interface, const TQString& method );
  57. Message( const Message& replayingTo );
  58. Message( const TQString& path, const TQString& interface,
  59. const TQString& name );
  60. Message( const Message& replayingTo, const TQString& errorName,
  61. const TQString& errorMessage );
  62. Message operator=( const Message& other );
  63. virtual ~Message();
  64. int type() const;
  65. void setPath( const TQString& );
  66. TQString path() const;
  67. void setInterface( const TQString& );
  68. TQString interface() const;
  69. void setMember( const TQString& );
  70. TQString member() const;
  71. void setErrorName( const TQString& );
  72. TQString errorName() const;
  73. void setDestination( const TQString& );
  74. TQString destination() const;
  75. bool setSender( const TQString& sender );
  76. TQString sender() const;
  77. TQString signature() const;
  78. iterator begin() const;
  79. iterator end() const;
  80. TQVariant at( int i );
  81. public:
  82. Message& operator<<( bool );
  83. Message& operator<<( TQ_INT8 );
  84. Message& operator<<( TQ_INT32 );
  85. Message& operator<<( TQ_UINT32 );
  86. Message& operator<<( TQ_INT64 );
  87. Message& operator<<( TQ_UINT64 );
  88. Message& operator<<( double );
  89. Message& operator<<( const TQString& );
  90. Message& operator<<( const TQVariant& );
  91. //Message& operator<<();
  92. //Message& operator<<();
  93. //Message& operator<<();
  94. //Message& operator<<();
  95. //Message& operator<<();
  96. //Message& operator<<();
  97. //Message& operator<<();
  98. protected:
  99. friend class Connection;
  100. DBusMessage* message() const;
  101. private:
  102. struct Private;
  103. Private *d;
  104. };
  105. }
  106. #endif