File indexing completed on 2024-05-05 05:28:59

0001 //////////////////////////////////////////////////////////////////////////////
0002 // breezeexceptionlist.h
0003 // window decoration exceptions
0004 // -------------------
0005 //
0006 // SPDX-FileCopyrightText: 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0007 //
0008 // SPDX-License-Identifier: MIT
0009 //////////////////////////////////////////////////////////////////////////////
0010 
0011 #pragma once
0012 
0013 #include "breeze.h"
0014 #include "breezesettings.h"
0015 
0016 #include <KSharedConfig>
0017 
0018 namespace Breeze
0019 {
0020 //! breeze exceptions list
0021 class ExceptionList
0022 {
0023 public:
0024     //! constructor from list
0025     explicit ExceptionList(const InternalSettingsList &exceptions = InternalSettingsList())
0026         : _exceptions(exceptions)
0027     {
0028     }
0029 
0030     //! exceptions
0031     const InternalSettingsList &get(void) const
0032     {
0033         return _exceptions;
0034     }
0035 
0036     //! read from KConfig
0037     void readConfig(KSharedConfig::Ptr);
0038 
0039     //! write to kconfig
0040     void writeConfig(KSharedConfig::Ptr);
0041 
0042 protected:
0043     //! generate exception group name for given exception index
0044     static QString exceptionGroupName(int index);
0045 
0046     //! read configuration
0047     static void readConfig(KCoreConfigSkeleton *, KConfig *, const QString &);
0048 
0049     //! write configuration
0050     static void writeConfig(KCoreConfigSkeleton *, KConfig *, const QString &);
0051 
0052 private:
0053     //! exceptions
0054     InternalSettingsList _exceptions;
0055 };
0056 
0057 }