~scottydelicious666/brewtarget/brewtarget

« back to all changes in this revision

Viewing changes to MainWindow.h

  • Committer: Philip Greggory Lee
  • Date: 2009-08-23 16:53:43 UTC
  • Revision ID: git-v1:f8d1a25135bd92f06c46c562293800e4faa42c61
Made a src/ and ui/ directory and moved everything.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * MainWindow.h is part of Brewtarget, and is Copyright Philip G. Lee
3
 
 * (rocketman768@gmail.com), 2009.
4
 
 *
5
 
 * Brewtarget is free software: you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation, either version 3 of the License, or
8
 
 * (at your option) any later version.
9
 
 
10
 
 * Brewtarget is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 
 */
18
 
 
19
 
#ifndef _MAINWINDOW_H
20
 
#define _MAINWINDOW_H
21
 
 
22
 
class MainWindow;
23
 
 
24
 
#include <QWidget>
25
 
#include <QMainWindow>
26
 
#include <QString>
27
 
#include <QVariant>
28
 
#include <QFileDialog>
29
 
#include <QPalette>
30
 
#include <QCloseEvent>
31
 
#include "ui_mainWindow.h"
32
 
#include "FermentableDialog.h"
33
 
#include "HopDialog.h"
34
 
#include "MiscDialog.h"
35
 
#include "YeastDialog.h"
36
 
#include "AboutDialog.h"
37
 
#include "observable.h"
38
 
#include "recipe.h"
39
 
#include "BeerColorWidget.h"
40
 
#include "FermentableEditor.h"
41
 
#include "MiscEditor.h"
42
 
#include "HopEditor.h"
43
 
#include "YeastEditor.h"
44
 
#include "EquipmentEditor.h"
45
 
#include "StyleEditor.h"
46
 
#include "OptionDialog.h"
47
 
#include "MaltinessWidget.h"
48
 
#include "MashEditor.h"
49
 
#include "MashStepEditor.h"
50
 
#include "MashWizard.h"
51
 
#include "BrewDayWidget.h"
52
 
#include "HtmlViewer.h"
53
 
#include "ScaleRecipeTool.h"
54
 
#include "RecipeFormatter.h"
55
 
 
56
 
class MainWindow : public QMainWindow, public Ui::mainWindow, public Observer
57
 
{
58
 
   Q_OBJECT
59
 
 
60
 
   friend class OptionDialog;
61
 
public:
62
 
   MainWindow(QWidget* parent=0);
63
 
   void setRecipe(Recipe* recipe);
64
 
   virtual void notify(Observable* notifier, QVariant info = QVariant()); // Inherited from Observer
65
 
 
66
 
   static const char* homedir;
67
 
 
68
 
public slots:
69
 
   void save();
70
 
   void setRecipeByName(const QString& name);
71
 
   void clear();
72
 
 
73
 
   void updateRecipeName();
74
 
   void updateRecipeStyle();
75
 
   void updateRecipeEquipment(const QString&);
76
 
   void updateRecipeBatchSize();
77
 
   void updateRecipeBoilSize();
78
 
   void updateRecipeEfficiency();
79
 
   void updateRecipeStyle(const QString&);
80
 
 
81
 
   void addFermentableToRecipe(Fermentable* ferm);
82
 
   void removeSelectedFermentable();
83
 
   void editSelectedFermentable();
84
 
   void addHopToRecipe(Hop *hop);
85
 
   void removeSelectedHop();
86
 
   void editSelectedHop();
87
 
   void addMiscToRecipe(Misc* misc);
88
 
   void removeSelectedMisc();
89
 
   void editSelectedMisc();
90
 
   void addYeastToRecipe(Yeast* yeast);
91
 
   void removeSelectedYeast();
92
 
   void editSelectedYeast();
93
 
 
94
 
   void addMashStep();
95
 
   void removeSelectedMashStep();
96
 
   void editSelectedMashStep();
97
 
 
98
 
   void newRecipe();
99
 
   void removeRecipe();
100
 
   void exportRecipe();
101
 
   void importRecipes();
102
 
 
103
 
   void brewDayMode();
104
 
 
105
 
protected:
106
 
   virtual void closeEvent(QCloseEvent* event);
107
 
 
108
 
private:
109
 
   Recipe* recipeObs;
110
 
   AboutDialog* dialog_about;
111
 
   QFileDialog* fileOpener;
112
 
   QFileDialog* fileSaver;
113
 
   EquipmentEditor* equipEditor;
114
 
   FermentableDialog* fermDialog;
115
 
   FermentableEditor* fermEditor;
116
 
   HopDialog* hopDialog;
117
 
   HopEditor* hopEditor;
118
 
   MashEditor* mashEditor;
119
 
   MashStepEditor* mashStepEditor;
120
 
   MashWizard* mashWizard;
121
 
   MiscDialog* miscDialog;
122
 
   MiscEditor* miscEditor;
123
 
   StyleEditor* styleEditor;
124
 
   YeastDialog* yeastDialog;
125
 
   YeastEditor* yeastEditor;
126
 
   Database* db;
127
 
   BeerColorWidget beerColorWidget;
128
 
   OptionDialog* optionDialog;
129
 
   QPalette lcdPalette_old, lcdPalette_tooLow, lcdPalette_good, lcdPalette_tooHigh;
130
 
   MaltinessWidget* maltWidget;
131
 
   QDialog* brewDayDialog;
132
 
   BrewDayWidget* brewDayWidget;
133
 
   HtmlViewer* htmlViewer;
134
 
   ScaleRecipeTool* recipeScaler;
135
 
   RecipeFormatter* recipeFormatter;
136
 
 
137
 
   void setupToolbar();
138
 
   void showChanges();
139
 
};
140
 
 
141
 
#endif  /* _MAINWINDOW_H */
142