casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
PlotMSAxisWidget.qo.h
Go to the documentation of this file.
00001 //# PlotMSAxisWidget.qo.h: Widget for choosing a single axis.
00002 //# Copyright (C) 2009
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: $
00027 #ifndef PLOTMSAXISWIDGET_QO_H_
00028 #define PLOTMSAXISWIDGET_QO_H_
00029 
00030 #include <plotms/Gui/PlotMSAxisWidget.ui.h>
00031 
00032 #include <casaqt/QtUtilities/QtEditingWidget.qo.h>
00033 #include <plotms/PlotMS/PlotMSConstants.h>
00034 
00035 #include <casa/namespace.h>
00036 
00037 namespace casa {
00038 
00039 //# Forward declarations.
00040 class PlotRangeWidget;
00041 
00042 
00043 // Widget for choosing a single axis.
00044 class PlotMSAxisWidget : public QtEditingWidget, Ui::AxisWidget {
00045     Q_OBJECT
00046     
00047 public:
00048     // Constructor which takes optional parent widget.
00049     PlotMSAxisWidget(PMS::Axis defaultAxis, int attachAxes,
00050             QWidget* parent = NULL);
00051     
00052     // Destructor.
00053     ~PlotMSAxisWidget();
00054     
00055     // Returns the labels used in the widget.
00056     // <group>
00057     QLabel* dataLabel() { return AxisWidget::dataLabel; }
00058     QLabel* attachLabel() { return AxisWidget::attachLabel; }
00059     QLabel* rangeLabel() { return AxisWidget::rangeLabel; }
00060     // </group>
00061     
00062     // Gets the current set values in the widget.
00063     // <group>
00064     PMS::Axis axis() const;
00065     PMS::DataColumn data() const;
00066     PlotAxis attachAxis() const;
00067     bool rangeCustom() const;
00068     prange_t range() const;
00069     // </group>
00070     
00071     // Sets the displayed value to the given.
00072     void setValue(PMS::Axis axis, PMS::DataColumn data, PlotAxis attachAxis,
00073             bool rangeCustom, prange_t range);
00074     
00075     // Sets the "in cache" checkbox to the given.
00076     void setInCache(bool inCache);
00077     
00078     /*    
00079 signals:
00080     // This signal should be emitted whenever the user changes any value
00081     // settings in the GUI.
00082     void changed();
00083      */
00084     
00085 private:
00086     // Widget for the range.
00087     PlotRangeWidget* itsRangeWidget_;
00088     
00089 private slots:
00090     // Slot for when the axis value changed.
00091     void axisChanged(const QString& value);
00092 };
00093 
00094 }
00095 
00096 #endif /* PLOTMSAXISWIDGET_QO_H_ */