The Gnome Chemistry Utils  0.12.11
spectrumview.h
Go to the documentation of this file.
1 /*
2  * Gnome Chemisty Utils
3  * spectrumview.h
4  *
5  * Copyright (C) 2007-2009 Jean Bréfort <jean.brefort@normalesup.org>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 
23 #ifndef GCU_SPECTRUM_VIEW_H
24 #define GCU_SPECTRUM_VIEW_H
25 
26 #include "macros.h"
27 
29 namespace gcu
30 {
31 
32 class SpectrumDocument;
33 
39 {
40 friend class SpectrumViewPrivate;
41 public:
43 
49 
51 
54  virtual ~SpectrumView ();
55 
64  void SetAxisBounds (GogAxisType target, double min, double max, bool inverted);
65 
72  void SetAxisLabel (GogAxisType target, char const *unit);
73 
80  void ShowAxis (GogAxisType target, bool show);
81 
88  void InvertAxis (GogAxisType target, bool inverted);
89 
97  void Render (cairo_t *cr, double width, double height);
98 
102  void OnMinChanged ();
103 
107  void OnYMinChanged ();
108 
112  void OnMaxChanged ();
113 
117  void OnYMaxChanged ();
118 
122  void OnXRangeChanged ();
123 
127  void OnYRangeChanged ();
128 
133  GogSeries *NewSeries (bool new_plot);
134 
145  void SaveAsImage (std::string const &filename, char const *mime_type, unsigned width, unsigned height) const;
146 
147 private:
148  GtkSpinButton *xminbtn, *xmaxbtn, *yminbtn, *ymaxbtn;
149  GtkRange *xrange, *yrange;
150  gulong minsgn, maxsgn, yminsgn, ymaxsgn, xrangesgn, yrangesgn;
151  double xmin, xmax, xstep, ymin, ymax, ystep;
152 
160 GCU_RO_PROP (GtkWidget *, Widget)
164 GCU_RO_PROP (GtkWidget *, OptionBox)
168 GCU_RO_PROP (GogSeries *, Series)
169 GCU_RO_PROP (int, Width)
170 GCU_RO_PROP (int, Height)
171 };
172 
173 }
174 
175 #endif // GCU_SPECTRUM_VIEW_H