source: calamares/trunk/fuentes/src/modules/partition/core/ColorUtils.h

Last change on this file was 7538, checked in by kbut, 14 months ago

sync with github

File size: 1.7 KB
Line 
1/* === This file is part of Calamares - <https://github.com/calamares> ===
2 *
3 *   Copyright 2014, Aurélien Gâteau <agateau@kde.org>
4 *   Copyright 2016, Teo Mrnjavac <teo@kde.org>
5 *
6 *   Calamares is free software: you can redistribute it and/or modify
7 *   it under the terms of the GNU General Public License as published by
8 *   the Free Software Foundation, either version 3 of the License, or
9 *   (at your option) any later version.
10 *
11 *   Calamares is distributed in the hope that it will be useful,
12 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 *   GNU General Public License for more details.
15 *
16 *   You should have received a copy of the GNU General Public License
17 *   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
18 */
19#ifndef COLORUTILS_H
20#define COLORUTILS_H
21
22class QColor;
23
24class Partition;
25
26/**
27 * Helper functions to define colors for partitions. It ensures no consecutive
28 * partitions have the same color.
29 */
30namespace ColorUtils
31{
32
33QColor freeSpaceColor();
34
35QColor unknownDisklabelColor();
36
37/**
38 * @brief colorForPartition iterates over partitions, caches their colors and returns
39 * a color for the given partition.
40 * @param partition the partition for which to return a color.
41 * @return a color for the partition.
42 */
43QColor colorForPartition( Partition* partition );
44
45/**
46 * This is similar to colorForPartition() but returns the color of a partition
47 * which would be created in freeSpacePartition
48 */
49QColor colorForPartitionInFreeSpace( Partition* freeSpacePartition );
50
51/**
52 * @brief invalidateCache clears the partition colors cache.
53 */
54void invalidateCache();
55
56}
57
58#endif /* COLORUTILS_H */
Note: See TracBrowser for help on using the repository browser.