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.
 
 
 
 
 
 

105 lines
2.7 KiB

  1. /*
  2. This file is part of tdepim.
  3. Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. #ifndef KNOTES_RESOURCEXMLRPC_H
  18. #define KNOTES_RESOURCEXMLRPC_H
  19. #include <tqptrlist.h>
  20. #include <tqstring.h>
  21. #include <tdeconfig.h>
  22. #include <kurl.h>
  23. #include <tdepimmacros.h>
  24. #include "libkcal/calendarlocal.h"
  25. #include "libkcal/journal.h"
  26. #include "knotes/resourcenotes.h"
  27. namespace KXMLRPC {
  28. class Server;
  29. }
  30. class Synchronizer;
  31. namespace KNotes {
  32. class EGroupwarePrefs;
  33. /**
  34. This class provides access to eGroupware notes via XML-RPC.
  35. */
  36. class KDE_EXPORT ResourceXMLRPC : public ResourceNotes
  37. {
  38. Q_OBJECT
  39. public:
  40. ResourceXMLRPC( const TDEConfig* );
  41. ResourceXMLRPC();
  42. virtual ~ResourceXMLRPC();
  43. void readConfig( const TDEConfig* config );
  44. void writeConfig( TDEConfig* config );
  45. EGroupwarePrefs *prefs() const { return mPrefs; }
  46. bool load();
  47. bool save();
  48. bool addNote( KCal::Journal* );
  49. bool deleteNote( KCal::Journal* );
  50. KCal::Alarm::List alarms( const TQDateTime& from, const TQDateTime& to );
  51. protected slots:
  52. void loginFinished( const TQValueList<TQVariant>&, const TQVariant& );
  53. void logoutFinished( const TQValueList<TQVariant>&, const TQVariant& );
  54. void listNotesFinished( const TQValueList<TQVariant>&, const TQVariant& );
  55. void addNoteFinished( const TQValueList<TQVariant>&, const TQVariant& );
  56. void updateNoteFinished( const TQValueList<TQVariant>&, const TQVariant& );
  57. void deleteNoteFinished( const TQValueList<TQVariant>&, const TQVariant& );
  58. void fault( int, const TQString&, const TQVariant& );
  59. private:
  60. void init();
  61. void initEGroupware();
  62. void writeNote( KCal::Journal*, TQStringVariantMap& );
  63. void readNote( const TQStringVariantMap&, KCal::Journal*, TQString& );
  64. KCal::CalendarLocal mCalendar;
  65. KXMLRPC::Server *mServer;
  66. EGroupwarePrefs *mPrefs;
  67. TQString mSessionID;
  68. TQString mKp3;
  69. TQMap<TQString, TQString> mUidMap;
  70. Synchronizer *mSynchronizer;
  71. };
  72. }
  73. #endif