2003-10-06 18:31:25 +00:00
|
|
|
// vim: set ts=4 sts=4 sw=4 et:
|
2003-01-21 16:16:53 +00:00
|
|
|
/* This file is part of the KDE project
|
|
|
|
Copyright (C) 2002-2003 Alexander Kellett <lypanov@kde.org>
|
|
|
|
|
|
|
|
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.
|
2003-01-21 16:16:53 +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.
|
2003-01-21 16:16:53 +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/>
|
2003-01-21 16:16:53 +00:00
|
|
|
*/
|
|
|
|
|
2003-02-16 00:38:34 +00:00
|
|
|
#ifndef __bookmarkiterator_h
|
|
|
|
#define __bookmarkiterator_h
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2007-05-09 22:23:52 +00:00
|
|
|
#include <QtCore/QObject>
|
|
|
|
#include <QtCore/QList>
|
2003-01-21 16:16:53 +00:00
|
|
|
#include <kbookmark.h>
|
|
|
|
|
|
|
|
class BookmarkIteratorHolder;
|
|
|
|
|
|
|
|
class BookmarkIterator : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2005-09-28 16:16:52 +00:00
|
|
|
BookmarkIterator(QList<KBookmark> bks);
|
2003-01-21 16:16:53 +00:00
|
|
|
virtual ~BookmarkIterator();
|
2003-03-08 13:22:06 +00:00
|
|
|
virtual BookmarkIteratorHolder* holder() const = 0;
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2006-01-20 11:09:06 +00:00
|
|
|
public Q_SLOTS:
|
2003-01-21 16:16:53 +00:00
|
|
|
void nextOne();
|
|
|
|
void delayedEmitNextOne();
|
|
|
|
void slotCancelTest(BookmarkIterator *t);
|
|
|
|
|
2006-01-20 11:09:06 +00:00
|
|
|
Q_SIGNALS:
|
2003-01-21 16:16:53 +00:00
|
|
|
void deleteSelf(BookmarkIterator *);
|
|
|
|
|
|
|
|
protected:
|
2003-03-03 20:52:39 +00:00
|
|
|
virtual void doAction() = 0;
|
2003-03-08 13:22:06 +00:00
|
|
|
virtual bool isApplicable(const KBookmark &bk) const = 0;
|
2003-03-08 15:26:42 +00:00
|
|
|
const KBookmark curBk() const;
|
2003-01-21 16:16:53 +00:00
|
|
|
|
2003-03-08 15:26:42 +00:00
|
|
|
private:
|
|
|
|
KBookmark m_bk;
|
2005-09-28 16:16:52 +00:00
|
|
|
QList<KBookmark> m_bklist;
|
2003-01-21 16:16:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class BookmarkIteratorHolder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void cancelAllItrs();
|
|
|
|
void removeItr(BookmarkIterator*);
|
|
|
|
void insertItr(BookmarkIterator*);
|
|
|
|
protected:
|
|
|
|
BookmarkIteratorHolder();
|
2007-03-20 12:03:12 +00:00
|
|
|
virtual ~BookmarkIteratorHolder() {}
|
2003-01-21 16:16:53 +00:00
|
|
|
virtual void doItrListChanged() = 0;
|
2003-03-08 15:26:42 +00:00
|
|
|
int count() const { return m_itrs.count(); }
|
|
|
|
private:
|
2005-09-28 16:16:52 +00:00
|
|
|
QList<BookmarkIterator *> m_itrs;
|
2003-01-21 16:16:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|