• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

console/kabcclient

  • sources
  • kde-4.14
  • kdepim
  • console
  • kabcclient
  • src
csvtemplate.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005 - 2006 Kevin Krammer <kevin.krammer@gmx.at>
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 //
18 
19 #ifndef CSVTEMPLATE_H
20 #define CSVTEMPLATE_H
21 
22 // Qt includes
23 #include <QtCore/QMap>
24 #include <QtCore/QString>
25 
26 // forward declarations
27 class KConfigBase;
28 class QDateTime;
29 
30 namespace KABC
31 {
32  class Addressee;
33 }
34 
88 class CSVTemplate
89 {
90 public:
100  explicit CSVTemplate(KConfigBase* config);
101 
113  inline int columns() const { return m_columns; }
114 
135  inline const QString& delimiter() const { return m_delimiter; }
136 
160  inline const QString& quote() const { return m_quote; }
161 
188  QString fieldText(int column, const KABC::Addressee& addressee) const;
189 
214  void setFieldText(int column, KABC::Addressee& addressee, const QString& text) const;
215 
233  static CSVTemplate* defaultTemplate();
234 
235 private:
240  int m_columns;
241 
247  QString m_delimiter;
248 
253  QString m_quote;
254 
258  QMap<int, int> m_columnToField;
259 
264  QString m_datePattern;
265 
270  QString m_dateFormat;
271 
277  static CSVTemplate* m_defaultTemplate;
278 
279 private:
286  explicit CSVTemplate(const QString& datePattern);
287 
299  QString formatDate(const QDateTime& date) const;
300 
314  QDateTime parseDate(const QString& text) const;
315 
325  void createDateFormat();
326 };
327 
468 #endif
469 
470 // End of file
QMap< int, int >
CSVTemplate::setFieldText
void setFieldText(int column, KABC::Addressee &addressee, const QString &text) const
Sets an addressee field using the data of a given text.
Definition: csvtemplate.cpp:255
CSVTemplate
Class for handling KAddressBook's CSV templates.
Definition: csvtemplate.h:88
QString
CSVTemplate::delimiter
const QString & delimiter() const
Returns the CSV delimiter string.
Definition: csvtemplate.h:135
CSVTemplate::fieldText
QString fieldText(int column, const KABC::Addressee &addressee) const
Returns the specified field of the given addressee formatted as a string.
Definition: csvtemplate.cpp:113
CSVTemplate::quote
const QString & quote() const
Returns the CSV quoting string.
Definition: csvtemplate.h:160
CSVTemplate::defaultTemplate
static CSVTemplate * defaultTemplate()
Returns the template with default setup.
Definition: csvtemplate.cpp:429
CSVTemplate::CSVTemplate
CSVTemplate(KConfigBase *config)
Creates a template handler for the given description.
Definition: csvtemplate.cpp:41
CSVTemplate::columns
int columns() const
Returns the number of CSV columns.
Definition: csvtemplate.h:113
QDateTime
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

console/kabcclient

Skip menu "console/kabcclient"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal