/*------------------------------------------------------------------------------
 src/bin/djview/magnifyTool.h

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

#ifndef DJVIEW_MAGNIFY_TOOL_H
#define DJVIEW_MAGNIFY_TOOL_H
#include "base.h"
#include <djDialog.h>

namespace dj {
class IntWidget;
class ImageWidget;
}

namespace djview {

class ViewWidget;

// Image magnify tool.
//
class MagnifyTool : public DialogBase {
public:
  
  MagnifyTool();
  
  // Set.
  //
  void set(const ViewWidget *);
  void del(const ViewWidget *);
  
  // Preferences.
  //
  void prefs(const Prefs &);
  void prefs(Prefs *);

private:

  DJ_CALLBACK(MagnifyTool, zoomCallback, int)
  DJ_CALLBACK(MagnifyTool, closeCallback, bool)
  void widgetUpdate();

  const ViewWidget * _value;
  int _zoom;
  
  ImageWidget * _widget;
  IntWidget * _zoomWidget;
  bool _callbacks;
};

}

#endif
