console/kabcclient
inputformatimpls.h
Go to the documentation of this file.00001 // 00002 // Copyright (C) 2005 - 2006 Kevin Krammer <kevin.krammer@gmx.at> 00003 // 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software 00016 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 // 00018 00019 #ifndef INPUTFORMATIMPLS_H 00020 #define INPUTFORMATIMPLS_H 00021 00022 // local includes 00023 #include "inputformat.h" 00024 00025 // forward declarations 00026 class CSVTemplate; 00027 class CSVTemplateFactory; 00028 class DialogInputPrivate; 00029 00030 namespace KABC 00031 { 00032 class VCardConverter; 00033 } 00034 00046 class UIDInput : public InputFormat 00047 { 00048 public: 00049 virtual QString description() const; 00050 00051 virtual bool setOptions(const QByteArray& options); 00052 00053 virtual bool setCodec(QTextCodec* codec); 00054 00055 virtual KABC::Addressee readAddressee(std::istream& stream); 00056 00057 private: 00063 QTextCodec* m_codec; 00064 }; 00065 00078 class VCardInput : public InputFormat 00079 { 00080 public: 00081 VCardInput(); 00082 virtual ~VCardInput(); 00083 00084 virtual QString description() const; 00085 00086 virtual bool setOptions(const QByteArray& options); 00087 00088 virtual bool setCodec(QTextCodec* codec); 00089 00100 virtual KABC::Addressee readAddressee(std::istream& stream); 00101 00102 private: 00106 KABC::VCardConverter* m_converter; 00107 00113 QTextCodec* m_codec; 00114 }; 00115 00130 class EmailInput : public InputFormat 00131 { 00132 public: 00133 virtual QString description() const; 00134 00135 virtual bool setOptions(const QByteArray& options); 00136 00137 virtual bool setCodec(QTextCodec* codec); 00138 00139 virtual KABC::Addressee readAddressee(std::istream& stream); 00140 00141 private: 00147 QTextCodec* m_codec; 00148 }; 00149 00165 class SearchInput : public InputFormat 00166 { 00167 public: 00168 virtual QString description() const; 00169 00170 virtual bool setOptions(const QByteArray& options); 00171 00172 virtual bool setCodec(QTextCodec* codec); 00173 00174 virtual KABC::Addressee readAddressee(std::istream& stream); 00175 00176 private: 00182 QTextCodec* m_codec; 00183 }; 00184 00197 class NameInput : public InputFormat 00198 { 00199 public: 00200 virtual QString description() const; 00201 00202 virtual bool setOptions(const QByteArray& options); 00203 00204 virtual bool setCodec(QTextCodec* codec); 00205 00206 virtual KABC::Addressee readAddressee(std::istream& stream); 00207 00208 private: 00214 QTextCodec* m_codec; 00215 }; 00216 00233 class CSVInput : public InputFormat 00234 { 00235 public: 00236 CSVInput(CSVTemplateFactory* templateFactory); 00237 00238 virtual QString description() const; 00239 00240 virtual bool setOptions(const QByteArray& options); 00241 virtual QString optionUsage() const; 00242 00243 virtual bool setCodec(QTextCodec* codec); 00244 00245 virtual KABC::Addressee readAddressee(std::istream& stream); 00246 00247 private: 00253 QTextCodec* m_codec; 00254 00259 CSVTemplate* m_template; 00260 00264 CSVTemplateFactory* m_templateFactory; 00265 00266 private: 00277 QStringList split(const QString& values) const; 00278 }; 00279 00297 class DialogInput : public InputFormat 00298 { 00299 public: 00300 DialogInput(); 00301 virtual ~DialogInput(); 00302 00303 virtual QString description() const; 00304 00305 virtual bool setOptions(const QByteArray& options); 00306 00307 virtual bool setCodec(QTextCodec* codec); 00308 00309 virtual KABC::Addressee readAddressee(std::istream& stream); 00310 00311 private: 00315 DialogInputPrivate* m_private; 00316 }; 00317 00318 #endif 00319 00320 // End of file
KDE 4.2 API Reference