File indexing completed on 2024-04-28 04:49:22

0001 /*
0002     SPDX-FileCopyrightText: 2005-2009 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef _K3B_GLOBAL_SETTINGS_H_
0009 #define _K3B_GLOBAL_SETTINGS_H_
0010 
0011 #include "k3b_export.h"
0012 
0013 #include <QString>
0014 
0015 class KConfigGroup;
0016 
0017 namespace K3b {
0018     /**
0019      * Some global settings used throughout K3b.
0020      */
0021     class LIBK3B_EXPORT GlobalSettings
0022     {
0023     public:
0024         GlobalSettings();
0025         ~GlobalSettings();
0026 
0027         /**
0028          * This method takes care of settings the config group
0029          */
0030         void readSettings( const KConfigGroup& );
0031 
0032         /**
0033          * This method takes care of settings the config group
0034          */
0035         void saveSettings( KConfigGroup );
0036 
0037         bool ejectMedia() const { return m_eject; }
0038         bool burnfree() const { return m_burnfree; }
0039         bool overburn() const { return m_overburn; }
0040         bool useManualBufferSize() const { return m_useManualBufferSize; }
0041         int bufferSize() const { return m_bufferSize; }
0042 
0043         /**
0044          * If force is set to true K3b will continue in certain "unsafe" situations.
0045          * The most common being a medium not suitable for the writer in terms of
0046          * writing speed.
0047          * Compare cdrecord's parameter -force and -ignsize
0048          */
0049         bool force() const { return m_force; }
0050 
0051         /**
0052          * get the default K3b temp path to store image files
0053          */
0054         QString defaultTempPath() const { return m_defaultTempPath; }
0055 
0056         void setEjectMedia( bool b ) { m_eject = b; }
0057         void setBurnfree( bool b ) { m_burnfree = b; }
0058         void setOverburn( bool b ) { m_overburn = b; }
0059         void setUseManualBufferSize( bool b ) { m_useManualBufferSize = b; }
0060         void setBufferSize( int size ) { m_bufferSize = size; }
0061         void setForce( bool b ) { m_force = b; }
0062         void setDefaultTempPath( const QString& s ) { m_defaultTempPath = s; }
0063 
0064     private:
0065         // FIXME: d-pointer
0066         bool m_eject;
0067         bool m_burnfree;
0068         bool m_overburn;
0069         bool m_useManualBufferSize;
0070         int m_bufferSize;
0071         bool m_force;
0072         QString m_defaultTempPath;
0073     };
0074 }
0075 
0076 #endif