2004-12-05 22:47:32 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> *
|
|
|
|
* *
|
|
|
|
* 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. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _PROPERTIESDIALOG_H_
|
|
|
|
#define _PROPERTIESDIALOG_H_
|
|
|
|
|
2006-03-30 23:15:30 +00:00
|
|
|
#include <qabstractitemmodel.h>
|
|
|
|
#include <qlist.h>
|
|
|
|
|
2006-06-13 08:44:08 +00:00
|
|
|
#include <kpagedialog.h>
|
2004-12-05 22:47:32 +00:00
|
|
|
|
2007-07-07 20:35:01 +00:00
|
|
|
#include "core/fontinfo.h"
|
|
|
|
|
|
|
|
class QLabel;
|
|
|
|
class QProgressBar;
|
|
|
|
class FontsListModel;
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
namespace Okular {
|
|
|
|
class Document;
|
|
|
|
}
|
2004-12-05 22:47:32 +00:00
|
|
|
|
2006-06-13 08:44:08 +00:00
|
|
|
class PropertiesDialog : public KPageDialog
|
2004-12-05 22:47:32 +00:00
|
|
|
{
|
2007-07-07 20:35:01 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2004-12-05 22:47:32 +00:00
|
|
|
public:
|
2006-09-21 08:45:36 +00:00
|
|
|
PropertiesDialog( QWidget *parent, Okular::Document *doc );
|
2007-07-08 21:22:37 +00:00
|
|
|
virtual ~PropertiesDialog();
|
2004-12-05 22:47:32 +00:00
|
|
|
|
2007-07-07 20:35:01 +00:00
|
|
|
private slots:
|
|
|
|
void pageChanged( KPageWidgetItem *, KPageWidgetItem * );
|
|
|
|
void slotFontReadingProgress( int page );
|
|
|
|
void slotFontReadingEnded();
|
|
|
|
void reallyStartFontReading();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Okular::Document * m_document;
|
|
|
|
KPageWidgetItem * m_fontPage;
|
|
|
|
FontsListModel * m_fontModel;
|
|
|
|
QLabel * m_fontInfo;
|
|
|
|
QProgressBar * m_fontProgressBar;
|
|
|
|
bool m_fontScanStarted;
|
|
|
|
};
|
2006-03-30 23:15:30 +00:00
|
|
|
|
|
|
|
class FontsListModel
|
|
|
|
: public QAbstractTableModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
FontsListModel( QObject * parent = 0 );
|
|
|
|
virtual ~FontsListModel();
|
|
|
|
|
|
|
|
// reimplementations from QAbstractTableModel
|
|
|
|
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
|
|
|
|
virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
|
|
|
|
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
|
|
|
|
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
|
|
|
|
|
2007-07-07 20:35:01 +00:00
|
|
|
public slots:
|
|
|
|
void addFont( const Okular::FontInfo &fi );
|
|
|
|
|
2006-03-30 23:15:30 +00:00
|
|
|
private:
|
2007-07-07 20:35:01 +00:00
|
|
|
QList<Okular::FontInfo> m_fonts;
|
2006-03-30 23:15:30 +00:00
|
|
|
};
|
|
|
|
|
2004-12-05 22:47:32 +00:00
|
|
|
#endif
|