File indexing completed on 2024-04-28 05:50:55
0001 /* 0002 SPDX-FileCopyrightText: 2007-2008 Robert Knight <robertknight@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef TABTITLEFORMATBUTTON_H 0008 #define TABTITLEFORMATBUTTON_H 0009 0010 // Qt 0011 #include <QAction> 0012 #include <QPushButton> 0013 0014 // KDE 0015 #include <KLazyLocalizedString> 0016 #include <ki18n_version.h> 0017 0018 // Konsole 0019 #include "session/Session.h" 0020 0021 namespace Konsole 0022 { 0023 class TabTitleFormatButton : public QPushButton 0024 { 0025 Q_OBJECT 0026 0027 public: 0028 explicit TabTitleFormatButton(QWidget *parent); 0029 ~TabTitleFormatButton() override; 0030 0031 void setContext(Session::TabTitleContext titleContext); 0032 Session::TabTitleContext context() const; 0033 0034 Q_SIGNALS: 0035 void dynamicElementSelected(const QString &); 0036 0037 private Q_SLOTS: 0038 void fireElementSelected(QAction *); 0039 0040 private: 0041 Session::TabTitleContext _context; 0042 0043 struct Element { 0044 QString element; 0045 KLazyLocalizedString description; 0046 }; 0047 static const Element _localElements[]; 0048 static const int _localElementCount; 0049 static const Element _remoteElements[]; 0050 static const int _remoteElementCount; 0051 }; 0052 } 0053 0054 #endif // TABTITLEFORMATBUTTON_H