1 /* massXpert - the true massist's program.
2    --------------------------------------
3    Copyright(C) 2006,2007 Filippo Rusconi
4 
5    http://www.massxpert.org/massXpert
6 
7    This file is part of the massXpert project.
8 
9    The massxpert project is the successor to the "GNU polyxmass"
10    project that is an official GNU project package(see
11    www.gnu.org). The massXpert project is not endorsed by the GNU
12    project, although it is released ---in its entirety--- under the
13    GNU General Public License. A huge part of the code in massXpert
14    is actually a C++ rewrite of code in GNU polyxmass. As such
15    massXpert was started at the Centre National de la Recherche
16    Scientifique(FRANCE), that granted me the formal authorization to
17    publish it under this Free Software License.
18 
19    This software is free software; you can redistribute it and/or
20    modify it under the terms of the GNU  General Public
21    License version 3, as published by the Free Software Foundation.
22 
23 
24    This software is distributed in the hope that it will be useful,
25    but WITHOUT ANY WARRANTY; without even the implied warranty of
26    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27    General Public License for more details.
28 
29    You should have received a copy of the GNU General Public License
30    along with this software; if not, write to the
31 
32    Free Software Foundation, Inc.,
33 
34    51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
35 */
36 
37 
38 #ifndef PKA_PH_PI_DLG_HPP
39 #define PKA_PH_PI_DLG_HPP
40 
41 
42 /////////////////////// Qt includes
43 #include <QMainWindow>
44 
45 
46 /////////////////////// Local includes
47 #include "ui_pkaPhPiDlg.h"
48 #include "sequenceEditorWnd.hpp"
49 #include "pkaPhPi.hpp"
50 
51 
52 namespace massXpert
53 {
54 
55   enum
56     {
57       MXP_TARGET_PI = 0,
58       MXP_TARGET_NET_CHARGE = 1
59     };
60 
61 
62   class PkaPhPiDlg : public QDialog
63   {
64     Q_OBJECT
65 
66     private:
67     Ui::PkaPhPiDlg m_ui;
68     SequenceEditorWnd *mp_editorWnd;
69 
70     // The results-exporting strings. ////////////////////////////////
71     QString *mpa_resultsString;
72     QString m_resultsFilePath;
73     //////////////////////////////////// The results-exporting strings.
74 
75 
76     // mpa_pkaPhPi not allocated locally, but ownnership taken by *this,
77     // and will be deleted upon destruction of *this.
78     PkaPhPi *mpa_pkaPhPi;
79 
80     const Polymer &m_polymer;
81     CalcOptions m_calcOptions;
82 
83     int m_startIndex;
84     int m_endIndex;
85     int m_chemGroupsTested;
86 
87     void closeEvent(QCloseEvent *event);
88 
89     bool fetchValidateInputData();
90 
91     // The results-exporting functions. ////////////////////////////////
92     void prepareResultsTxtString(int);
93     bool exportResultsClipboard();
94     bool exportResultsFile();
95     bool selectResultsFile();
96     //////////////////////////////////// The results-exporting functions.
97 
98   public:
99     PkaPhPiDlg(QWidget *,
100 		PkaPhPi *,
101 		Polymer &,
102 		CalcOptions &);
103 
104     ~PkaPhPiDlg();
105 
106     SequenceEditorWnd *editorWnd();
107 
108   public slots:
109     void netCharge();
110     void isoelectricPoint();
111     void exportResults(int);
112   };
113 
114 } // namespace massXpert
115 
116 
117 #endif // PKA_PH_PI_DLG_HPP
118