1 // $Id: xxPredictionWindow.hh 5034 2013-07-08 01:58:13Z flaterco $
2 
3 /*  xxPredictionWindow  Abstract class for all tide-predicting windows.
4 
5     Copyright (C) 1998  David Flater.
6 
7     This program is free software: you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation, either version 3 of the License, or
10     (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, see <http://www.gnu.org/licenses/>.
19 */
20 
21 class xxPredictionWindow: public xxWindow {
22 public:
23 
24   // The new window takes ownership of station.
25   xxPredictionWindow (const xxWidget &shell,
26                       Station *station,
27                       Timestamp startTime,
28                       ContainerType containerType = boxContainer);
29 
30   ~xxPredictionWindow();
31 
32   // Callbacks.  The ones with no arguments are callbacks from menu
33   // options; they create dialogs to get more information.  The ones
34   // with arguments are callbacks from the ensuing dialogs.
35   virtual void help() = 0;
36   virtual void save () = 0;
37   virtual void save (const Dstr &filename, Format::Format form) = 0;
38   void units();
39   void mark ();
40   void mark (NullablePredictionValue newMarkLevel);
41   void timestamp ();
42   void timestamp (Timestamp newTimestamp);
43   void aspect ();
44   void aspect (double newAspect);
45   void step ();
46   void step (Interval newStep);
47 
48   void globalRedraw();                // See xxRedrawable.
49 
50   // Accessors.
51   Station * const station() const;
52   const Timestamp startTime() const;
53 
54 protected:
55 
56   std::auto_ptr<Station> _station;
57 
58   // This is the "starting time" or "now" that is used to calibrate
59   // any given drawable in time.  This needs to be here so that it
60   // is possible for one drawable to create another one with the
61   // same start time.
62   Timestamp t;
63 
64   std::auto_ptr<xxWidget> saveButton, markButton, helpButton, dismissButton,
65                           optionsButton, optionsMenu, graphButton,
66                           plainButton, rawButton, mediumRareButton,
67                           aboutStationButton, aboutXTideButton, aspectButton,
68                           clockButton, chooserButton, timestampButton,
69                           unitsButton, rootButton, stepButton;
70 
71 
72   virtual const bool isGraph() const;  // true if graph or clock
73   virtual const bool isClock() const;  // true if clock
74   virtual const bool isRare() const;   // true if medium rare or raw
75 
76   // This is called by subclasses to hook up the dismiss button, the help
77   // button, and the options menu.  Requires containerType != noContainer.
78   // Forms must pass the widgets above and to the left for layout purposes.
79   void addNormalButtons (Widget northWidget = NULL, Widget westWidget = NULL);
80 
81   virtual void redraw() = 0;
82 };
83 
84 // Cleanup2006 Done
85