kselectdatabasedlg.h 2.27 KB
Newer Older
Alvaro Soliverez's avatar
Alvaro Soliverez committed
1
2
3
/***************************************************************************
                          kselectdatabase.h
                             -------------------
4
    copyright            : (C) 2005 by Tony Bloomfield <tonybloom@users.sourceforge.net>
5
                           (C) 2017 by Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
6
7

***************************************************************************/
Alvaro Soliverez's avatar
Alvaro Soliverez committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef KSELECTDATABASEDLG_H
#define KSELECTDATABASEDLG_H

// ----------------------------------------------------------------------------
// QT Includes
23

Cristian Oneț's avatar
Cristian Oneț committed
24
#include <QUrl>
Alvaro Soliverez's avatar
Alvaro Soliverez committed
25
26
27

// ----------------------------------------------------------------------------
// KDE Includes
Cristian Oneț's avatar
Cristian Oneț committed
28

29
#include <QDialog>
30
#include <QLineEdit>
Alvaro Soliverez's avatar
Alvaro Soliverez committed
31
32
33

// ----------------------------------------------------------------------------
// Project Includes
34

Łukasz Wojniłowicz's avatar
Łukasz Wojniłowicz committed
35
namespace Ui { class KSelectDatabaseDlg; }
Laurent Montel's avatar
Port++    
Laurent Montel committed
36

Łukasz Wojniłowicz's avatar
Łukasz Wojniłowicz committed
37
class KMandatoryFieldGroup;
38
class KSelectDatabaseDlg : public QDialog
Alvaro Soliverez's avatar
Alvaro Soliverez committed
39
{
40
  Q_OBJECT
Alvaro Soliverez's avatar
Alvaro Soliverez committed
41
public:
42
  explicit KSelectDatabaseDlg(int openMode, QUrl openURL = QUrl(), QWidget *parent = nullptr);
Alvaro Soliverez's avatar
Alvaro Soliverez committed
43
  ~KSelectDatabaseDlg();
44

45
  /**
46
47
48
   * Check whether we have required database drivers
   * @return - false, no drivers available, true, can proceed
   */
49
  bool checkDrivers();
50
51
52
53
54

  /**
   * Return URL of database
   * @return - pseudo-URL of database selected by user
   */
Cristian Oneț's avatar
Cristian Oneț committed
55
  const QUrl selectedURL();
56
57
58
59
60

  /**
   * Execute the database selection dialog
   * @return - as QDialog::exec()
   */
61
  int exec() override;
62

63
public Q_SLOTS:
64
  void slotDriverSelected(int idx);
Alvaro Soliverez's avatar
Alvaro Soliverez committed
65
  void slotHelp();
66

Alvaro Soliverez's avatar
Alvaro Soliverez committed
67
private:
68
  Ui::KSelectDatabaseDlg* m_widget;
Alvaro Soliverez's avatar
Alvaro Soliverez committed
69
  int m_mode;
Cristian Oneț's avatar
Cristian Oneț committed
70
  QUrl m_url;
Łukasz Wojniłowicz's avatar
Łukasz Wojniłowicz committed
71
  KMandatoryFieldGroup* m_requiredFields;
Tony Bloomfield's avatar
Tony Bloomfield committed
72
  bool m_sqliteSelected;
Alvaro Soliverez's avatar
Alvaro Soliverez committed
73
74
75
};

#endif