compile
[kdegraphics.git] / okular / ui / propertiesdialog.h
blob59ff2180f628e3718016371270179a4fd508e252
1 /***************************************************************************
2 * Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 ***************************************************************************/
10 #ifndef _PROPERTIESDIALOG_H_
11 #define _PROPERTIESDIALOG_H_
13 #include <qabstractitemmodel.h>
14 #include <qlist.h>
16 #include <kpagedialog.h>
18 #include "core/fontinfo.h"
20 class QLabel;
21 class QProgressBar;
22 class FontsListModel;
24 namespace Okular {
25 class Document;
28 class PropertiesDialog : public KPageDialog
30 Q_OBJECT
32 public:
33 PropertiesDialog( QWidget *parent, Okular::Document *doc );
34 virtual ~PropertiesDialog();
36 private slots:
37 void pageChanged( KPageWidgetItem *, KPageWidgetItem * );
38 void slotFontReadingProgress( int page );
39 void slotFontReadingEnded();
40 void reallyStartFontReading();
41 void showFontsMenu(const QPoint &pos);
43 private:
44 Okular::Document * m_document;
45 KPageWidgetItem * m_fontPage;
46 FontsListModel * m_fontModel;
47 QLabel * m_fontInfo;
48 QProgressBar * m_fontProgressBar;
49 bool m_fontScanStarted;
52 class FontsListModel
53 : public QAbstractTableModel
55 Q_OBJECT
57 public:
58 FontsListModel( QObject * parent = 0 );
59 virtual ~FontsListModel();
61 // reimplementations from QAbstractTableModel
62 virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
63 virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
64 virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
65 virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
67 public slots:
68 void addFont( const Okular::FontInfo &fi );
70 private:
71 QList<Okular::FontInfo> m_fonts;
74 #endif
76 /* kate: replace-tabs on; indent-width 4; */