Debian Codegraph @

src/resource.h

raw symbols ◀ ▶
Source reconstructed at patch state 1 of 3 — not the installed (fully patched) source.
3 Debian patches touch this file
1 /***************************************************************************
2 resource.h
3 -------------------
4 Global application resources. Constants, enumerations and strings.
5 -------------------
6 Copyright 2006-2008 David Johnson
7 All rights reserved.
8
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions
11 are met:
12
13 1. Redistributions of source code must retain the above copyright
14 notice, this list of conditions and the following disclaimer.
15
16 2. Redistributions in binary form must reproduce the above copyright
17 notice, this list of conditions and the following disclaimer in the
18 documentation and/or other materials provided with the distribution.
19
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 ***************************************************************************/
32
33 #ifndef RESOURCE_H
34 #define RESOURCE_H
35
36 #include <QDebug>
37 #include <QString>
38
39 #define PACKAGE "qbrew"
40 #define VERSION "0.4.1"
41
42 // some stuff to differentiate between platforms
43 #if defined(Q_WS_X11)
44 #define QDIR_HOME QDir::homePath()
45 #elif defined(Q_WS_MACX)
46 #define QDIR_HOME QDir::homePath()
47 #else
48 #define QDIR_HOME QDir::currentPath()
49 #endif
50
51 namespace Resource {
52
53 ///////////////////////////////////////////////////////////////////
54 // general application values
55
56 const QByteArray TITLE = "QBrew";
57 const QByteArray DESCRIPTION = QT_TRANSLATE_NOOP("description",
58 "A Homebrewer's Recipe Calculator");
59 const QByteArray COPYRIGHT = QT_TRANSLATE_NOOP("copyright",
60 "Copyright 1999-2008");
61 const QByteArray AUTHOR = "David Johnson";
62 const QByteArray AUTHOR_EMAIL = "[email protected]";
63 const QByteArray CONTRIBUTORS = "Lee Henderson, "
64 "Rob Hudson, "
65 "Abe Kabakoff, "
66 "Stephen Lowrie, "
67 "Michal Palczewski, "
68 "Kevin Pullin, "
69 "Dr. Tobias Quathamer";
70
71 const QByteArray READY = QT_TRANSLATE_NOOP("message",
72 "Ready");
73
74 const QChar DEGREE = QChar(0xB0); // ISO 8859-1
75
76 ///////////////////////////////////////////////////////////////////
77 // file locations and stuff
78
79 const QByteArray FILE_EXT = PACKAGE;
80 const QByteArray FILE_FILTER = QT_TRANSLATE_NOOP("file filter",
81 "QBrew files (*.qbrew)");
82 const QByteArray TEXT_FILTER = QT_TRANSLATE_NOOP("file filter",
83 "Text files (*.txt)");
84 const QByteArray HTML_FILTER = QT_TRANSLATE_NOOP("file filter",
85 "HTML files (*.html *.htm)");
86 const QByteArray BEERXML_FILTER = QT_TRANSLATE_NOOP("file filter",
87 "BeerXML recipes (*.xml)");
88 const QByteArray PDF_FILTER = QT_TRANSLATE_NOOP("file filter",
89 "PDF files (*.pdf)");
90 const QByteArray ALL_FILTER = QT_TRANSLATE_NOOP("file filter",
91 "All files (*)");
92 const QByteArray OPEN_FILTER = QT_TRANSLATE_NOOP("file filter",
93 FILE_FILTER + ";;"
94 + BEERXML_FILTER + ";;"
95 + ALL_FILTER);
96 const QByteArray SAVE_FILTER = QT_TRANSLATE_NOOP("file filter",
97 FILE_FILTER + ";;"
98 + ALL_FILTER);
99 const QByteArray EXPORT_FILTER = QT_TRANSLATE_NOOP("file filter",
100 HTML_FILTER + ";;"
101 + BEERXML_FILTER + ";;"
102 + PDF_FILTER + ";;"
103 + TEXT_FILTER);
104
105 const QByteArray DATA_FILE = "qbrewdata";
106 const QByteArray HELP_FILE = "handbook-index.html";
107 const QByteArray PRIMER_FILE = "primer.html";
108 const QByteArray DEFAULT_FILE = QT_TRANSLATE_NOOP("file name", "untitled");
109
110 // previous valid data formats
111 const QByteArray RECIPE_PREVIOUS = "0.1.7";
112 const QByteArray DATA_PREVIOUS = "0.3.0";
113
114 ///////////////////////////////////////////////////////////////////
115 // configuration strings
116
117 const QByteArray CONFGROUP_WINDOW = "/window";
118 const QByteArray CONF_WIN_STATUSBAR = "/statusbar";
119 const QByteArray CONF_WIN_MAINWINDOW = "/mainwindow";
120 const QByteArray CONF_WIN_SIZE = "/size";
121
122 const QByteArray CONFGROUP_GENERAL = "/general";
123 const QByteArray CONF_GEN_LOOK_FEEL = "/lookfeel";
124 const QByteArray CONF_GEN_SHOW_SPLASH = "/showsplash";
125 const QByteArray CONF_GEN_AUTOSAVE = "/autosave";
126 const QByteArray CONF_GEN_SAVEINTERVAL = "/saveinterval";
127 const QByteArray CONF_GEN_AUTOBACKUP = "/autobackup";
128 const QByteArray CONF_GEN_LOADLAST = "/loadlast";
129 const QByteArray CONF_GEN_RECENTFILES = "/recentfiles";
130 const QByteArray CONF_GEN_RECENTNUM = "/recentnum";
131
132 const QByteArray CONFGROUP_RECIPE = "/recipedefaults";
133 const QByteArray CONF_RECIPE_BATCH = "/batch";
134 const QByteArray CONF_RECIPE_STYLE = "/style";
135 const QByteArray CONF_RECIPE_HOPFORM = "/hopform"; // TODO: deprecated 0.4.0
136 const QByteArray CONF_RECIPE_HOPTYPE = "/hoptype";
137
138 const QByteArray CONFGROUP_CALC = "/calc";
139 const QByteArray CONF_CALC_STEEPYIELD = "/steepyield";
140 const QByteArray CONF_CALC_EFFICIENCY = "/efficiency";
141 const QByteArray CONF_CALC_MOREY = "/morey";
142 const QByteArray CONF_CALC_TINSETH = "/tinseth";
143 const QByteArray CONF_CALC_UNITS = "/units";
144
145 //////////////////////////////////////////////////////////////////////////////
146 // XML Format Strings (need to be QString)
147
148 const QString tagRecipe = "recipe";
149 const QString attrApplication = "application";
150 const QString attrGenerator = "generator";
151 const QString tagTitle = "title";
152 const QString tagBrewer = "brewer";
153 const QString tagBatch = "batch";
154 const QString tagNotes = "notes";
155 const QString attrClass = "class";
156 const QString classRecipe = tagRecipe;
157 const QString classBatch = tagBatch;
158
159 const QString tagDoc = "qbrewdata";
160 const QString attrVersion = "version";
161 const QString tagStyles = "styles";
162 const QString tagStyle = "style";
163 const QString attrOGLow = "oglow";
164 const QString attrOGHigh = "oghigh";
165 const QString attrFGLow = "fglow";
166 const QString attrFGHigh = "fghigh";
167 const QString attrIBULow = "ibulow";
168 const QString attrIBUHigh = "ibuhigh";
169 const QString attrSRMLow = "srmlow";
170 const QString attrSRMHigh = "srmhigh";
171 const QString tagGrains = "grains";
172 const QString tagGrain = "grain";
173 const QString attrQuantity = "quantity";
174 const QString attrSize = "size"; // TODO: deprecated
175 const QString attrExtract = "extract";
176 const QString attrColor = "color";
177 const QString attrType = "type";
178 const QString attrUse = "use";
179 const QString tagHops = "hops";
180 const QString tagHop = "hop";
181 const QString attrForm = "form";
182 const QString attrAlpha = "alpha";
183 const QString attrTime = "time";
184 const QString tagMiscs = "miscingredients"; // TODO: rename
185 const QString tagMisc = "miscingredient";
186 const QString attrNotes = "notes";
187 const QString tagUtilization = "utilization";
188 const QString tagEntry = "entry";
189 const QString attrUtil = "util";
190
191 // BeerXML Format Strings
192
193 // TODO: see if I can use lowercase, converting on the fly during import/export
194 const QString beerXMLVersion = "1";
195 const QString tagRECIPES = "RECIPES";
196 const QString tagRECIPE = "RECIPE";
197 const QString tagNAME = "NAME";
198 const QString tagVERSION = "VERSION";
199 const QString tagTYPE = "TYPE";
200 const QString tagSTYLE = "STYLE";
201 const QString tagBREWER = "BREWER";
202 const QString tagBATCHSIZE = "BATCH_SIZE";
203 const QString tagEFFICIENCY = "EFFICIENCY";
204 const QString tagFERMENTABLES = "FERMENTABLES";
205 const QString tagFERMENTABLE = "FERMENTABLE";
206 const QString tagHOPS = "HOPS";
207 const QString tagHOP = "HOP";
208 const QString tagYEASTS = "YEASTS";
209 const QString tagYEAST = "YEAST";
210 const QString tagMISCS = "MISCS";
211 const QString tagMISC = "MISC";
212 const QString tagNOTES = "NOTES";
213 const QString tagTASTENOTES = "TASTE_NOTES";
214 const QString tagWATERS = "WATERS";
215
216 const QString tagOGMIN = "OG_MIN";
217 const QString tagOGMAX = "OG_MAX";
218 const QString tagFGMIN = "FG_MIN";
219 const QString tagFGMAX = "FG_MAX";
220 const QString tagIBUMIN = "IBU_MIN";
221 const QString tagIBUMAX = "IBU_MAX";
222 const QString tagCOLORMIN = "COLOR_MIN";
223 const QString tagCOLORMAX = "COLOR_MAX";
224
225 const QString tagAMOUNT = "AMOUNT";
226 const QString tagAMOUNTISWEIGHT = "AMOUNT_IS_WEIGHT";
227 const QString tagYIELD = "YIELD";
228 const QString tagCOLOR = "COLOR";
229
230 const QString tagALPHA = "ALPHA";
231 const QString tagUSE = "USE";
232 const QString tagTIME = "TIME";
233 const QString tagFORM = "FORM";
234
235 ///////////////////////////////////////////////////////////////////
236 // Misc
237
238 const QByteArray UNIT_METRIC = QT_TRANSLATE_NOOP("units", "Metric");
239 const QByteArray UNIT_US = QT_TRANSLATE_NOOP("units", "US");
240
241 }; // namespace Resource
242
243 #endif // RESOURCE_H