koprefsdialogcolorsandfonts.h 1.42 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1 2 3
/*
  This file is part of KOrganizer.

4 5
  SPDX-FileCopyrightText: 2000, 2001, 2002, 2003 Cornelius Schumacher <schumacher@kde.org>
  SPDX-FileCopyrightText: 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
Laurent Montel's avatar
Laurent Montel committed
6

7
  SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
Laurent Montel's avatar
Laurent Montel committed
8 9 10 11 12
*/

#ifndef KOPREFSDIALOGCOLORSANDFONTS_H
#define KOPREFSDIALOGCOLORSANDFONTS_H
#include "kcm_korganizer_export.h"
Laurent Montel's avatar
Laurent Montel committed
13
#include "kprefsdialog.h"
Laurent Montel's avatar
Laurent Montel committed
14 15 16 17 18 19 20 21
#include <QWidget>

class QComboBox;
class KColorButton;
namespace Akonadi {
class CollectionComboBox;
}

Laurent Montel's avatar
Laurent Montel committed
22
class KOPrefsDialogColorsAndFonts : public Korganizer::KPrefsModule
Laurent Montel's avatar
Laurent Montel committed
23 24 25
{
    Q_OBJECT
public:
Laurent Montel's avatar
Laurent Montel committed
26
    KOPrefsDialogColorsAndFonts(QWidget *parent);
Laurent Montel's avatar
Laurent Montel committed
27

Laurent Montel's avatar
Laurent Montel committed
28 29 30
protected:
    void usrWriteConfig() override;
    void usrReadConfig() override;
Laurent Montel's avatar
Laurent Montel committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

private Q_SLOTS:
    void useSystemColorToggle(bool useSystemColor);

protected Q_SLOTS:
    void updateCategories();
    void setCategoryColor();
    void updateCategoryColor();

    void updateResources();
    void setResourceColor();
    void updateResourceColor();

private:
    QComboBox *mCategoryCombo = nullptr;
    KColorButton *mCategoryButton = nullptr;
    QHash<QString, QColor> mCategoryDict;

    Akonadi::CollectionComboBox *mResourceCombo = nullptr;
    KColorButton *mResourceButton = nullptr;
    QHash<QString, QColor> mResourceDict;
    QList<KColorButton *> mButtonsDisable; // button that are disabled when using system color
};

#endif // KOPREFSDIALOGCOLORSANDFONTS_H