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 CLEAVE_OLIGOMER_TABLE_VIEW_HPP 39 #define CLEAVE_OLIGOMER_TABLE_VIEW_HPP 40 41 42 /////////////////////// Qt includes 43 #include <QTableView> 44 45 46 /////////////////////// Local includes 47 #include "oligomerList.hpp" 48 49 50 namespace massXpert 51 { 52 53 class CleavageDlg; 54 55 56 class CleaveOligomerTableView : public QTableView 57 { 58 Q_OBJECT 59 60 private: 61 CleavageDlg *mp_parentDlg; 62 63 OligomerList *mp_oligomerList; 64 65 // For drag operations. 66 QPoint m_dragStartPos; 67 void startDrag(); 68 69 ///////// Contextual menu for copying to clipboard of mono/avg 70 ///////// masses. 71 QMenu *contextMenu; 72 QAction *copyMonoAct; 73 QAction *copyAvgAct; 74 ///////// 75 76 protected: 77 78 void currentChanged(const QModelIndex &, const QModelIndex &); 79 void copyMassList(int); 80 81 public: 82 CleaveOligomerTableView(QWidget *parent = 0); 83 ~CleaveOligomerTableView(); 84 85 void setOligomerList(OligomerList *); 86 const OligomerList *oligomerList(); 87 88 CleavageDlg *parentDlg(); 89 void setParentDlg(CleavageDlg *); 90 91 int selectedOligomers(OligomerList *, int = 0) const; 92 QString *selectedOligomersAsPlainText(QString = "$", 93 bool = false, 94 bool = false, 95 MassType = MXT_MASS_MONO) const; 96 97 void mousePressEvent(QMouseEvent *); 98 void mouseMoveEvent(QMouseEvent *); 99 100 public slots: 101 void itemActivated(const QModelIndex &); 102 void copyMono(); 103 void copyAvg(); 104 }; 105 106 } // namespace massXpert 107 108 109 #endif // CLEAVE_OLIGOMER_TABLE_VIEW_HPP 110