diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -64,6 +64,7 @@ ScriptableExtension SelectorInterface StatusBarExtension + TerminalProfileInterface TextExtension WindowArgs REQUIRED_HEADERS KParts_HEADERS diff --git a/src/terminalprofileinterface.h b/src/terminalprofileinterface.h new file mode 100644 --- /dev/null +++ b/src/terminalprofileinterface.h @@ -0,0 +1,53 @@ +// Copyright (C) 2019 Maximilian Schiller + +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. + +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +// 02110-1301 USA + +#ifndef KPARTS_TERMINALPROFILEINTERFACE_H +#define KPARTS_TERMINALPROFILEINTERFACE_H + +#include + +class QStringList; + +class TerminalProfileInterface { +public: + virtual ~TerminalProfileInterface() = default; + + /** + * Returns the names of available profiles. + */ + virtual QStringList availableProfiles() const = 0; + + /** + * Returns the name of the currently active profile. + */ + virtual QString currentProfileName() const = 0; + + /** + * Changes the currently active profile to @p profileName. + * @returns Returns true if setting the profile was successful + */ + virtual bool setCurrentProfile(const QString &profileName) = 0; + + /** + * Returns the property @p profileProperty of the currently active profile. + */ + virtual QVariant profileProperty(const QString &profileProperty) const = 0; +}; + +Q_DECLARE_INTERFACE(TerminalProfileInterface, "org.kde.TerminalProfileInterface") + +#endif