casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TBConnection.qo.h
Go to the documentation of this file.
00001 //# TBConnection.qo.h: Dialog for opening/connecting to a table with options.
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 TBCONNECTION_H_
00028 #define TBCONNECTION_H_
00029 
00030 #include <casaqt/QtBrowser/TBConnection.ui.h>
00031 
00032 #include <QtGui>
00033 #include <casa/BasicSL/String.h>
00034 
00035 #include <casa/namespace.h>
00036 
00037 namespace casa {
00038 
00039 //# Forward Declarations
00040 class TBMain;
00041 
00042 // <summary>
00043 // Dialog for opening/connecting to a table with options
00044 // <summary>
00045 //
00046 // <synopsis>
00047 // TBConnection is a dialog to open a table with user-specified options.
00048 // <b>Important</b>: this is not currently supported, but in the future if a
00049 // client/server architecture is used then this widget can be used for
00050 // connecting to a remote table.  Other options include the driver type: direct
00051 // (using the Table module code for a local table) or XML.  TBConnection
00052 // displays helpful explanation text when the user clicks on the different
00053 // options.
00054 // </synopsis>
00055 
00056 class TBConnection : public QDialog, Ui::Connection {
00057     Q_OBJECT
00058 
00059 public:
00060     // Builds a connection dialog with the given TBMain.  If parent is NULL,
00061         // then the connection is displayed as a modal dialog; otherwise it is
00062         // displayed in the parent.
00063     TBConnection(TBMain* main, QWidget* parent = NULL);
00064 
00065     ~TBConnection();
00066 
00067 protected:
00068     // Detects when one of the QLineEdit objects are clicked and calls the
00069         // relevant clicked[Name]() slot.
00070     bool eventFilter(QObject *obj, QEvent *event);
00071     
00072 private:
00073     // Pointer to TBMain parent.
00074     TBMain* parent;
00075 
00076 private slots:
00077     // Slot for when the user clicks the "accept" button.  Checks for errors,
00078         // and then opens the table with the specified options in the browser.
00079     void accepted();
00080 
00081     // Slot for when the user clicks the "browse" button.  Opens a filebrowser
00082     // and sets the text of the line edit to the path of the selected file.
00083     // Updates the help text to TBConstants::OPEN_TEXT_LOCATION.
00084     void browse();
00085 
00086     // Slot for when the user clicks the local box.  Updates the help text
00087     // to TBConstants::OPEN_TEXT_LOCAL.
00088     void clickedLocal();
00089 
00090     // Slot for when the user clicks the remote box.  Updates the help text to
00091     // TBConstants::OPEN_TEXT_REMOTE.
00092     void clickedRemote();
00093 
00094     // Slot for when the user clicks the host line edit.  Updates the help text
00095     // to TBConstants::OPEN_TEXT_HOST.
00096     void clickedHost();
00097 
00098     // Slot for when the user clicks the port line edit.  Updates the help text
00099     // to TBConstants::OPEN_TEXT_PORT.
00100     void clickedPort();
00101 
00102     // Slot for when the user clicks the location line edit.  Updates the help
00103     // text to TBConstants::OPEN_TEXT_LOCATION.
00104     void clickedLocation();
00105 
00106     // Slot for when the user clicks the direct box.  Updates the help text to
00107     // TBConstants::OPEN_TEXT_DIRECT.
00108     void clickedDirect();
00109 
00110     // Slot for when the user clicks the XML box.  Updates the help text to
00111     // TBConstants::OPEN_TEXT_XML.
00112     void clickedXML();
00113 
00114     // Slot for when the user clicks the home parser box.  Updates the help
00115     // text to TBConstants::OPEN_TEXT_HOME.
00116     void clickedHome();
00117 
00118     // Slot for when the user clicks the DOM parser box.  Updates the help
00119     // text to TBConstants::OPEN_TEXT_DOM.
00120     void clickedDOM();
00121 
00122     // Slot for when the user clicks the SAX parser box.  Updates the help text
00123     // to TBConstants::OPEN_TEXT_SAX.
00124     void clickedSAX();
00125 
00126     // Slot for when the user clicks the start line edit.  Updates the help
00127     // text to TBConstants::OPEN_TEXT_START.
00128     void clickedStart();
00129 
00130     // Slot for when the user clicks the num line edit.  Updates the help text
00131     // to TBConstants::OPEN_TEXT_NUM.
00132     void clickedNum();
00133 };
00134 
00135 }
00136 
00137 #endif /* TBCONNECTION_H_ */