File indexing completed on 2024-12-22 04:17:27

0001 /***************************************************************************
0002  *                                                                         *
0003  *   copyright : (C) 2007 The University of Toronto                        *
0004  *                   netterfield@astro.utoronto.ca                         *
0005  *                                                                         *
0006  *   This program is free software; you can redistribute it and/or modify  *
0007  *   it under the terms of the GNU General Public License as published by  *
0008  *   the Free Software Foundation; either version 2 of the License, or     *
0009  *   (at your option) any later version.                                   *
0010  *                                                                         *
0011  ***************************************************************************/
0012 
0013 #ifndef CSDDIALOG_H
0014 #define CSDDIALOG_H
0015 
0016 #include "datadialog.h"
0017 #include "datatab.h"
0018 
0019 #include "csd.h"
0020 
0021 #include "ui_csdtab.h"
0022 
0023 #include <QPointer>
0024 
0025 #include "kst_export.h"
0026 
0027 namespace Kst {
0028 
0029 class CSDTab : public DataTab, Ui::CSDTab {
0030   Q_OBJECT
0031   public:
0032     explicit CSDTab(QWidget *parent = 0);
0033     virtual ~CSDTab();
0034 
0035     void setObjectStore(ObjectStore *store);
0036 
0037     VectorPtr vector() const;
0038     bool vectorDirty() const;
0039     void setVector(const VectorPtr vector);
0040 
0041     int windowSize() const;
0042     bool windowSizeDirty() const;
0043     void setWindowSize(const int windowSize);
0044 
0045     CurvePlacement* curvePlacement() const;
0046     FFTOptions* FFTOptionsWidget() const;
0047     ColorPalette* colorPalette() const;
0048 
0049     void hideImageOptions();
0050     void clearTabValues();
0051 
0052   private Q_SLOTS:
0053     void selectionChanged();
0054 
0055   Q_SIGNALS:
0056     void optionsChanged();
0057 };
0058 
0059 class CSDDialog : public DataDialog {
0060   Q_OBJECT
0061   public:
0062     explicit CSDDialog(ObjectPtr dataObject, QWidget *parent = 0);
0063     virtual ~CSDDialog();
0064 
0065     void setVector(VectorPtr vector);
0066 
0067     virtual bool dialogValid() const {return bool(_CSDTab->vector()) || (editMode() == EditMultiple);}
0068 
0069   protected:
0070     virtual ObjectPtr createNewDataObject();
0071     virtual ObjectPtr editExistingDataObject() const;
0072 
0073   private Q_SLOTS:
0074     void updateButtons();
0075     void editMultipleMode();
0076     void editSingleMode();
0077 
0078   private:
0079     void configureTab(ObjectPtr object);
0080 
0081     CSDTab *_CSDTab;
0082 };
0083 
0084 }
0085 
0086 #endif