kio Library API Documentation

kbookmarkmenu_p.h

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., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 00020 */ 00021 00022 #ifndef __kbookmarkmenu_p_h__ 00023 #define __kbookmarkmenu_p_h__ 00024 00025 #include <sys/types.h> 00026 00027 #include <qptrlist.h> 00028 #include <qptrstack.h> 00029 #include <qobject.h> 00030 #include <qlistview.h> 00031 00032 #include <kdialogbase.h> 00033 #include <klocale.h> 00034 #include <kaction.h> 00035 00036 #include "kbookmark.h" 00037 #include "kbookmarkimporter.h" 00038 #include "kbookmarkmanager.h" 00039 00040 class QString; 00041 class QPopupMenu; 00042 class QPushButton; 00043 class QListView; 00044 class KLineEdit; 00045 class KBookmark; 00046 class KBookmarkGroup; 00047 class KAction; 00048 class KActionMenu; 00049 class KActionCollection; 00050 class KBookmarkOwner; 00051 class KBookmarkMenu; 00052 class KBookmarkBar; 00053 class KPopupMenu; 00054 00055 class KImportedBookmarksActionMenu : public KActionMenu { 00056 Q_OBJECT 00057 Q_PROPERTY( QString type READ type WRITE setType ) 00058 Q_PROPERTY( QString location READ location WRITE setLocation ) 00059 public: 00060 const QString type() const { return m_type; } 00061 void setType(const QString &type) { m_type = type; } 00062 const QString location() const { return m_location; } 00063 void setLocation(const QString &location) { m_location = location; } 00064 private: 00065 QString m_type; 00066 QString m_location; 00067 public: 00068 KImportedBookmarksActionMenu( 00069 const QString &text, const QString& sIconName, 00070 KActionCollection* parent, const char* name) 00071 : KActionMenu(text, sIconName, parent, name) { 00072 ; 00073 } 00074 }; 00075 00076 class KBookmarkActionMenu : public KActionMenu { 00077 Q_OBJECT 00078 Q_PROPERTY( QString url READ url WRITE setUrl ) 00079 Q_PROPERTY( QString address READ address WRITE setAddress ) 00080 Q_PROPERTY( bool readOnly READ readOnly WRITE setReadOnly ) 00081 public: 00082 const QString url() const { return m_url; } 00083 void setUrl(const QString &url) { m_url = url; } 00084 const QString address() const { return m_address; } 00085 void setAddress(const QString &address) { m_address = address; } 00086 bool readOnly() const { return m_readOnly; } 00087 void setReadOnly(bool readOnly) { m_readOnly = readOnly; } 00088 private: 00089 QString m_url; 00090 QString m_address; 00091 bool m_readOnly; 00092 public: 00093 KBookmarkActionMenu( 00094 const QString &text, const QString& sIconName, 00095 KActionCollection* parent, const char* name) 00096 : KActionMenu(text, sIconName, parent, name) { 00097 ; 00098 } 00099 }; 00100 00101 class KBookmarkAction : public KAction { 00102 Q_OBJECT 00103 Q_PROPERTY( QString url READ url WRITE setUrl ) 00104 Q_PROPERTY( QString address READ address WRITE setAddress ) 00105 public: 00106 const QString url() const { return m_url; } 00107 void setUrl(const QString &url) { m_url = url; } 00108 const QString address() const { return m_address; } 00109 void setAddress(const QString &address) { m_address = address; } 00110 private: 00111 QString m_url; 00112 QString m_address; 00113 public: 00114 KBookmarkAction( 00115 const QString& text, const QString& sIconName, const KShortcut& cut, 00116 const QObject* receiver, const char* slot, 00117 KActionCollection* parent, const char* name) 00118 : KAction(text, sIconName, cut, receiver, slot, parent, name) { 00119 ; 00120 } 00121 }; 00122 00123 class KBookmarkEditFields { 00124 public: 00125 typedef enum { FolderFieldsSet, BookmarkFieldsSet } FieldsSet; 00126 KLineEdit * m_url; 00127 KLineEdit * m_title; 00128 KBookmarkEditFields(QWidget *main, QBoxLayout *vbox, FieldsSet isFolder); 00129 void setName(const QString &str); 00130 void setLocation(const QString &str); 00131 }; 00132 00133 class KBookmarkEditDialog : public KDialogBase 00134 { 00135 Q_OBJECT 00136 00137 public: 00138 typedef enum { ModifyMode, InsertionMode } BookmarkEditType; 00139 00140 KBookmarkEditDialog( const QString& title, const QString& url, KBookmarkManager *, BookmarkEditType editType, const QString& address = QString::null, 00141 QWidget * = 0, const char * = 0, const QString& caption = i18n( "Add Bookmark" ) ); 00142 00143 QString finalUrl() const; 00144 QString finalTitle() const; 00145 QString finalAddress() const; 00146 00147 protected slots: 00148 void slotOk(); 00149 void slotCancel(); 00150 void slotUser1(); 00151 void slotDoubleClicked(QListViewItem* item); 00152 00153 private: 00154 QWidget * m_main; 00155 KBookmarkEditFields * m_fields; 00156 QListView * m_folderTree; 00157 QPushButton * m_button; 00158 KBookmarkManager * m_mgr; 00159 BookmarkEditType m_editType; 00160 QString m_address; 00161 }; 00162 00163 class KBookmarkFolderTreeItem : public QListViewItem 00164 { 00165 // make this an accessor 00166 friend class KBookmarkFolderTree; 00167 public: 00168 KBookmarkFolderTreeItem( QListView *, const KBookmark & ); 00169 KBookmarkFolderTreeItem( KBookmarkFolderTreeItem *, QListViewItem *, const KBookmarkGroup & ); 00170 private: 00171 KBookmark m_bookmark; 00172 }; 00173 00174 class KBookmarkFolderTree 00175 { 00176 public: 00177 static QListView* createTree( KBookmarkManager *, QWidget * = 0, const char * = 0, const QString& = QString::null ); 00178 static void fillTree( QListView*, KBookmarkManager *, const QString& = QString::null ); 00179 static QString selectedAddress( QListView* ); 00180 static void setAddress( QListView *, const QString & ); 00181 }; 00182 00183 class KBookmarkSettings 00184 { 00185 public: 00186 bool m_advancedaddbookmark; 00187 bool m_contextmenu; 00188 bool m_quickactions; 00189 bool m_filteredtoolbar; 00190 static KBookmarkSettings *s_self; 00191 static void readSettings(); 00192 static KBookmarkSettings *self(); 00193 }; 00194 00195 class RMB 00196 { 00197 public: 00198 static void begin_rmb_action(KBookmarkMenu *); 00199 static void begin_rmb_action(KBookmarkBar *); 00200 bool invalid( int val ); 00201 KBookmark atAddress(const QString & address); 00202 void fillContextMenu( QPopupMenu* contextMenu, const QString & address, int val ); 00203 void fillContextMenu2( QPopupMenu* contextMenu, const QString & address, int val ); 00204 void slotRMBActionEditAt( int val ); 00205 void slotRMBActionProperties( int val ); 00206 void slotRMBActionInsert( int val ); 00207 void slotRMBActionRemove( int val ); 00208 void slotRMBActionCopyLocation( int val ); 00209 void hidePopup(); 00210 public: 00211 QObject *recv; 00212 KBookmarkManager *m_pManager; 00213 QString s_highlightedAddress; 00214 QString m_parentAddress; 00215 KBookmarkOwner *m_pOwner; 00216 QWidget *m_parentMenu; 00217 }; 00218 00219 #endif
KDE Logo
This file is part of the documentation for kio Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 10 18:55:26 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003