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

« back to all changes in this revision

Viewing changes to src/core/model/genremodel.h

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2015-05-12 18:56:41 UTC
  • mfrom: (1.1.19) (2.3.3 sid)
  • Revision ID: package-import@ubuntu.com-20150512185641-hgeys2pingwq9mwn
Tags: 3.2.1-1
* New upstream release.
  - Add new build dependency qt4-dev-tools.
* Uploading to unstable.
* Switch to DEP5 debian/copyright format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * \file genremodel.h
 
3
 * Model with genres.
 
4
 *
 
5
 * \b Project: Kid3
 
6
 * \author Urs Fleisch
 
7
 * \date 22 Jun 2014
 
8
 *
 
9
 * Copyright (C) 2014  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 GENREMODEL_H
 
28
#define GENREMODEL_H
 
29
 
 
30
#include <QStandardItemModel>
 
31
#include "kid3api.h"
 
32
 
 
33
/**
 
34
 * Genre model.
 
35
 */
 
36
class KID3_CORE_EXPORT GenreModel : public QStandardItemModel {
 
37
  Q_OBJECT
 
38
public:
 
39
  /**
 
40
   * Constructor.
 
41
   * @param id3v1 true to create genres for ID3v1
 
42
   * @param parent parent widget
 
43
   */
 
44
  explicit GenreModel(bool id3v1, QObject* parent = 0);
 
45
 
 
46
  /**
 
47
   * Destructor.
 
48
   */
 
49
  virtual ~GenreModel();
 
50
 
 
51
  /**
 
52
   * Initialize module with genres.
 
53
   * This method is called by the constructor. It shall be called after
 
54
   * construction if genre settings are changed.
 
55
   */
 
56
  void init();
 
57
 
 
58
  /**
 
59
   * Get the row for a genre.
 
60
   * If the genre is not found, it is added at the returned row.
 
61
   * @param genreStr genre string
 
62
   * @return row number.
 
63
   */
 
64
  Q_INVOKABLE int getRowForGenre(const QString& genreStr);
 
65
 
 
66
private:
 
67
  bool m_id3v1;
 
68
};
 
69
 
 
70
#endif // GENREMODEL_H