KIO
kcommentwidget_p.h
Go to the documentation of this file.
00001 /***************************************************************************** 00002 * Copyright (C) 2008 by Sebastian Trueg <trueg@kde.org> * 00003 * Copyright (C) 2009 by Peter Penz <peter.penz@gmx.at> * 00004 * * 00005 * This library is free software; you can redistribute it and/or * 00006 * modify it under the terms of the GNU Library General Public * 00007 * License as published by the Free Software Foundation; either * 00008 * version 2 of the License, or (at your option) any later version. * 00009 * * 00010 * This library is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00013 * Library General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU Library General Public License * 00016 * along with this library; see the file COPYING.LIB. If not, write to * 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00018 * Boston, MA 02110-1301, USA. * 00019 *****************************************************************************/ 00020 00021 #ifndef KCOMMENT_WIDGET 00022 #define KCOMMENT_WIDGET 00023 00024 #include <QString> 00025 #include <QWidget> 00026 00027 class QLabel; 00028 00032 class KCommentWidget : public QWidget 00033 { 00034 Q_OBJECT 00035 00036 public: 00037 explicit KCommentWidget(QWidget* parent = 0); 00038 virtual ~KCommentWidget(); 00039 00040 void setText(const QString& comment); 00041 QString text() const; 00042 00047 // TODO: provide common interface class for metadatawidgets 00048 void setReadOnly(bool readOnly); 00049 bool isReadOnly() const; 00050 00051 virtual QSize sizeHint() const; 00052 00053 signals: 00054 void commentChanged(const QString& comment); 00055 00056 protected: 00057 virtual bool event(QEvent* event); 00058 00059 private slots: 00060 void slotLinkActivated(const QString& link); 00061 00062 private: 00063 bool m_readOnly; 00064 QLabel* m_label; 00065 QLabel* m_sizeHintHelper; // see comment in KCommentWidget::sizeHint() 00066 QString m_comment; 00067 }; 00068 00069 #endif
KDE 4.6 API Reference