| 1 |
/* ============================================================ |
| 2 |
* |
| 3 |
* This file is a part of digiKam project |
| 4 |
* https://www.digikam.org |
| 5 |
* |
| 6 |
* Date : 2004-09-07 |
| 7 |
* Description : thumbnails size interface |
| 8 |
* |
| 9 |
* SPDX-FileCopyrightText: 2004 by Renchi Raju <renchi dot raju at gmail dot com> |
| 10 |
* SPDX-FileCopyrightText: 2005-2026 by Gilles Caulier <caulier dot gilles at gmail dot com> |
| 11 |
* |
| 12 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 13 |
* |
| 14 |
* ============================================================ */ |
| 15 |
|
| 16 |
#pragma once |
| 17 |
|
| 18 |
// Qt includes |
| 19 |
|
| 20 |
#include <QString> |
| 21 |
|
| 22 |
// Local includes |
| 23 |
|
| 24 |
#include "digikam_export.h" |
| 25 |
|
| 26 |
class KConfigGroup; |
| 27 |
|
| 28 |
namespace Digikam |
| 29 |
{ |
| 30 |
|
| 31 |
class DIGIKAM_EXPORT ThumbnailSize |
| 32 |
{ |
| 33 |
|
| 34 |
public: |
| 35 |
|
| 36 |
enum Size |
| 37 |
{ |
| 38 |
Step = 8, |
| 39 |
Tiny = 32, |
| 40 |
VerySmall = 64, |
| 41 |
MediumSmall = 80, |
| 42 |
/** |
| 43 |
* Most usable small size of thumbnails to prevent overloaded |
| 44 |
* overlays show under thumbs (as Pick label and Group indicator) |
| 45 |
* See bugs #321337 and #275381 for details. |
| 46 |
*/ |
| 47 |
Small = 100, |
| 48 |
Medium = 142, |
| 49 |
Large = 160, |
| 50 |
Huge = 256, |
| 51 |
HD = 512, |
| 52 |
MAX = 1024 |
| 53 |
}; |
| 54 |
|
| 55 |
public: |
| 56 |
|
| 57 |
ThumbnailSize() = default; |
| 58 |
explicit ThumbnailSize(int size); |
| 59 |
ThumbnailSize(const ThumbnailSize& thumbsize); |
| 60 |
|
| 61 |
~ThumbnailSize() = default; |
| 62 |
|
| 63 |
ThumbnailSize& operator=(const ThumbnailSize& thumbsize); |
| 64 |
bool operator==(const ThumbnailSize& thumbsize) const; |
| 65 |
bool operator!=(const ThumbnailSize& thumbsize) const; |
| 66 |
|
| 67 |
int size() const; |
| 68 |
|
| 69 |
public: |
| 70 |
|
| 71 |
static void setUseLargeThumbs(bool val); |
| 72 |
static bool getUseLargeThumbs(); |
| 73 |
static void readSettings(const KConfigGroup& group); |
| 74 |
static void saveSettings(KConfigGroup& group, bool val); |
| 75 |
static int maxThumbsSize(); |
| 76 |
|
| 77 |
private: |
| 78 |
|
| 79 |
int m_Size = Medium; |
| 80 |
}; |
| 81 |
|
| 82 |
} // namespace Digikam |