LibEngsas
edbbackup.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2012 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library 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 GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  MA 02110-1301 USA.
18 */
19 
20 #ifndef EDBBACKUP_H
21 #define EDBBACKUP_H
22 
23 #include "eglobal.h"
24 #include "esetupwizardwidget.h"
25 
26 namespace Ui {
27  class EDBBackup;
28 }
29 
30 #include <QFileInfo>
31 #include <QTextStream>
32 
40 {
41  Q_OBJECT
42  public:
43  EDBBackup(ESetupWizardObject *newObject, QWidget *parent = NULL, Qt::WindowFlags flags = 0);
44  ~EDBBackup();
45 
46  static QString mysqlEscape(QString input);
47 
54  bool working() const;
55 
56  public slots:
57  bool finish();
58  bool saveSettings(QString &error);
59  void abort();
60 
61  private slots:
62  void setDumpFile();
63 
64  private:
69  bool dumpTable ( QString table, QTextStream &stream);
73  bool dumpView ( QString view, QTextStream &stream);
74  QStringList sortViews(QStringList views);
75  void setRange ( int num );
76  void finishedStep();
77  void actualStep ( QString msg );
78  void log ( QString msg );
79 
80  QFileInfo dumpFile;
81  QString codecName;
82  bool doAbort, isWorking;
83  Ui::EDBBackup *ui;
84 
85  signals:
86  void exportStarted();
87  void exportFinished(bool result);
88 };
89 
90 #endif // EDBBACKUP_H