casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TBTypes.qo.h
Go to the documentation of this file.
00001 //# TBTypes.qo.h: (Not finished) Widget for entering a value based on its type.
00002 //# Copyright (C) 2005
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 TBTYPES_H_
00028 #define TBTYPES_H_
00029 
00030 #include <casaqt/QtBrowser/TBTypes.ui.h>
00031 
00032 #include <QtGui>
00033 
00034 #include <casa/BasicSL/String.h>
00035 
00036 #include <casa/namespace.h>
00037 using namespace std;
00038 
00039 namespace casa {
00040 
00041 // <summary>
00042 // (Not finished) Widget for entering a value based on its type.
00043 // </summary>
00044 //
00045 // <synopsis>
00046 // TBTypes is a widget with a number of different panels.  Each panel has
00047 // a different type of input that correspondings to different data types.
00048 // (For example, when entering a number a text field is used whereas entering
00049 // a complex has two spinners.)  Using the TBTypes::setType() method, the
00050 // different panels are shown or hidden as necessary.  Important: the
00051 // functionality of actually collecting the input is not yet implemented.
00052 // </synopsis>
00053 
00054 class TBTypes : public QWidget, Ui::Types {
00055     Q_OBJECT
00056 
00057 public:
00058         // Constructor that takes the starting type and whether or not to include
00059         // arrays in the list of types available.
00060     TBTypes(String type, bool incArrays = true);
00061 
00062     ~TBTypes();
00063 
00064     
00065     // Sets the current display to allow values for the given type.
00066     void setType(String type);
00067 
00068 private:
00069         // Current type.
00070     String type;
00071     
00072     // All available types.
00073     vector<String>* types;
00074     
00075     // TBTypes panel for entering single array cell values.
00076     TBTypes* arrayTypes;
00077     
00078     // TBTypes panel for entering single record values.
00079     TBTypes* recordTypes;
00080 
00081     
00082     // Sets up the display needed for arrays.
00083     void setupArray();
00084 
00085     // Sets up the display needed for records.
00086     void setupRecord();
00087 
00088 private slots:
00089         // Slot for when the user selects a type in the record chooser.
00090     void recordChooserChanged(int index);
00091 
00092     // Slot for when the user enters the dimensions for an array.
00093     void arrayDimSet();
00094 
00095     // Slot for when the user sets the value of an array cell.  (Not
00096     // implemented.)
00097     void arrayValSet();
00098 };
00099 
00100 }
00101 
00102 #endif