2006-09-12 20:21:34 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 by Pino Toscano <pino@kde.org> *
|
|
|
|
* *
|
|
|
|
* 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 _ANNOTATIONWIDGETS_H_
|
|
|
|
#define _ANNOTATIONWIDGETS_H_
|
|
|
|
|
2006-09-13 17:28:32 +00:00
|
|
|
#include <qwidget.h>
|
|
|
|
|
2006-09-12 20:21:34 +00:00
|
|
|
#include "core/annotations.h"
|
|
|
|
|
2006-11-19 00:46:01 +00:00
|
|
|
class QCheckBox;
|
2006-09-13 17:28:32 +00:00
|
|
|
class QComboBox;
|
2006-09-16 14:58:32 +00:00
|
|
|
class QDoubleSpinBox;
|
2006-09-12 20:21:34 +00:00
|
|
|
class QLabel;
|
|
|
|
class QWidget;
|
2006-11-19 00:46:01 +00:00
|
|
|
class KColorButton;
|
2006-12-23 18:37:04 +00:00
|
|
|
class KFontRequester;
|
2006-09-12 20:21:34 +00:00
|
|
|
class AnnotationWidget;
|
|
|
|
|
2006-09-13 17:28:32 +00:00
|
|
|
class PixmapPreviewSelector
|
|
|
|
: public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit PixmapPreviewSelector( QWidget * parent = 0 );
|
|
|
|
virtual ~PixmapPreviewSelector();
|
|
|
|
|
|
|
|
void setIcon( const QString& icon );
|
|
|
|
QString icon() const;
|
|
|
|
|
2006-09-14 10:36:15 +00:00
|
|
|
void addItem( const QString& item, const QString& id );
|
2006-09-13 17:28:32 +00:00
|
|
|
|
|
|
|
void setPreviewSize( int size );
|
|
|
|
int previewSize() const;
|
|
|
|
|
2007-09-04 18:21:33 +00:00
|
|
|
void setEditable( bool editable );
|
|
|
|
|
2006-09-13 17:28:32 +00:00
|
|
|
signals:
|
|
|
|
void iconChanged( const QString& );
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void iconComboChanged( const QString& icon );
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_icon;
|
|
|
|
QLabel * m_iconLabel;
|
|
|
|
QComboBox * m_comboItems;
|
|
|
|
int m_previewSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-09-12 20:21:34 +00:00
|
|
|
/**
|
|
|
|
* A factory to create AnnotationWidget's.
|
|
|
|
*/
|
|
|
|
class AnnotationWidgetFactory
|
|
|
|
{
|
|
|
|
public:
|
2006-09-21 08:45:36 +00:00
|
|
|
static AnnotationWidget * widgetFor( Okular::Annotation * ann );
|
2006-09-12 20:21:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class AnnotationWidget
|
|
|
|
: public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual ~AnnotationWidget();
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
virtual Okular::Annotation::SubType annotationType() const;
|
2006-09-12 20:21:34 +00:00
|
|
|
|
|
|
|
virtual QWidget * widget() = 0;
|
|
|
|
|
|
|
|
virtual void applyChanges() = 0;
|
|
|
|
|
2006-09-13 19:52:46 +00:00
|
|
|
signals:
|
|
|
|
void dataChanged();
|
|
|
|
|
2006-09-12 20:21:34 +00:00
|
|
|
protected:
|
2006-09-21 08:45:36 +00:00
|
|
|
AnnotationWidget( Okular::Annotation * ann );
|
2006-09-12 20:21:34 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
Okular::Annotation * m_ann;
|
2006-09-12 20:21:34 +00:00
|
|
|
};
|
|
|
|
|
2006-09-13 18:19:22 +00:00
|
|
|
class TextAnnotationWidget
|
|
|
|
: public AnnotationWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2006-09-21 08:45:36 +00:00
|
|
|
TextAnnotationWidget( Okular::Annotation * ann );
|
2006-09-13 18:19:22 +00:00
|
|
|
|
|
|
|
virtual QWidget * widget();
|
|
|
|
|
|
|
|
virtual void applyChanges();
|
|
|
|
|
|
|
|
private:
|
2006-09-21 08:45:36 +00:00
|
|
|
Okular::TextAnnotation * m_textAnn;
|
2006-09-13 18:19:22 +00:00
|
|
|
QWidget * m_widget;
|
|
|
|
PixmapPreviewSelector * m_pixmapSelector;
|
2006-12-23 18:37:04 +00:00
|
|
|
KFontRequester * m_fontReq;
|
2006-09-13 18:19:22 +00:00
|
|
|
};
|
|
|
|
|
2006-09-12 20:21:34 +00:00
|
|
|
class StampAnnotationWidget
|
|
|
|
: public AnnotationWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2006-09-21 08:45:36 +00:00
|
|
|
StampAnnotationWidget( Okular::Annotation * ann );
|
2006-09-12 20:21:34 +00:00
|
|
|
|
|
|
|
virtual QWidget * widget();
|
|
|
|
|
|
|
|
virtual void applyChanges();
|
|
|
|
|
|
|
|
private:
|
2006-09-21 08:45:36 +00:00
|
|
|
Okular::StampAnnotation * m_stampAnn;
|
2006-09-12 20:21:34 +00:00
|
|
|
QWidget * m_widget;
|
2006-09-13 17:28:32 +00:00
|
|
|
PixmapPreviewSelector * m_pixmapSelector;
|
2006-09-12 20:21:34 +00:00
|
|
|
};
|
|
|
|
|
2006-09-16 14:58:32 +00:00
|
|
|
class LineAnnotationWidget
|
|
|
|
: public AnnotationWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2006-09-21 08:45:36 +00:00
|
|
|
LineAnnotationWidget( Okular::Annotation * ann );
|
2006-09-16 14:58:32 +00:00
|
|
|
|
|
|
|
virtual QWidget * widget();
|
|
|
|
|
|
|
|
virtual void applyChanges();
|
|
|
|
|
|
|
|
private:
|
2006-09-21 08:45:36 +00:00
|
|
|
Okular::LineAnnotation * m_lineAnn;
|
2006-09-16 14:58:32 +00:00
|
|
|
int m_lineType;
|
|
|
|
QWidget * m_widget;
|
|
|
|
QDoubleSpinBox * m_spinLL;
|
|
|
|
QDoubleSpinBox * m_spinLLE;
|
2007-12-08 11:31:37 +00:00
|
|
|
QDoubleSpinBox * m_spinSize;
|
2006-09-16 14:58:32 +00:00
|
|
|
};
|
|
|
|
|
2006-11-18 20:37:03 +00:00
|
|
|
class HighlightAnnotationWidget
|
|
|
|
: public AnnotationWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
HighlightAnnotationWidget( Okular::Annotation * ann );
|
|
|
|
|
|
|
|
virtual QWidget * widget();
|
|
|
|
|
|
|
|
virtual void applyChanges();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Okular::HighlightAnnotation * m_hlAnn;
|
|
|
|
QWidget * m_widget;
|
|
|
|
QComboBox * m_typeCombo;
|
|
|
|
};
|
|
|
|
|
2006-11-19 00:46:01 +00:00
|
|
|
class GeomAnnotationWidget
|
|
|
|
: public AnnotationWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
GeomAnnotationWidget( Okular::Annotation * ann );
|
|
|
|
|
|
|
|
virtual QWidget * widget();
|
|
|
|
|
|
|
|
virtual void applyChanges();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Okular::GeomAnnotation * m_geomAnn;
|
|
|
|
QWidget * m_widget;
|
|
|
|
QComboBox * m_typeCombo;
|
|
|
|
QCheckBox * m_useColor;
|
|
|
|
KColorButton * m_innerColor;
|
|
|
|
};
|
|
|
|
|
2006-09-12 20:21:34 +00:00
|
|
|
#endif
|