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