kmdilistiterator.h

00001 //----------------------------------------------------------------------------
00002 //    filename             : kmdilistiterator.h
00003 //----------------------------------------------------------------------------
00004 //    Project              : KDE MDI extension
00005 //
00006 //    begin                : 02/2000       by Massimo Morin
00007 //    changes              : 02/2000       by Falk Brettschneider to create an
00008 //                           - 06/2000     stand-alone Qt extension set of
00009 //                                         classes and a Qt-based library
00010 //                           2000-2003     maintained by the KDevelop project
00011 //
00012 //    copyright            : (C) 1999-2003 by Massimo Morin (mmorin@schedsys.com)
00013 //                                         and
00014 //                                         Falk Brettschneider
00015 //    email                :  falkbr@kdevelop.org (Falk Brettschneider)
00016 //----------------------------------------------------------------------------
00017 //
00018 //----------------------------------------------------------------------------
00019 //
00020 //    This program is free software; you can redistribute it and/or modify
00021 //    it under the terms of the GNU Library General Public License as
00022 //    published by the Free Software Foundation; either version 2 of the
00023 //    License, or (at your option) any later version.
00024 //
00025 //----------------------------------------------------------------------------
00026 
00027 #ifndef _KMDILISTITERATOR_H_
00028 #define _KMDILISTITERATOR_H_
00029 
00030 #include <kmdiiterator.h>
00031 
00032 template <class I>
00033 class QPtrList;
00034 template <class I>
00035 class QPtrListIterator;
00036 
00037 template <class Item>
00038 class KMdiListIterator : public KMdiIterator<Item*>
00039 {
00040 public:
00041     KMdiListIterator( QPtrList<Item>& list )
00042     {
00043         m_iterator = new QPtrListIterator<Item>( list );
00044     }
00045 
00046     virtual void first() { m_iterator->toFirst(); }
00047     virtual void last() { m_iterator->toLast(); }
00048     virtual void next() { ++( *m_iterator ); }
00049     virtual void prev() { --( *m_iterator ); }
00050     virtual bool isDone() const { return m_iterator->current() == 0; }
00051     virtual Item* currentItem() const { return m_iterator->current(); }
00052 
00053     virtual ~KMdiListIterator() { delete m_iterator; }
00054 
00055 private:
00056     QPtrListIterator<Item> *m_iterator;
00057 };
00058 
00059 #endif // _KMDILISTITERATOR_H_ 
00060 // kate: space-indent off; tab-width 4; replace-tabs off; indent-mode csands;
00061 
KDE Home | KDE Accessibility Home | Description of Access Keys