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.
 
 
 
 
 
 

116 lines
3.4 KiB

  1. /*
  2. This file is part of tdepim.
  3. Copyright (c) 2003 - 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 TDEABC_RESOURCEXMLRPC_H
  18. #define TDEABC_RESOURCEXMLRPC_H
  19. #include <tqmap.h>
  20. #include <tdepimmacros.h>
  21. #include "libtdepim/tdeabcresourcecached.h"
  22. class TDEConfig;
  23. class Synchronizer;
  24. namespace KXMLRPC {
  25. class Server;
  26. }
  27. namespace TDEABC {
  28. class EGroupwarePrefs;
  29. class KDE_EXPORT ResourceXMLRPC : public ResourceCached
  30. {
  31. Q_OBJECT
  32. public:
  33. ResourceXMLRPC( const TDEConfig* );
  34. ResourceXMLRPC( const TQString &url, const TQString &domain,
  35. const TQString &user, const TQString &password );
  36. ~ResourceXMLRPC();
  37. virtual void writeConfig( TDEConfig* );
  38. EGroupwarePrefs *prefs() const { return mPrefs; }
  39. virtual bool doOpen();
  40. virtual void doClose();
  41. virtual Ticket *requestSaveTicket();
  42. virtual void releaseSaveTicket( Ticket* );
  43. virtual bool load();
  44. virtual bool asyncLoad();
  45. virtual bool save( Ticket * );
  46. virtual bool asyncSave( Ticket * );
  47. protected:
  48. void init();
  49. protected slots:
  50. void loginFinished( const TQValueList<TQVariant>&, const TQVariant& );
  51. void logoutFinished( const TQValueList<TQVariant>&, const TQVariant& );
  52. void listContactsFinished( const TQValueList<TQVariant>&, const TQVariant& );
  53. void addContactFinished( const TQValueList<TQVariant>&, const TQVariant& );
  54. void updateContactFinished( const TQValueList<TQVariant>&, const TQVariant& );
  55. void deleteContactFinished( const TQValueList<TQVariant>&, const TQVariant& );
  56. void loadCategoriesFinished( const TQValueList<TQVariant>&, const TQVariant& );
  57. void loadCustomFieldsFinished( const TQValueList<TQVariant>&, const TQVariant& );
  58. void fault( int, const TQString&, const TQVariant& );
  59. void addContactFault( int, const TQString&, const TQVariant& );
  60. void updateContactFault( int, const TQString&, const TQVariant& );
  61. void deleteContactFault( int, const TQString&, const TQVariant& );
  62. void addContact( const TDEABC::Addressee& );
  63. void updateContact( const TDEABC::Addressee& );
  64. void deleteContact( const TDEABC::Addressee& );
  65. private:
  66. void initEGroupware();
  67. TQString addrTypesToTypeStr( int );
  68. void writeContact( const Addressee&, TQStringVariantMap& );
  69. void readContact( const TQStringVariantMap&, Addressee &addr, TQString& );
  70. EGroupwarePrefs *mPrefs;
  71. TQString mSessionID;
  72. TQString mKp3;
  73. TQMap<TQString, int> mCategoryMap;
  74. TQMap<TQString, int> mAddrTypes;
  75. TQMap<TQString, TQString> mCustomFieldsMap;
  76. KXMLRPC::Server *mServer;
  77. Synchronizer *mSynchronizer;
  78. class ResourceXMLRPCPrivate;
  79. ResourceXMLRPCPrivate *d;
  80. };
  81. }
  82. #endif