2000-10-26 03:52:56 +00:00
|
|
|
/* This file is part of the KDE project
|
|
|
|
Copyright (C) 2000 David Faure <faure@kde.org>
|
2003-01-21 16:16:53 +00:00
|
|
|
Copyright (C) 2002-2003 Alexander Kellett <lypanov@kde.org>
|
2000-10-26 03:52:56 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
2007-12-16 15:37:21 +00:00
|
|
|
modify it under the terms of the GNU General Public License as
|
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
the License, or (at your option) version 3.
|
2000-10-26 03:52:56 +00:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2007-12-16 15:37:21 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2000-10-26 03:52:56 +00:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-12-16 15:37:21 +00:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>
|
2000-10-26 03:52:56 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __toplevel_h
|
|
|
|
#define __toplevel_h
|
|
|
|
|
2007-04-16 20:44:36 +00:00
|
|
|
#include <kxmlguiwindow.h>
|
2003-06-09 11:49:25 +00:00
|
|
|
#include <kbookmark.h>
|
2012-04-09 22:20:00 +00:00
|
|
|
#include <QMenu>
|
2005-10-04 20:42:32 +00:00
|
|
|
#include <kxmlguifactory.h>
|
2005-08-13 20:13:21 +00:00
|
|
|
#include "bookmarklistview.h"
|
2002-06-29 18:10:37 +00:00
|
|
|
|
2010-04-07 11:34:26 +00:00
|
|
|
class ActionsImpl;
|
2010-03-16 20:25:26 +00:00
|
|
|
class CommandHistory;
|
2007-07-06 11:26:50 +00:00
|
|
|
class KBookmarkModel;
|
2003-03-22 16:52:02 +00:00
|
|
|
class KBookmarkManager;
|
|
|
|
class KToggleAction;
|
|
|
|
class KBookmarkEditorIface;
|
2003-09-23 15:07:14 +00:00
|
|
|
class BookmarkInfoWidget;
|
2005-08-13 20:13:21 +00:00
|
|
|
class BookmarkListView;
|
2000-10-26 03:52:56 +00:00
|
|
|
|
2007-12-27 14:26:50 +00:00
|
|
|
struct SelcAbilities {
|
|
|
|
bool itemSelected:1;
|
|
|
|
bool group:1;
|
|
|
|
bool root:1;
|
|
|
|
bool separator:1;
|
|
|
|
bool urlIsEmpty:1;
|
|
|
|
bool multiSelect:1;
|
|
|
|
bool singleSelect:1;
|
|
|
|
bool notEmpty:1;
|
|
|
|
bool deleteEnabled:1;
|
|
|
|
};
|
|
|
|
|
2007-04-16 20:44:36 +00:00
|
|
|
class KEBApp : public KXmlGuiWindow {
|
2003-10-06 18:31:25 +00:00
|
|
|
Q_OBJECT
|
2007-01-16 15:10:06 +00:00
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.kde.keditbookmarks")
|
2002-01-22 19:45:45 +00:00
|
|
|
public:
|
2003-10-06 18:31:25 +00:00
|
|
|
static KEBApp* self() { return s_topLevel; }
|
2000-10-26 03:52:56 +00:00
|
|
|
|
2006-10-16 13:43:54 +00:00
|
|
|
KEBApp(const QString & bookmarksFile, bool readonly, const QString &address, bool browser, const QString &caption, const QString& dbusObjectName);
|
2003-10-06 18:31:25 +00:00
|
|
|
virtual ~KEBApp();
|
2002-03-27 00:29:04 +00:00
|
|
|
|
2005-08-13 20:13:21 +00:00
|
|
|
void reset(const QString & caption, const QString & bookmarksFileName);
|
|
|
|
|
2003-10-06 18:31:25 +00:00
|
|
|
void updateActions();
|
2007-05-16 18:52:56 +00:00
|
|
|
void updateStatus(const QString &url);
|
2007-12-27 14:26:50 +00:00
|
|
|
SelcAbilities getSelectionAbilities() const;
|
2003-10-06 18:31:25 +00:00
|
|
|
void setActionsEnabled(SelcAbilities);
|
2002-04-20 04:55:47 +00:00
|
|
|
|
2005-08-13 20:13:21 +00:00
|
|
|
QMenu* popupMenuFactory(const char *type)
|
|
|
|
{
|
|
|
|
QWidget * menu = factory()->container(type, this);
|
|
|
|
return dynamic_cast<QMenu *>(menu);
|
2003-10-06 18:31:25 +00:00
|
|
|
}
|
2000-10-26 03:52:56 +00:00
|
|
|
|
2003-10-06 18:31:25 +00:00
|
|
|
KToggleAction* getToggleAction(const char *) const;
|
2000-10-26 03:52:56 +00:00
|
|
|
|
2003-10-06 18:31:25 +00:00
|
|
|
QString caption() const { return m_caption; }
|
|
|
|
bool readonly() const { return m_readOnly; }
|
2007-04-16 20:44:36 +00:00
|
|
|
bool browser() const { return m_browser; }
|
2003-10-06 18:31:25 +00:00
|
|
|
bool nsShown() const;
|
2002-03-03 04:35:00 +00:00
|
|
|
|
2003-10-06 18:31:25 +00:00
|
|
|
BookmarkInfoWidget *bkInfo() { return m_bkinfo; }
|
2002-04-20 11:18:46 +00:00
|
|
|
|
2005-08-13 20:13:21 +00:00
|
|
|
void expandAll();
|
2007-12-16 01:47:07 +00:00
|
|
|
void collapseAll();
|
2005-08-13 20:13:21 +00:00
|
|
|
|
2007-04-16 20:44:36 +00:00
|
|
|
enum Column {
|
2005-08-13 20:13:21 +00:00
|
|
|
NameColumn = 0,
|
|
|
|
UrlColumn = 1,
|
|
|
|
CommentColumn = 2,
|
|
|
|
StatusColumn = 3
|
|
|
|
};
|
|
|
|
void startEdit( Column c );
|
|
|
|
KBookmark firstSelected() const;
|
|
|
|
QString insertAddress() const;
|
2005-10-13 19:26:56 +00:00
|
|
|
KBookmark::List selectedBookmarks() const;
|
|
|
|
KBookmark::List selectedBookmarksExpanded() const;
|
2007-12-16 01:47:07 +00:00
|
|
|
KBookmark::List allBookmarks() const;
|
2010-04-07 11:34:26 +00:00
|
|
|
|
2007-01-16 15:10:06 +00:00
|
|
|
public Q_SLOTS:
|
2010-03-16 20:56:59 +00:00
|
|
|
void notifyCommandExecuted();
|
|
|
|
|
2007-01-16 15:10:06 +00:00
|
|
|
Q_SCRIPTABLE QString bookmarkFilename();
|
|
|
|
|
2006-01-20 11:09:06 +00:00
|
|
|
public Q_SLOTS:
|
2003-10-06 18:31:25 +00:00
|
|
|
void slotConfigureToolbars();
|
2002-04-27 10:47:22 +00:00
|
|
|
|
2010-04-18 14:24:11 +00:00
|
|
|
private Q_SLOTS:
|
2003-10-06 18:31:25 +00:00
|
|
|
void slotClipboardDataChanged();
|
|
|
|
void slotNewToolbarConfig();
|
2005-08-13 20:13:21 +00:00
|
|
|
void selectionChanged();
|
2010-04-18 14:24:11 +00:00
|
|
|
void setCancelFavIconUpdatesEnabled(bool);
|
|
|
|
void setCancelTestsEnabled(bool);
|
2000-10-26 03:52:56 +00:00
|
|
|
|
2003-01-21 16:16:53 +00:00
|
|
|
private:
|
2007-07-06 10:56:44 +00:00
|
|
|
void selectedBookmarksExpandedHelper(const KBookmark& bk,
|
2007-05-26 01:57:37 +00:00
|
|
|
KBookmark::List & bookmarks) const;
|
2005-08-13 20:13:21 +00:00
|
|
|
BookmarkListView * mBookmarkListView;
|
2005-09-20 23:30:16 +00:00
|
|
|
BookmarkFolderView * mBookmarkFolderView;
|
2005-08-13 20:13:21 +00:00
|
|
|
private:
|
2003-06-15 22:46:00 +00:00
|
|
|
|
2003-10-06 18:31:25 +00:00
|
|
|
void resetActions();
|
|
|
|
void createActions();
|
2003-01-22 17:58:59 +00:00
|
|
|
|
2003-10-06 18:31:25 +00:00
|
|
|
static KEBApp *s_topLevel;
|
2003-06-15 22:46:00 +00:00
|
|
|
|
2010-04-07 11:34:26 +00:00
|
|
|
ActionsImpl* m_actionsImpl;
|
2010-03-16 20:25:26 +00:00
|
|
|
CommandHistory *m_cmdHistory;
|
2003-10-06 18:31:25 +00:00
|
|
|
QString m_bookmarksFilename;
|
|
|
|
QString m_caption;
|
2006-10-16 13:43:54 +00:00
|
|
|
QString m_dbusObjectName;
|
2002-04-14 20:06:19 +00:00
|
|
|
|
2003-10-06 18:31:25 +00:00
|
|
|
BookmarkInfoWidget *m_bkinfo;
|
2003-09-14 20:17:45 +00:00
|
|
|
|
2003-10-06 18:31:25 +00:00
|
|
|
bool m_canPaste:1;
|
|
|
|
bool m_readOnly:1;
|
|
|
|
bool m_browser:1;
|
2000-10-26 03:52:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|