// -*- Mode: c++; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil -*-
// NOTE: the first line of this file sets up source code indentation rules
// for Emacs; it is also a hint to anyone modifying this file.

// File         : PreferencesDialog.h
// Author       : Pavel Aleksandrovich Koshevoy
// Created      : Mon Sep 25 21:58:00 MDT 2006
// Copyright    : (C) 2006
// License      : GPL
// Description  : UI for the user preferences.

#ifndef PREFERENCES_DIALOG_H_
#define PREFERENCES_DIALOG_H_

// local includes:
#include "ui_PreferencesDialog.h"

// Qt includes:
#include <QDialog>

// forward declarations:
extern bool prefsAllowLinearFiltering();
extern bool prefsAllowTransparency();
extern bool prefsShouldFitToImage();
extern unsigned int prefsSlideShowDelay();


//----------------------------------------------------------------
// PreferencesDialog
// 
class PreferencesDialog : public QDialog,
			  public Ui::PreferencesDialog
{
  Q_OBJECT
  
public:
  PreferencesDialog(QWidget * parent = 0, Qt::WFlags f = 0);
  
  // helper:
  void loadSettings();
  
  // virtual:
  int exec();
  
  // accessors:
  inline const bool & allowLinearFiltering() const
  { return allow_linear_filtering_; }
  
  inline bool allowTransparency() const
  { return allow_transparency_; }

  inline bool shouldFitToImage() const
  { return should_fit_to_image_; }
  
  inline unsigned int slideShowDelay()
  { return slide_show_delay_; }
  
protected:
  // virtual:
  void closeEvent(QCloseEvent * e);
  
  bool allow_linear_filtering_;
  bool allow_transparency_;
  bool should_fit_to_image_;
  unsigned int slide_show_delay_;
};


#endif // PREFERENCES_DIALOG_H_

