toc.h 1.39 KB
Newer Older
1
/***************************************************************************
Albert Astals Cid's avatar
Albert Astals Cid committed
2
 *   Copyright (C) 2004-2006 by Albert Astals Cid <tsdgeos@terra.es>       *
3 4 5 6 7 8 9
 *                                                                         *
 *   This program is free software; you can redistribute it and/or 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) any later version.                                   *
 ***************************************************************************/

10 11
#ifndef _KPDF_TOC_H_
#define _KPDF_TOC_H_
12

13
#include <qdom.h>
Pino Toscano's avatar
porting  
Pino Toscano committed
14
#include <k3listview.h>
Piotr Szymanski's avatar
Piotr Szymanski committed
15
#include "core/document.h"
16
#include "core/observer.h"
Albert Astals Cid's avatar
Albert Astals Cid committed
17

18 19
class KPDFDocument;

Pino Toscano's avatar
porting  
Pino Toscano committed
20
class TOC : public K3ListView, public DocumentObserver
21 22
{
Q_OBJECT
23 24
    public:
        TOC(QWidget *parent, KPDFDocument *document);
Albert Astals Cid's avatar
Albert Astals Cid committed
25
        ~TOC();
26

27
        // inherited from DocumentObserver
28
        uint observerId() const;
Albert Astals Cid's avatar
Albert Astals Cid committed
29
        void notifySetup( const QVector< KPDFPage * > & pages, bool documentChanged );
30

31 32
    signals:
        void hasTOC(bool has);
Albert Astals Cid's avatar
Albert Astals Cid committed
33

34
    private slots:
Albert Astals Cid's avatar
Albert Astals Cid committed
35
        void slotExecuted(Q3ListViewItem *i);
36

37
    private:
Pino Toscano's avatar
porting  
Pino Toscano committed
38
        void addChildren( const QDomNode & parentNode, K3ListViewItem * parentItem = 0 );
Piotr Szymanski's avatar
Piotr Szymanski committed
39
        DocumentViewport getViewport( const QDomElement &e ) const;
40
        KPDFDocument *m_document;
41 42 43
};

#endif