Sayonara Player
Toggle main menu visibility
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, VariableSortorder sortAsc,
51
VariableSortorder sortDesc,
52
int
preferredWidth,
bool
isStretchable =
false
);
53
virtual
QString hashPrefix()
const
= 0;
54
55
public
:
56
virtual
~ColumnHeader()
override
;
57
58
virtual
QString title()
const
= 0;
59
60
QString hash()
const
;
61
62
bool
isStretchable()
const
;
63
bool
isSwitchable()
const
;
64
int
defaultSize()
const
;
65
66
[[nodiscard]] VariableSortorder sortorder(Qt::SortOrder sortOrder)
const
;
67
68
ColumnIndex::IntegerType columnIndex()
const
;
69
};
70
71
class
ColumnHeaderTrack :
72
public
ColumnHeader
73
{
74
Q_OBJECT
75
76
public
:
77
ColumnHeaderTrack(ColumnIndex::Track columnIndex,
bool
switchable, TrackSortorder sortAsc,
78
TrackSortorder sortDesc,
79
int
preferredWidth,
bool
isStretchable =
false
);
80
QString title()
const override
;
81
82
protected
:
83
QString hashPrefix()
const override
;
84
};
85
86
class
ColumnHeaderAlbum :
87
public
ColumnHeader
88
{
89
Q_OBJECT
90
91
public
:
92
ColumnHeaderAlbum(ColumnIndex::Album columnIndex,
bool
switchable, AlbumSortorder sortAsc,
93
AlbumSortorder sortDesc,
94
int
preferredWidth,
bool
isStretchable =
false
);
95
QString title()
const override
;
96
97
protected
:
98
QString hashPrefix()
const override
;
99
};
100
101
class
ColumnHeaderArtist :
102
public
ColumnHeader
103
{
104
Q_OBJECT
105
106
public
:
107
ColumnHeaderArtist(ColumnIndex::Artist columnIndex,
bool
switchable, ArtistSortorder sortAsc,
108
ArtistSortorder sortDesc,
109
int
preferredWidth,
bool
isStretchable =
false
);
110
QString title()
const override
;
111
112
protected
:
113
QString hashPrefix()
const override
;
114
};
115
116
using
ColumnHeaderPtr = std::shared_ptr<ColumnHeader>;
117
using
ColumnHeaderList =
QList<ColumnHeaderPtr>
;
118
}
119
120
#endif
/* MYCOLUMNHEADER_H_ */
QList
Definition
EngineUtils.h:33
Generated on
for Sayonara Player by
1.17.0