mirror of
https://invent.kde.org/graphics/okular
synced 2024-11-05 18:34:53 +00:00
c3a4b37301
start a basic system for the annotation properties editing. Add a base class that will act as "interface", and a factory to create the right subclass depending on the annotation type. Adapt the Annotation Properties dialog to interact with the annotation widget. Add the editing support for Stamp Annotation (but the artwork are missing, grrr) svn path=/trunk/playground/graphics/okular/; revision=583620
70 lines
1.6 KiB
C++
70 lines
1.6 KiB
C++
/***************************************************************************
|
|
* 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_
|
|
|
|
#include "core/annotations.h"
|
|
|
|
class QLabel;
|
|
class QWidget;
|
|
class AnnotationWidget;
|
|
|
|
/**
|
|
* A factory to create AnnotationWidget's.
|
|
*/
|
|
class AnnotationWidgetFactory
|
|
{
|
|
public:
|
|
static AnnotationWidget * widgetFor( Annotation * ann );
|
|
};
|
|
|
|
class AnnotationWidget
|
|
: public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
virtual ~AnnotationWidget();
|
|
|
|
virtual Annotation::SubType annotationType();
|
|
|
|
virtual QWidget * widget() = 0;
|
|
|
|
virtual void applyChanges() = 0;
|
|
|
|
protected:
|
|
AnnotationWidget( Annotation * ann );
|
|
|
|
Annotation * m_ann;
|
|
};
|
|
|
|
class StampAnnotationWidget
|
|
: public AnnotationWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
StampAnnotationWidget( Annotation * ann );
|
|
|
|
virtual QWidget * widget();
|
|
|
|
virtual void applyChanges();
|
|
|
|
private slots:
|
|
void iconChanged( const QString& );
|
|
|
|
private:
|
|
StampAnnotation * m_stampAnn;
|
|
QWidget * m_widget;
|
|
QLabel * m_iconLabel;
|
|
QString m_currentIcon;
|
|
};
|
|
|
|
#endif
|