KIO
kbookmarkmenu_p.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 project 00004 Copyright (C) 2003 Alexander Kellett <lypanov@kde.org> 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 as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef __kbookmarkmenu_p_h__ 00023 #define __kbookmarkmenu_p_h__ 00024 00025 #include <QtCore/QObject> 00026 00027 #include <kdialog.h> 00028 #include <kicon.h> 00029 #include <klocale.h> 00030 #include <kaction.h> 00031 #include <kactionmenu.h> 00032 #include <QtGui/QBoxLayout> 00033 #include <QtGui/QTreeWidget> 00034 #include <QtGui/QLabel> 00035 00036 #include "kbookmark.h" 00037 #include "kbookmarkimporter.h" 00038 #include "kbookmarkmanager.h" 00039 00040 class QString; 00041 class QPushButton; 00042 class KLineEdit; 00043 class KBookmark; 00044 class KBookmarkGroup; 00045 class KAction; 00046 class KActionMenu; 00047 class KActionCollection; 00048 class KBookmarkOwner; 00049 class KBookmarkMenu; 00050 00051 class KImportedBookmarkMenu : public KBookmarkMenu 00052 { 00053 friend class KBookmarkMenuImporter; 00054 Q_OBJECT 00055 public: 00056 //TODO simplfy 00057 KImportedBookmarkMenu( KBookmarkManager* mgr, 00058 KBookmarkOwner * owner, KMenu * parentMenu, 00059 const QString & type, const QString & location ); 00060 KImportedBookmarkMenu( KBookmarkManager* mgr, 00061 KBookmarkOwner * owner, KMenu * parentMenu); 00062 ~KImportedBookmarkMenu(); 00063 virtual void clear(); 00064 virtual void refill(); 00065 protected Q_SLOTS: 00066 void slotNSLoad(); 00067 private: 00068 QString m_type; 00069 QString m_location; 00070 }; 00071 00072 00073 class KBookmarkTreeItem : public QTreeWidgetItem 00074 { 00075 public: 00076 KBookmarkTreeItem(QTreeWidget * tree); 00077 KBookmarkTreeItem(QTreeWidgetItem * parent, QTreeWidget * tree, const KBookmarkGroup &bk); 00078 ~KBookmarkTreeItem(); 00079 QString address(); 00080 private: 00081 QString m_address; 00082 }; 00083 00084 class KBookmarkSettings 00085 { 00086 public: 00087 bool m_advancedaddbookmark; 00088 bool m_contextmenu; 00089 static KBookmarkSettings *s_self; 00090 static void readSettings(); 00091 static KBookmarkSettings *self(); 00092 }; 00093 00097 class KBookmarkMenuImporter : public QObject 00098 { 00099 Q_OBJECT 00100 public: 00101 KBookmarkMenuImporter( KBookmarkManager* mgr, KImportedBookmarkMenu * menu ) : 00102 m_menu(menu), m_pManager(mgr) {} 00103 00104 void openBookmarks( const QString &location, const QString &type ); 00105 void connectToImporter( const QObject &importer ); 00106 00107 protected Q_SLOTS: 00108 void newBookmark( const QString & text, const QString & url, const QString & ); 00109 void newFolder( const QString & text, bool, const QString & ); 00110 void newSeparator(); 00111 void endFolder(); 00112 00113 protected: 00114 QStack<KImportedBookmarkMenu*> mstack; 00115 KImportedBookmarkMenu * m_menu; 00116 KBookmarkManager* m_pManager; 00117 }; 00118 00119 class KImportedBookmarkActionMenu : public KActionMenu, public KBookmarkActionInterface 00120 { 00121 public: 00122 KImportedBookmarkActionMenu(const KIcon &icon, const QString &text, QObject *parent) 00123 : KActionMenu(icon, text, parent), 00124 KBookmarkActionInterface(KBookmark()) 00125 { 00126 } 00127 ~KImportedBookmarkActionMenu() 00128 {} 00129 }; 00130 00131 #endif
KDE 4.6 API Reference