summaryrefslogtreecommitdiffstats
path: root/src/importdialog.h
blob: b99e9ff23c02d6f5c63c8e6ad5464cb02901dfbc (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
72
/***************************************************************************
    copyright            : (C) 2003-2006 by Robby Stephenson
    email                : [email protected]
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 TQRadioButton;
class TQCheckBox;
class TQShowEvent;

namespace Tellico {
  namespace Import {
    class Importer;
    typedef TQMap<Import::Format, TQString> FormatMap;
  }

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

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

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

  static TQString fileFilter(Import::Format format);
  static Import::Target importTarget(Import::Format format);
  static TQString 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;
  TQRadioButton* m_radioAppend;
  TQRadioButton* m_radioReplace;
  TQRadioButton* m_radioMerge;
};

} // end namespace
#endif