summaryrefslogtreecommitdiffstats
path: root/src/importdialog.h
blob: 380243619e9d96073e0438571af3c43f8ee662de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/***************************************************************************
    copyright            : (C) 2003-2006 by Robby Stephenson
    email                : robby@periapsis.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of version 2 of the GNU General Public License as  *
 *   published by the Free Software Foundation;                            *
 *                                                                         *
 ***************************************************************************/

#ifndef IMPORTDIALOG_H
#define IMPORTDIALOG_H

#include "translators/translators.h"
#include "datavectors.h"

#include <kdialogbase.h>
#include <kurl.h>

class QRadioButton;
class QCheckBox;
class QShowEvent;

namespace Tellico {
  namespace Import {
    class Importer;
    typedef QMap<Import::Format, QString> FormatMap;
  }

/**
 * @author Robby Stephenson
 */
class ImportDialog : public KDialogBase {
Q_OBJECT

public:
  ImportDialog(Import::Format format, const KURL::List& urls, QWidget* parent, const char* name);
  ~ImportDialog();

  Data::CollPtr collection();
  QString statusMessage() const;
  Import::Action action() const;

  static QString fileFilter(Import::Format format);
  static Import::Target importTarget(Import::Format format);
  static QString startDir(Import::Format format);
  static Import::FormatMap formatMap();
  static bool formatImportsText(Import::Format format);

  static Import::Importer* importer(Import::Format format, const KURL::List& urls);
  static Data::CollPtr importURL(Import::Format format, const KURL& url);

protected:
  virtual void slotOk();

private slots:
  void slotUpdateAction();

private:
  Data::CollPtr m_coll;
  Import::Importer* m_importer;
  QRadioButton* m_radioAppend;
  QRadioButton* m_radioReplace;
  QRadioButton* m_radioMerge;
};

} // end namespace
#endif