File indexing completed on 2024-12-22 04:18:18

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 CURVESELECTOR_H
0014 #define CURVESELECTOR_H
0015 
0016 #include <QWidget>
0017 #include "ui_curveselector.h"
0018 
0019 #include <curve.h>
0020 
0021 #include "kstwidgets_export.h"
0022 
0023 namespace Kst {
0024 
0025 class ObjectStore;
0026 
0027 class KSTWIDGETS_EXPORT CurveSelector : public QWidget, public Ui::CurveSelector {
0028   Q_OBJECT
0029   public:
0030     explicit CurveSelector(QWidget *parent = 0, ObjectStore *store = 0);
0031     virtual ~CurveSelector();
0032 
0033     void setObjectStore(ObjectStore *store);
0034 
0035     CurvePtr selectedCurve() const;
0036     bool selectedCurveDirty() const;
0037     void setSelectedCurve(CurvePtr selectedCurve);
0038 
0039     bool allowEmptySelection() const;
0040     void setAllowEmptySelection(bool allowEmptySelection);
0041 
0042     void clearSelection();
0043 
0044     virtual bool event(QEvent * event);
0045 
0046   Q_SIGNALS:
0047     void selectionChanged(const QString&);
0048 
0049   private Q_SLOTS:
0050     void emitSelectionChanged();
0051 
0052   private:
0053     void fillCurves();
0054 
0055   private:
0056     bool _allowEmptySelection;
0057 
0058     ObjectStore *_store;
0059 };
0060 
0061 }
0062 
0063 #endif
0064 
0065 // vim: ts=2 sw=2 et