~ubuntu-branches/ubuntu/karmic/kid3/karmic

« back to all changes in this revision

Viewing changes to kid3/exportdialog.h

  • Committer: Bazaar Package Importer
  • Author(s): Sarah Hobbs
  • Date: 2006-07-14 12:25:16 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060714122516-p2wk0iyzumu6jx42
Tags: 0.7-1ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * \file exportdialog.h
 
3
 * Export dialog.
 
4
 *
 
5
 * \b Project: Kid3
 
6
 * \author Urs Fleisch
 
7
 * \date 10 May 2006
 
8
 */
 
9
 
 
10
#ifndef EXPORTDIALOG_H
 
11
#define EXPORTDIALOG_H
 
12
 
 
13
#include <qdialog.h>
 
14
#include <qstringlist.h>
 
15
#include "importtrackdata.h"
 
16
 
 
17
class QTextEdit;
 
18
class QLineEdit;
 
19
class QPushButton;
 
20
class QComboBox;
 
21
 
 
22
/**
 
23
 * Export dialog.
 
24
 */
 
25
class ExportDialog : public QDialog {
 
26
Q_OBJECT
 
27
 
 
28
public:
 
29
        /** Export source */
 
30
        enum Source { SrcV1, SrcV2 };
 
31
 
 
32
        /**
 
33
         * Constructor.
 
34
         *
 
35
         * @param parent  parent widget
 
36
         */
 
37
        ExportDialog(QWidget* parent);
 
38
 
 
39
        /**
 
40
         * Destructor.
 
41
         */
 
42
        ~ExportDialog();
 
43
 
 
44
        /**
 
45
         * Set export format.
 
46
         *
 
47
         * @param names    export format names list
 
48
         * @param headers  export format headers
 
49
         * @param tracks   export format tracks
 
50
         * @param trailers export format trailers
 
51
         * @param idx      selected index
 
52
         */
 
53
        void setExportFormat(const QStringList& names,
 
54
                                                                                         const QStringList& headers,
 
55
                                                                                         const QStringList& tracks,
 
56
                                                                                         const QStringList& trailers,
 
57
                                                                                         int idx);
 
58
        /**
 
59
         * Get export format.
 
60
         *
 
61
         * @param name    export format name
 
62
         * @param header  export format header
 
63
         * @param track   export format track
 
64
         * @param trailer export format trailer
 
65
         *
 
66
         * @return index of current selection.
 
67
         */
 
68
        int getExportFormat(QString& name,
 
69
                                                                                        QString& header,
 
70
                                                                                        QString& track,
 
71
                                                                                        QString& trailer) const;
 
72
 
 
73
        /**
 
74
         * Set ID3v1 or ID3v2 tags as export source.
 
75
         *
 
76
         * @param v1 true to set ID3v1, false for ID3v2
 
77
         */
 
78
        void setSrcV1(bool v1);
 
79
 
 
80
        /**
 
81
         * Get export source.
 
82
         *
 
83
         * @return true if ID3v1 is source,
 
84
         *         false if ID3v2.
 
85
         */
 
86
        bool getSrcV1() const;
 
87
 
 
88
        /**
 
89
         * Set size of window.
 
90
         *
 
91
         * @param width  width
 
92
         * @param height height
 
93
         */
 
94
        void setWindowSize(int width, int height);
 
95
 
 
96
        /**
 
97
         * Get size of window.
 
98
         *
 
99
         * @param width  the width is returned here
 
100
         * @param height the height is returned here
 
101
         */
 
102
        void getWindowSize(int& width, int& height) const;
 
103
 
 
104
        /**
 
105
         * Set data to be exported.
 
106
         *
 
107
         * @param trackDataVector data to export
 
108
         */
 
109
        void setExportData(const ImportTrackDataVector& trackDataVector);
 
110
 
 
111
signals:
 
112
        /**
 
113
         * Emitted when new export data has to be provided
 
114
         * Parameter: SrcV1 for ID3v1 data, SrcV2 for ID3v2 data
 
115
         */
 
116
        void exportDataRequested(int);
 
117
 
 
118
private slots:
 
119
        /**
 
120
         * Export to a file.
 
121
         */
 
122
        void slotToFile();
 
123
 
 
124
        /**
 
125
         * Export to clipboard.
 
126
         */
 
127
        void slotToClipboard();
 
128
 
 
129
        /**
 
130
         * Set the format lineedits to the format selected in the combo box.
 
131
         *
 
132
         * @param index current index of the combo box
 
133
         */
 
134
        void setFormatLineEdit(int index);
 
135
 
 
136
        /**
 
137
         * Show exported text as preview in editor.
 
138
         */
 
139
        void showPreview();
 
140
 
 
141
        /**
 
142
         * Save the size of the window and close it.
 
143
         */
 
144
        void saveWindowSizeAndClose();
 
145
 
 
146
private:
 
147
  /** Text editor */
 
148
  QTextEdit* m_edit;
 
149
        /** cobobox with formats */
 
150
        QComboBox* m_formatComboBox;
 
151
        /** LineEdit for header */
 
152
        QLineEdit* m_headerLineEdit;
 
153
        /** LineEdit for track */
 
154
        QLineEdit* m_trackLineEdit;
 
155
        /** LineEdit for trailer */
 
156
        QLineEdit* m_trailerLineEdit;
 
157
        /** To File button */
 
158
        QPushButton* m_fileButton;
 
159
        /** To Clipboard button */
 
160
        QPushButton* m_clipButton;
 
161
        /** combobox with export sources */
 
162
        QComboBox* m_srcComboBox;
 
163
        /** header formats */
 
164
        QStringList m_formatHeaders;
 
165
        /** track formats */
 
166
        QStringList m_formatTracks;
 
167
        /** trailer formats */
 
168
        QStringList m_formatTrailers;
 
169
 
 
170
        /** data to export */
 
171
        ImportTrackDataVector m_trackDataVector;
 
172
        /** width of window */
 
173
        int m_windowWidth;
 
174
        /** height of window */
 
175
        int m_windowHeight;
 
176
};
 
177
 
 
178
#endif