linkedtexthandler.h 1.48 KB
Newer Older
dimitri's avatar
dimitri committed
1 2 3 4 5
/******************************************************************************
 *
 * $Id$
 *
 *
dimitri's avatar
dimitri committed
6
 * Copyright (C) 1997-2006 by Dimitri van Heesch.
dimitri's avatar
dimitri committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation under the terms of the GNU General Public License is hereby 
 * granted. No representations are made about the suitability of this software 
 * for any purpose. It is provided "as is" without express or implied warranty.
 * See the GNU General Public License for more details.
 *
 */
#ifndef LINKEDTEXTHANDLER_H
#define LINKEDTEXTHANDLER_H

#include "baseiterator.h"
#include "basehandler.h"

class LT_Ref;
dimitri's avatar
dimitri committed
22
class LinkedTextImpl : public ILinkedText
dimitri's avatar
dimitri committed
23 24
{
  public:
dimitri's avatar
dimitri committed
25
    virtual ~LinkedTextImpl() {}
dimitri's avatar
dimitri committed
26 27 28 29 30
};

class LinkedTextHandler : public BaseHandler<LinkedTextHandler>
{
  public:
dimitri's avatar
dimitri committed
31
    LinkedTextHandler(IBaseHandler *parent,QList<LinkedTextImpl> &children);
dimitri's avatar
dimitri committed
32 33 34 35 36
    virtual ~LinkedTextHandler();
    virtual void start(const char *endTag);
    virtual void end();
    virtual void startRef(const QXmlAttributes& attrib);
    virtual void endRef();
dimitri's avatar
dimitri committed
37 38 39
    static QString toString(const QList<LinkedTextImpl> &list);

    // ILinkedText
dimitri's avatar
dimitri committed
40 41 42

  private:
    IBaseHandler *m_parent;
dimitri's avatar
dimitri committed
43
    QList<LinkedTextImpl> &m_children;
dimitri's avatar
dimitri committed
44 45 46
    LT_Ref *m_ref;
};

dimitri's avatar
dimitri committed
47 48 49 50 51 52 53
class LinkedTextIterator : public BaseIterator<ILinkedTextIterator,ILinkedText,LinkedTextImpl>
{
  public:
    LinkedTextIterator(const QList<LinkedTextImpl> &list) : 
      BaseIterator<ILinkedTextIterator,ILinkedText,LinkedTextImpl>(list) {}
};

dimitri's avatar
dimitri committed
54
#endif