/*------------------------------------------------------------------------------
 src/lib/djWidget/djImageOpWidget.h
 
 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
------------------------------------------------------------------------------*/

#ifndef DJ_IMAGE_OP_WIDGET_H
#define DJ_IMAGE_OP_WIDGET_H
#include <djImageOp.h>
#include <djWidget.h>

namespace dj {

// Image operation widget base.
//
class ImageOpWidget : public Widget, public Plugin {
public:

  ImageOpWidget();
  virtual ~ImageOpWidget() = 0;
  
  virtual void set(ImageOp *);
  Signal<bool> & sig() { return _sig; }
  virtual void widgetUpdate() {}
  
protected:

  ImageOp * _op;
  Signal<bool> _sig;
};

// Plugin entry points.
//
typedef const List<ImageOpWidget *> (ImageOpWidgetFnc)();

// Widget factory.
//
class ImageOpWidgetFactory : public PluginFactory {
public:

  ~ImageOpWidgetFactory();

  const List<ImageOpWidget *> & pluginList() const { return _pluginList; }
  ImageOpWidget * pluginCopy(const Str &);
  void pluginAdd(const List<ImageOpWidget *> &);

protected:

  const Str pluginPrefix() const { return Str("djImageOpWidget"); }
  bool init(void *);
  void del();

private:

  List<ImageOpWidget *> _pluginList;
};

}

#endif
