Sayonara Player
Loading...
Searching...
No Matches
src
Gui
Library
Header
ColumnHeader.h
1
/* MyColumnHeader.h */
2
3
/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4
*
5
* This file is part of sayonara player
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
21
/*
22
*
23
* Created on: 19.12.2012
24
* Author: luke
25
*/
26
27
#ifndef MYCOLUMNHEADER_H_
28
#define MYCOLUMNHEADER_H_
29
30
#include "ColumnIndex.h"
31
#include "Utils/Library/Sortorder.h"
32
#include "Utils/Pimpl.h"
33
34
#include <QObject>
35
36
class
QAction;
37
namespace
Library
38
{
43
class
ColumnHeader
:
44
public
QObject
45
{
46
Q_OBJECT
47
PIMPL(
ColumnHeader
)
48
49
protected
:
50
ColumnHeader
(ColumnIndex::IntegerType columnIndex,
bool
switchable, SortOrder sortAsc, SortOrder sortDesc,
51
int
preferredWidth,
bool
isStretchable =
false
);
52
virtual
QString hashPrefix()
const
= 0;
53
54
public
:
55
virtual
~ColumnHeader
()
override
;
56
57
virtual
QString title()
const
= 0;
58
59
QString hash()
const
;
60
61
bool
isStretchable()
const
;
62
bool
isSwitchable()
const
;
63
int
defaultSize()
const
;
64
65
SortOrder sortorder(Qt::SortOrder sortOrder)
const
;
66
67
ColumnIndex::IntegerType columnIndex()
const
;
68
};
69
70
class
ColumnHeaderTrack
:
71
public
ColumnHeader
72
{
73
Q_OBJECT
74
75
public
:
76
ColumnHeaderTrack
(ColumnIndex::Track columnIndex,
bool
switchable, SortOrder sortAsc, SortOrder sortDesc,
77
int
preferredWidth,
bool
isStretchable =
false
);
78
QString title()
const override
;
79
80
protected
:
81
QString hashPrefix()
const override
;
82
};
83
84
class
ColumnHeaderAlbum
:
85
public
ColumnHeader
86
{
87
Q_OBJECT
88
89
public
:
90
ColumnHeaderAlbum
(ColumnIndex::Album columnIndex,
bool
switchable, SortOrder sortAsc, SortOrder sortDesc,
91
int
preferredWidth,
bool
isStretchable =
false
);
92
QString title()
const override
;
93
94
protected
:
95
QString hashPrefix()
const override
;
96
};
97
98
class
ColumnHeaderArtist
:
99
public
ColumnHeader
100
{
101
Q_OBJECT
102
103
public
:
104
ColumnHeaderArtist
(ColumnIndex::Artist columnIndex,
bool
switchable, SortOrder sortAsc, SortOrder sortDesc,
105
int
preferredWidth,
bool
isStretchable =
false
);
106
QString title()
const override
;
107
108
protected
:
109
QString hashPrefix()
const override
;
110
};
111
112
using
ColumnHeaderPtr = std::shared_ptr<ColumnHeader>;
113
using
ColumnHeaderList
=
QList<ColumnHeaderPtr>
;
114
}
115
116
#endif
/* MYCOLUMNHEADER_H_ */
Library::ColumnHeaderAlbum
Definition
ColumnHeader.h:86
Library::ColumnHeaderArtist
Definition
ColumnHeader.h:100
Library::ColumnHeaderTrack
Definition
ColumnHeader.h:72
Library::ColumnHeader
The ColumnHeader class.
Definition
ColumnHeader.h:45
QList
Definition
EngineUtils.h:33
Generated on Sat Jan 27 2024 00:00:00 for Sayonara Player by
1.10.0