File indexing completed on 2024-04-28 09:45:42

0001 // vim: set ts=4 sts=4 sw=4 et:
0002 /* This file is part of the KDE project
0003    Copyright (C) 2000 David Faure <faure@kde.org>
0004    Copyright (C) 2002-2003 Alexander Kellett <lypanov@kde.org>
0005 
0006    This program is free software; you can redistribute it and/or
0007    modify it under the terms of the GNU General Public License as
0008    published by the Free Software Foundation; either version 2 of
0009    the License, or (at your option) version 3.
0010 
0011    This program is distributed in the hope that it will be useful,
0012    but WITHOUT ANY WARRANTY; without even the implied warranty of
0013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014    GNU General Public License for more details.
0015 
0016    You should have received a copy of the GNU General Public License
0017    along with this program.  If not, see <http://www.gnu.org/licenses/>
0018 */
0019 
0020 #ifndef BOOKMARKINFOWIDGET_H
0021 #define BOOKMARKINFOWIDGET_H
0022 
0023 #include <KBookmark>
0024 #include <QWidget>
0025 
0026 class KBookmarkModel;
0027 class BookmarkListView;
0028 class EditCommand;
0029 
0030 class KLineEdit;
0031 
0032 class QTimer;
0033 
0034 class BookmarkInfoWidget : public QWidget
0035 {
0036     Q_OBJECT
0037 public:
0038     explicit BookmarkInfoWidget(BookmarkListView *lv, KBookmarkModel *model, QWidget * = nullptr);
0039 
0040     KBookmark bookmark()
0041     {
0042         return m_bk;
0043     }
0044 
0045 public Q_SLOTS:
0046     void slotTextChangedURL(const QString &);
0047     void slotTextChangedTitle(const QString &);
0048     void slotTextChangedComment(const QString &);
0049 
0050     void slotUpdate();
0051 
0052     void commitChanges();
0053     void commitTitle();
0054     void commitURL();
0055     void commitComment();
0056 
0057 private:
0058     void updateStatus();
0059     void showBookmark(const KBookmark &bk);
0060 
0061     EditCommand *titlecmd, *urlcmd, *commentcmd;
0062     QTimer *timer;
0063     KLineEdit *m_title_le, *m_url_le, *m_comment_le;
0064     KLineEdit *m_visitdate_le, *m_credate_le, *m_visitcount_le;
0065     KBookmark m_bk;
0066     KBookmarkModel *m_model;
0067     BookmarkListView *mBookmarkListView;
0068 };
0069 
0070 #endif