1
// -*- mode: C++; tab-width: 2; -*-
4
// --------------------------------------------------------------------------
5
// OpenMS Mass Spectrometry Framework
6
// --------------------------------------------------------------------------
7
// Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
9
// This library is free software; you can redistribute it and/or
10
// modify it under the terms of the GNU Lesser General Public
11
// License as published by the Free Software Foundation; either
12
// version 2.1 of the License, or (at your option) any later version.
14
// This library is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
// Lesser General Public License for more details.
19
// You should have received a copy of the GNU Lesser General Public
20
// License along with this library; if not, write to the Free Software
21
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
// --------------------------------------------------------------------------
24
// $Maintainer:Timo Sachsenberg $
25
// $Authors: Marc Sturm $
26
// --------------------------------------------------------------------------
28
#ifndef OPENMS_VISUAL_VISUALIZER_METAINFOVISUALIZER_H
29
#define OPENMS_VISUAL_VISUALIZER_METAINFOVISUALIZER_H
32
#include <OpenMS/VISUAL/VISUALIZER/BaseVisualizer.h>
33
#include <OpenMS/VISUAL/VISUALIZER/BaseVisualizerGUI.h>
34
#include <OpenMS/METADATA/MetaInfoInterface.h>
40
class QAbstractButton;
46
@brief MetaInfoVisualizer is a visualizer class for all classes that use one MetaInfo object as member.
48
Meta information is an array of Type-Name-Value tupels. Classes that have a MetaInfo objects as a member can use this class to edit the MetaInfo object.
50
class OPENMS_GUI_DLLAPI MetaInfoVisualizer
51
: public BaseVisualizerGUI,
52
public BaseVisualizer<MetaInfoInterface>
58
MetaInfoVisualizer(bool editable = false, QWidget* parent = 0);
61
void load(MetaInfoInterface& m);
70
/// Adds a new Type-Value pair to the MetaInfo Object.
72
/// Clears out all fields.
74
/// Removes a selected Type-Value pair from the MetaInfo Object.
76
///Undo the changes made in the GUI.
80
/// Loads all Type-Value pairs one after another.
81
void loadData_(UInt index);
83
/** @name Edit fields for new Type-Value pair.
88
QLineEdit* newdescription_;
91
///@name Arrays of pointers to objects for temporary metaInfo data
93
std::vector< std::pair<UInt,QLineEdit*> > metainfoptr_;
94
std::vector< std::pair<UInt,QLabel*> > metalabels_;
95
std::vector< std::pair<UInt,QAbstractButton*> > metabuttons_;
98
///@name Edit fields and buttons
100
QPushButton* addbutton_;
101
QPushButton* clearbutton_;
102
QButtonGroup* buttongroup_;
105
/// Counter to keep track of the actual row in the layout.
108
/// The layout to display the Type-Value pairs.
109
QGridLayout* viewlayout_;
111
/// Container for metainfo data.
112
std::vector<UInt> keys_;