~ubuntu-branches/ubuntu/wily/kid3/wily-proposed

« back to all changes in this revision

Viewing changes to src/gui/dialogs/textimportdialog.h

  • Committer: Package Import Robot
  • Author(s): Ana Beatriz Guerrero Lopez, Patrick Matthäi, Ana Beatriz Guerrero Lopez
  • Date: 2011-11-13 16:34:13 UTC
  • mfrom: (1.1.13) (2.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20111113163413-5y0anlc4dqf511uh
Tags: 2.0.1-1
* New upstream release.

[ Patrick Matthäi ]
* Adjust build system.
* Add build dependency xsltproc.

[ Ana Beatriz Guerrero Lopez ]
* Some more adjustments to the build system taken from upstream's deb/
* directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * \file textimportdialog.h
 
3
 * Dialog to import from a text (file or clipboard).
 
4
 *
 
5
 * \b Project: Kid3
 
6
 * \author Urs Fleisch
 
7
 * \date 19 Jun 2011
 
8
 *
 
9
 * Copyright (C) 2011  Urs Fleisch
 
10
 *
 
11
 * This file is part of Kid3.
 
12
 *
 
13
 * Kid3 is free software; you can redistribute it and/or modify
 
14
 * it under the terms of the GNU General Public License as published by
 
15
 * the Free Software Foundation; either version 2 of the License, or
 
16
 * (at your option) any later version.
 
17
 *
 
18
 * Kid3 is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * You should have received a copy of the GNU General Public License
 
24
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
25
 */
 
26
 
 
27
#ifndef TEXTIMPORTDIALOG_H
 
28
#define TEXTIMPORTDIALOG_H
 
29
 
 
30
#include <QDialog>
 
31
 
 
32
class TextImporter;
 
33
class TrackDataModel;
 
34
class FormatListEdit;
 
35
 
 
36
/**
 
37
 * Dialog to import from a text (file or clipboard).
 
38
 */
 
39
class TextImportDialog : public QDialog {
 
40
  Q_OBJECT
 
41
 
 
42
public:
 
43
  /**
 
44
   * Constructor.
 
45
   *
 
46
   * @param parent  parent widget
 
47
   * @param trackDataModel track data to be filled with imported values
 
48
   */
 
49
  explicit TextImportDialog(QWidget* parent,
 
50
                            TrackDataModel* trackDataModel);
 
51
 
 
52
  /**
 
53
   * Destructor.
 
54
   */
 
55
  virtual ~TextImportDialog();
 
56
 
 
57
  /**
 
58
   * Clear dialog data.
 
59
   */
 
60
  void clear();
 
61
 
 
62
private slots:
 
63
  /**
 
64
   * Let user select file, assign file contents to text and preview in
 
65
   * table.
 
66
   */
 
67
  void fromFile();
 
68
 
 
69
  /**
 
70
   * Assign clipboard contents to text and preview in table.
 
71
   */
 
72
  void fromClipboard();
 
73
 
 
74
  /**
 
75
   * Save the local settings to the configuration.
 
76
   */
 
77
  void saveConfig();
 
78
 
 
79
  /**
 
80
   * Show help.
 
81
   */
 
82
  void showHelp();
 
83
 
 
84
signals:
 
85
  /**
 
86
   * Emitted when the m_trackDataVector was updated with new imported data.
 
87
   */
 
88
  void trackDataUpdated();
 
89
 
 
90
private:
 
91
  /**
 
92
   * Import from a file.
 
93
   *
 
94
   * @param fn file name
 
95
   *
 
96
   * @return true if ok.
 
97
   */
 
98
  bool importFromFile(const QString& fn);
 
99
 
 
100
  /**
 
101
   * Set the format combo box and line edits from the configuration.
 
102
   */
 
103
  void setFormatFromConfig();
 
104
 
 
105
  /** format editor */
 
106
  FormatListEdit* m_formatListEdit;
 
107
  /** text importer */
 
108
  TextImporter* m_textImporter;
 
109
};
 
110
 
 
111
#endif