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

kaddressbook

  • sources
  • kde-4.12
  • kdepim
  • kaddressbook
  • xxport
  • csv
qcsvmodel_p.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef QCSVMODEL_P_H
21 #define QCSVMODEL_P_H
22 
23 #include "qcsvreader.h"
24 
25 #include <QtCore/QThread>
26 
27 class CsvParser : public QThread, public QCsvBuilderInterface
28 {
29  Q_OBJECT
30 
31  public:
32  explicit CsvParser( QObject *parent );
33  ~CsvParser();
34 
35  void load( QIODevice *device );
36 
37  void begin();
38  void beginLine();
39  void field( const QString &data, uint row, uint column );
40  void endLine();
41  void end();
42  void error( const QString &errorMsg );
43 
44  QCsvReader *reader() {
45  return mReader;
46  }
47 
48  Q_SIGNALS:
49  void columnCountChanged( int columns );
50  void rowCountChanged( int rows );
51  void dataChanged( const QString &data, int row, int column );
52  void ended();
53 
54  protected:
55  virtual void run();
56 
57  private:
58  QCsvReader *mReader;
59  QIODevice *mDevice;
60  int mRowCount;
61  int mColumnCount;
62  int mCacheCounter;
63 };
64 
65 #endif
CsvParser::load
void load(QIODevice *device)
Definition: qcsvmodel.cpp:40
CsvParser::reader
QCsvReader * reader()
Definition: qcsvmodel_p.h:44
CsvParser::run
virtual void run()
Definition: qcsvmodel.cpp:89
CsvParser::rowCountChanged
void rowCountChanged(int rows)
QCsvReader
A parser for comma separated value data.
Definition: qcsvreader.h:91
QObject
CsvParser::beginLine
void beginLine()
This method is called whenever a new line starts.
Definition: qcsvmodel.cpp:54
CsvParser::error
void error(const QString &errorMsg)
This method is called whenever an error occurs during parsing.
Definition: qcsvmodel.cpp:85
CsvParser::ended
void ended()
CsvParser::columnCountChanged
void columnCountChanged(int columns)
CsvParser::~CsvParser
~CsvParser()
Definition: qcsvmodel.cpp:35
qcsvreader.h
CsvParser::begin
void begin()
This method is called on start of the parsing.
Definition: qcsvmodel.cpp:47
CsvParser::field
void field(const QString &data, uint row, uint column)
This method is called for every parsed field.
Definition: qcsvmodel.cpp:59
CsvParser::CsvParser
CsvParser(QObject *parent)
Definition: qcsvmodel.cpp:29
QCsvBuilderInterface
An interface to build data structures from a CSV file.
Definition: qcsvreader.h:36
CsvParser::endLine
void endLine()
This method is called whenever a line ends.
Definition: qcsvmodel.cpp:70
CsvParser::end
void end()
This method is called at the end of parsing.
Definition: qcsvmodel.cpp:79
CsvParser
Definition: qcsvmodel_p.h:27
QThread
CsvParser::dataChanged
void dataChanged(const QString &data, int row, int column)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

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

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