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.

89 lines
2.4KB

  1. /*
  2. This file is part of libtdeabc.
  3. Copyright (c) 2003 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 KABC_VCARDTOOL_H
  18. #define KABC_VCARDTOOL_H
  19. #include "addressee.h"
  20. #include "vcardparser.h"
  21. class TQDateTime;
  22. namespace TDEABC {
  23. class Agent;
  24. class Key;
  25. class Picture;
  26. class Secrecy;
  27. class Sound;
  28. class KABC_EXPORT VCardTool
  29. {
  30. public:
  31. VCardTool();
  32. ~VCardTool();
  33. /**
  34. Creates a string that contains the addressees from the list in
  35. the vCard format.
  36. */
  37. TQString createVCards( Addressee::List list, VCard::Version version = VCard::v3_0 );
  38. /**
  39. Parses the string and returns a list of addressee objects.
  40. */
  41. Addressee::List parseVCards( const TQString& vcard );
  42. private:
  43. /**
  44. Split a string and replaces escaped separators on the fly with
  45. unescaped ones.
  46. */
  47. TQStringList splitString( const TQChar &sep, const TQString &value );
  48. TQDateTime parseDateTime( const TQString &str );
  49. TQString createDateTime( const TQDateTime &dateTime );
  50. Picture parsePicture( const VCardLine &line );
  51. VCardLine createPicture( const TQString &identifier, const Picture &pic );
  52. Sound parseSound( const VCardLine &line );
  53. VCardLine createSound( const Sound &snd );
  54. Key parseKey( const VCardLine &line );
  55. VCardLine createKey( const Key &key );
  56. Secrecy parseSecrecy( const VCardLine &line );
  57. VCardLine createSecrecy( const Secrecy &secrecy );
  58. Agent parseAgent( const VCardLine &line );
  59. VCardLine createAgent( VCard::Version version, const Agent &agent );
  60. TQMap<TQString, int> mAddressTypeMap;
  61. TQMap<TQString, int> mPhoneTypeMap;
  62. class VCardToolPrivate;
  63. VCardToolPrivate *d;
  64. };
  65. }
  66. #endif