File indexing completed on 2025-04-27 06:57:53
0001 // Copyright (c) 2002-2004 Rob Kaper <cap@capsi.com> 0002 // Copyright (c) 2015 Pino Toscano <pino@kde.org> 0003 // 0004 // This program is free software; you can redistribute it and/or 0005 // modify it under the terms of the GNU General Public License 0006 // version 2 as published by the Free Software Foundation. 0007 // 0008 // This program is distributed in the hope that it will be useful, 0009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 0010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0011 // General Public License for more details. 0012 // 0013 // You should have received a copy of the GNU General Public License 0014 // along with this program; see the file COPYING. If not, write to 0015 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0016 // Boston, MA 02110-1301, USA. 0017 0018 #ifndef ATLANTIK_CUSTOMLOCATIONICONBUTTON_H 0019 #define ATLANTIK_CUSTOMLOCATIONICONBUTTON_H 0020 0021 #include <QPushButton> 0022 0023 #include <tokentheme.h> 0024 0025 class CustomLocationIconButton : public QPushButton 0026 { 0027 Q_OBJECT 0028 0029 Q_PROPERTY(QString image READ image WRITE setImage NOTIFY imageChanged) 0030 0031 public: 0032 CustomLocationIconButton(QWidget *parent = nullptr); 0033 ~CustomLocationIconButton(); 0034 0035 void setTokenTheme(const TokenTheme &theme); 0036 0037 void setImage(const QString &image); 0038 QString image() const; 0039 0040 Q_SIGNALS: 0041 void imageChanged(const QString &image); 0042 0043 private Q_SLOTS: 0044 void slotChooseImage(); 0045 0046 private: 0047 bool checkValid() const; 0048 0049 TokenTheme m_tokenTheme; 0050 QString m_image; 0051 }; 0052 0053 #endif