KIO
kbookmarkdialog.h
Go to the documentation of this file.
00001 // -*- c-basic-offset:4; indent-tabs-mode:nil -*- 00002 // vim: set ts=4 sts=4 sw=4 et: 00003 /* This file is part of the KDE libraries 00004 Copyright 2007 Daniel Teske <teske@squorn.de> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License version 2 as published by the Free Software Foundation. 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 #ifndef __kbookmarkdialog_h 00021 #define __kbookmarkdialog_h 00022 00023 #include "kbookmark.h" 00024 #include <kdialog.h> 00025 #include <kurl.h> 00026 00027 class KBookmarkManager; 00028 class QWidget; 00029 class QLabel; 00030 class QTreeWidget; 00031 class KLineEdit; 00032 class QTreeWidgetItem; 00033 class QGridLayout; 00034 00044 class KIO_EXPORT KBookmarkDialog : public KDialog 00045 { 00046 Q_OBJECT 00047 00048 public: 00052 KBookmarkDialog( KBookmarkManager *, QWidget * = 0); 00057 KBookmark editBookmark(const KBookmark & bm); 00062 KBookmark addBookmark(const QString & title, const KUrl & url, KBookmark parent = KBookmark()); 00067 KBookmarkGroup addBookmarks(const QList< QPair<QString, QString> > & list, const QString & name = QString(), KBookmarkGroup parent = KBookmarkGroup()); 00071 KBookmarkGroup createNewFolder(const QString & name, KBookmark parent = KBookmark()); 00075 KBookmarkGroup selectFolder(KBookmark start = KBookmark()); 00076 00077 protected: 00078 typedef enum { NewFolder, NewBookmark, EditBookmark, NewMultipleBookmarks, SelectFolder } BookmarkDialogMode; 00085 virtual void initLayout(); 00091 virtual void aboutToShow(BookmarkDialogMode mode); 00097 virtual void save(BookmarkDialogMode mode, const KBookmark &); 00098 00102 void setParentBookmark(const KBookmark & bm); 00107 KBookmarkGroup parentBookmark(); 00108 00109 00110 void slotButtonClicked(int); 00111 00112 // TODO KDE5: move all these variables to a d pointer; make as many methods private as possible. 00113 BookmarkDialogMode m_mode; 00114 void fillGroup( QTreeWidgetItem * parentItem, const KBookmarkGroup &group); 00115 QWidget * m_main; 00116 KLineEdit * m_url; 00117 KLineEdit * m_title; 00118 KLineEdit * m_comment; 00119 QLabel * m_titleLabel; 00120 QLabel * m_urlLabel; 00121 QLabel * m_commentLabel; 00122 QTreeWidget * m_folderTree; 00123 KBookmarkManager * m_mgr; 00124 KBookmark m_bm; 00125 QList<QPair<QString, QString> > m_list; 00126 bool m_layout; 00127 // WARNING: do not add new member variables here; replace one of the pointers with a d pointer, 00128 // assuming that variable isn't used anywhere in apps... 00129 00130 void initLayoutPrivate(); 00131 00132 protected Q_SLOTS: 00133 void newFolderButton(); 00134 }; 00135 00136 #endif 00137
KDE 4.6 API Reference