Warning, file /libraries/baloo-widgets/src/widgetfactory.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 SPDX-FileCopyrightText: 2012 Vishesh Handa <me@vhanda.in> 0003 0004 SPDX-License-Identifier: LGPL-2.1-or-later 0005 */ 0006 0007 #ifndef WIDGETFACTORY_H 0008 #define WIDGETFACTORY_H 0009 0010 #include "filemetadatawidget.h" 0011 0012 #include <QObject> 0013 #include <QStringList> 0014 0015 class KJob; 0016 class QLabel; 0017 class QUrl; 0018 class KCommentWidget; 0019 class KRatingWidget; 0020 0021 namespace Baloo 0022 { 0023 class Tag; 0024 class TagWidget; 0025 0026 class WidgetFactory : public QObject 0027 { 0028 Q_OBJECT 0029 public: 0030 explicit WidgetFactory(QObject *parent = nullptr); 0031 ~WidgetFactory() override; 0032 0033 void setItems(const KFileItemList &items); 0034 0035 void setReadOnly(bool value); 0036 0037 void setDateFormat(const DateFormats format); 0038 DateFormats dateFormat() const; 0039 0040 QWidget *createWidget(const QString &prop, const QVariant &value, QWidget *parent); 0041 0042 Q_SIGNALS: 0043 void urlActivated(const QUrl &url); 0044 void dataChangeStarted(); 0045 void dataChangeFinished(); 0046 0047 private Q_SLOTS: 0048 void slotTagsChanged(const QStringList &tags); 0049 void slotCommentChanged(const QString &comment); 0050 void slotRatingChanged(int rating); 0051 0052 void slotTagClicked(const QString &tag); 0053 void slotLinkActivated(const QString &url); 0054 0055 private: 0056 QWidget *createRatingWidget(int rating, QWidget *parent); 0057 QWidget *createTagWidget(const QStringList &tags, QWidget *parent); 0058 QWidget *createCommentWidget(const QString &comment, QWidget *parent); 0059 QLabel *createValueWidget(QWidget *parent); 0060 0061 TagWidget *m_tagWidget = nullptr; 0062 KRatingWidget *m_ratingWidget = nullptr; 0063 KCommentWidget *m_commentWidget = nullptr; 0064 0065 KFileItemList m_items; 0066 QStringList m_prevTags; 0067 bool m_readOnly = false; 0068 QLocale::FormatType m_dateFormat; 0069 }; 0070 } 0071 0072 #endif // WIDGETFACTORY_H