vcardtool.h
00001 /* 00002 This file is part of libtdeabc. 00003 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef KABC_VCARDTOOL_H 00022 #define KABC_VCARDTOOL_H 00023 00024 #include "addressee.h" 00025 #include "vcardparser.h" 00026 00027 class TQDateTime; 00028 00029 namespace TDEABC { 00030 00031 class Agent; 00032 class Key; 00033 class Picture; 00034 class Secrecy; 00035 class Sound; 00036 00037 class KABC_EXPORT VCardTool 00038 { 00039 public: 00040 VCardTool(); 00041 ~VCardTool(); 00042 00047 TQString createVCards( Addressee::List list, VCard::Version version = VCard::v3_0 ); 00048 00052 Addressee::List parseVCards( const TQString& vcard ); 00053 00054 private: 00059 TQStringList splitString( const TQChar &sep, const TQString &value ); 00060 00061 TQDateTime parseDateTime( const TQString &str ); 00062 TQString createDateTime( const TQDateTime &dateTime ); 00063 00064 Picture parsePicture( const VCardLine &line ); 00065 VCardLine createPicture( const TQString &identifier, const Picture &pic ); 00066 00067 Sound parseSound( const VCardLine &line ); 00068 VCardLine createSound( const Sound &snd ); 00069 00070 Key parseKey( const VCardLine &line ); 00071 VCardLine createKey( const Key &key ); 00072 00073 Secrecy parseSecrecy( const VCardLine &line ); 00074 VCardLine createSecrecy( const Secrecy &secrecy ); 00075 00076 Agent parseAgent( const VCardLine &line ); 00077 VCardLine createAgent( VCard::Version version, const Agent &agent ); 00078 00079 TQMap<TQString, int> mAddressTypeMap; 00080 TQMap<TQString, int> mPhoneTypeMap; 00081 00082 class VCardToolPrivate; 00083 VCardToolPrivate *d; 00084 }; 00085 00086 } 00087 00088 #endif