1 /**
2  * \file filenameformatbox.h
3  * Group box containing filename format options.
4  *
5  * \b Project: Kid3
6  * \author Urs Fleisch
7  * \date 12 Nov 2017
8  *
9  * Copyright (C) 2017-2018  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 #pragma once
28 
29 #include "formatbox.h"
30 
31 class QSpinBox;
32 
33 /**
34  * Group box containing filename format options.
35  */
36 class FilenameFormatBox : public FormatBox {
37   Q_OBJECT
38 public:
39   /**
40    * Constructor.
41    *
42    * @param title  title
43    * @param parent parent widget
44    */
45   explicit FilenameFormatBox(const QString& title, QWidget* parent = nullptr);
46 
47   /**
48    * Destructor.
49    */
50   virtual ~FilenameFormatBox() override = default;
51 
52   /**
53    * Set the values from a format configuration.
54    *
55    * @param cfg format configuration
56    */
57   virtual void fromFormatConfig(const FormatConfig& cfg) override;
58 
59   /**
60    * Store the values in a format configuration.
61    *
62    * @param cfg format configuration
63    */
64   virtual void toFormatConfig(FormatConfig& cfg) const override;
65 
66 private:
67   QCheckBox* m_maximumLengthCheckBox;
68   QSpinBox* m_maximumLengthSpinBox;
69 };
70