File indexing completed on 2024-04-28 05:50:45

0001 /*
0002     This source file is part of Konsole, a terminal emulator.
0003 
0004     SPDX-FileCopyrightText: 2007-2008 Robert Knight <robertknight@gmail.com>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef PROFILEWRITER_H
0010 #define PROFILEWRITER_H
0011 
0012 #include "Profile.h"
0013 
0014 class KConfig;
0015 
0016 namespace Konsole
0017 {
0018 /** Interface for all classes which can write profile settings to a file. */
0019 class KONSOLEPRIVATE_EXPORT ProfileWriter
0020 {
0021 public:
0022     ProfileWriter();
0023     ~ProfileWriter();
0024 
0025     /**
0026      * Returns a suitable path-name for writing
0027      * @p profile to. The path-name should be accepted by
0028      * the corresponding ProfileReader class.
0029      */
0030     QString getPath(const Profile::Ptr &profile);
0031     /**
0032      * Writes the properties and values from @p profile to the file specified
0033      * by @p path.  This profile should be readable by the corresponding
0034      * ProfileReader class.
0035      */
0036     bool writeProfile(const QString &path, const Profile::Ptr &profile);
0037 
0038 private:
0039     void writeProperties(KConfig &config, const Profile::Ptr &profile);
0040 };
0041 }
0042 
0043 #endif // PROFILEWRITER_H