00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00029 #ifndef _GG_StyleFactory_h_
00030 #define _GG_StyleFactory_h_
00031
00032 #include <GG/ClrConstants.h>
00033 #include <GG/DynamicGraphic.h>
00034 #include <GG/FontFwd.h>
00035 #include <GG/MultiEditFwd.h>
00036
00037
00038 namespace GG {
00039
00040 class Button;
00041 class ColorDlg;
00042 class DropDownList;
00043 class DynamicGraphic;
00044 class FileDlg;
00045 class Edit;
00046 class Font;
00047 class ListBox;
00048 class MenuBar;
00049 class MultiEdit;
00050 class RadioButtonGroup;
00051 class Scroll;
00052 class Slider;
00053 template <class T>
00054 class Spin;
00055 class StateButton;
00056 class StaticGraphic;
00057 class TabBar;
00058 class TabWnd;
00059 class TextControl;
00060 class Texture;
00061 class ThreeButtonDlg;
00062 struct UnicodeCharset;
00063
00078 class GG_API StyleFactory
00079 {
00080 public:
00082 StyleFactory();
00083 virtual ~StyleFactory();
00084
00085
00088 virtual boost::shared_ptr<Font> DefaultFont(unsigned int pts = 12) const;
00089
00093 virtual boost::shared_ptr<Font> DefaultFont(unsigned int pts,
00094 const UnicodeCharset* first,
00095 const UnicodeCharset* last) const;
00096
00098
00099 virtual Button* NewButton(X x, Y y, X w, Y h, const std::string& str,
00100 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00101 Flags<WndFlag> flags = INTERACTIVE) const;
00102
00104 virtual StateButton* NewStateButton(X x, Y y, X w, Y h, const std::string& str,
00105 const boost::shared_ptr<Font>& font, Flags<TextFormat> format, Clr color,
00106 Clr text_color = CLR_BLACK, Clr interior = CLR_ZERO,
00107 StateButtonStyle style = SBSTYLE_3D_XBOX, Flags<WndFlag> flags = INTERACTIVE) const;
00108
00110 virtual RadioButtonGroup* NewRadioButtonGroup(X x, Y y, X w, Y h, Orientation orientation) const;
00111
00113 virtual DropDownList* NewDropDownList(X x, Y y, X w, Y h, Y drop_ht, Clr color,
00114 Flags<WndFlag> flags = INTERACTIVE) const;
00115
00117 virtual DynamicGraphic* NewDynamicGraphic(X x, Y y, X w, Y h, bool loop, X frame_width, Y frame_height,
00118 int margin, const std::vector<boost::shared_ptr<Texture> >& textures,
00119 Flags<GraphicStyle> style = GRAPHIC_NONE, int frames = DynamicGraphic::ALL_FRAMES,
00120 Flags<WndFlag> flags = Flags<WndFlag>()) const;
00121
00123 virtual Edit* NewEdit(X x, Y y, X w, const std::string& str, const boost::shared_ptr<Font>& font,
00124 Clr color, Clr text_color = CLR_BLACK, Clr interior = CLR_ZERO,
00125 Flags<WndFlag> flags = INTERACTIVE) const;
00126
00128 virtual ListBox* NewListBox(X x, Y y, X w, Y h, Clr color, Clr interior = CLR_ZERO,
00129 Flags<WndFlag> flags = INTERACTIVE) const;
00130
00132 virtual MenuBar* NewMenuBar(X x, Y y, X w, const boost::shared_ptr<Font>& font,
00133 Clr text_color = CLR_WHITE, Clr color = CLR_BLACK,
00134 Clr interior = CLR_SHADOW) const;
00135
00137 virtual MultiEdit* NewMultiEdit(X x, Y y, X w, Y h, const std::string& str,
00138 const boost::shared_ptr<Font>& font, Clr color, Flags<MultiEditStyle> style = MULTI_LINEWRAP,
00139 Clr text_color = CLR_BLACK, Clr interior = CLR_ZERO,
00140 Flags<WndFlag> flags = INTERACTIVE) const;
00141
00143 virtual Scroll* NewScroll(X x, Y y, X w, Y h, Orientation orientation, Clr color, Clr interior,
00144 Flags<WndFlag> flags = INTERACTIVE | REPEAT_BUTTON_DOWN) const;
00145
00147 virtual Slider* NewSlider(X x, Y y, X w, Y h, int min, int max, Orientation orientation,
00148 SliderLineStyle style, Clr color, int tab_width, int line_width = 5,
00149 Flags<WndFlag> flags = INTERACTIVE) const;
00150
00152 virtual Spin<int>* NewIntSpin(X x, Y y, X w, int value, int step, int min, int max, bool edits,
00153 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00154 Clr interior = CLR_ZERO, Flags<WndFlag> flags = INTERACTIVE) const;
00155
00157 virtual Spin<double>* NewDoubleSpin(X x, Y y, X w, double value, double step, double min, double max, bool edits,
00158 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00159 Clr interior = CLR_ZERO, Flags<WndFlag> flags = INTERACTIVE) const;
00160
00162 virtual StaticGraphic* NewStaticGraphic(X x, Y y, X w, Y h, const boost::shared_ptr<Texture>& texture,
00163 Flags<GraphicStyle> style = GRAPHIC_NONE, Flags<WndFlag> flags = Flags<WndFlag>()) const;
00164
00166 virtual TabBar* NewTabBar(X x, Y y, X w, const boost::shared_ptr<Font>& font, Clr color,
00167 Clr text_color = CLR_BLACK, TabBarStyle style = TAB_BAR_ATTACHED,
00168 Flags<WndFlag> flags = INTERACTIVE) const;
00169
00171 virtual TextControl* NewTextControl(X x, Y y, X w, Y h, const std::string& str,
00172 const boost::shared_ptr<Font>& font, Clr color = CLR_BLACK,
00173 Flags<TextFormat> format = FORMAT_NONE, Flags<WndFlag> flags = Flags<WndFlag>()) const;
00174
00176 virtual TextControl* NewTextControl(X x, Y y, const std::string& str, const boost::shared_ptr<Font>& font,
00177 Clr color = CLR_BLACK, Flags<TextFormat> format = FORMAT_NONE,
00178 Flags<WndFlag> flags = Flags<WndFlag>()) const;
00180
00182
00183 virtual ListBox* NewDropDownListListBox(X x, Y y, X w, Y h, Clr color, Clr interior = CLR_ZERO,
00184 Flags<WndFlag> flags = INTERACTIVE) const;
00185
00187 virtual Scroll* NewListBoxVScroll(X x, Y y, X w, Y h, Clr color, Clr interior,
00188 Flags<WndFlag> flags = INTERACTIVE | REPEAT_BUTTON_DOWN) const;
00189
00191 virtual Scroll* NewListBoxHScroll(X x, Y y, X w, Y h, Clr color, Clr interior,
00192 Flags<WndFlag> flags = INTERACTIVE | REPEAT_BUTTON_DOWN) const;
00193
00195 virtual Scroll* NewMultiEditVScroll(X x, Y y, X w, Y h, Clr color, Clr interior,
00196 Flags<WndFlag> flags = INTERACTIVE | REPEAT_BUTTON_DOWN) const;
00197
00199 virtual Scroll* NewMultiEditHScroll(X x, Y y, X w, Y h, Clr color, Clr interior,
00200 Flags<WndFlag> flags = INTERACTIVE | REPEAT_BUTTON_DOWN) const;
00201
00203 virtual Button* NewScrollUpButton(X x, Y y, X w, Y h, const std::string& str,
00204 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00205 Flags<WndFlag> flags = INTERACTIVE | REPEAT_BUTTON_DOWN) const;
00206
00208 virtual Button* NewScrollDownButton(X x, Y y, X w, Y h, const std::string& str,
00209 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00210 Flags<WndFlag> flags = INTERACTIVE | REPEAT_BUTTON_DOWN) const;
00211
00213 virtual Button* NewVScrollTabButton(X x, Y y, X w, Y h, const std::string& str,
00214 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00215 Flags<WndFlag> flags = INTERACTIVE) const;
00216
00218 virtual Button* NewScrollLeftButton(X x, Y y, X w, Y h, const std::string& str,
00219 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00220 Flags<WndFlag> flags = INTERACTIVE | REPEAT_BUTTON_DOWN) const;
00221
00223 virtual Button* NewScrollRightButton(X x, Y y, X w, Y h, const std::string& str,
00224 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00225 Flags<WndFlag> flags = INTERACTIVE | REPEAT_BUTTON_DOWN) const;
00226
00228 virtual Button* NewHScrollTabButton(X x, Y y, X w, Y h, const std::string& str,
00229 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00230 Flags<WndFlag> flags = INTERACTIVE) const;
00231
00233 virtual Button* NewVSliderTabButton(X x, Y y, X w, Y h, const std::string& str,
00234 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00235 Flags<WndFlag> flags = INTERACTIVE) const;
00236
00238 virtual Button* NewHSliderTabButton(X x, Y y, X w, Y h, const std::string& str,
00239 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00240 Flags<WndFlag> flags = INTERACTIVE) const;
00241
00243 virtual Button* NewSpinIncrButton(X x, Y y, X w, Y h, const std::string& str,
00244 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00245 Flags<WndFlag> flags = INTERACTIVE | REPEAT_BUTTON_DOWN) const;
00246
00248 virtual Button* NewSpinDecrButton(X x, Y y, X w, Y h, const std::string& str,
00249 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00250 Flags<WndFlag> flags = INTERACTIVE | REPEAT_BUTTON_DOWN) const;
00251
00253 virtual Edit* NewSpinEdit(X x, Y y, X w, const std::string& str, const boost::shared_ptr<Font>& font,
00254 Clr color, Clr text_color = CLR_BLACK, Clr interior = CLR_ZERO,
00255 Flags<WndFlag> flags = INTERACTIVE) const;
00256
00258 virtual StateButton* NewTabBarTab(X x, Y y, X w, Y h, const std::string& str,
00259 const boost::shared_ptr<Font>& font, Flags<TextFormat> format, Clr color,
00260 Clr text_color = CLR_BLACK, Clr interior = CLR_ZERO,
00261 StateButtonStyle style = SBSTYLE_3D_TOP_ATTACHED_TAB, Flags<WndFlag> flags = INTERACTIVE) const;
00262
00264 virtual Button* NewTabBarLeftButton(X x, Y y, X w, Y h, const std::string& str,
00265 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00266 Flags<WndFlag> flags = INTERACTIVE) const;
00267
00269 virtual Button* NewTabBarRightButton(X x, Y y, X w, Y h, const std::string& str,
00270 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00271 Flags<WndFlag> flags = INTERACTIVE) const;
00273
00275
00276 virtual TabWnd* NewTabWnd(X x, Y y, X w, Y h, const boost::shared_ptr<Font>& font, Clr color,
00277 Clr text_color = CLR_BLACK, TabBarStyle style = TAB_BAR_ATTACHED,
00278 Flags<WndFlag> flags = INTERACTIVE | DRAGABLE) const;
00280
00282
00283 virtual ColorDlg* NewColorDlg(X x, Y y, const boost::shared_ptr<Font>& font,
00284 Clr dialog_color, Clr border_color, Clr text_color = CLR_BLACK) const;
00285
00287 virtual ColorDlg* NewColorDlg(X x, Y y, Clr original_color, const boost::shared_ptr<Font>& font,
00288 Clr dialog_color, Clr border_color, Clr text_color = CLR_BLACK) const;
00289
00291 virtual FileDlg* NewFileDlg(const std::string& directory, const std::string& filename, bool save, bool multi,
00292 const boost::shared_ptr<Font>& font, Clr color, Clr border_color,
00293 Clr text_color = CLR_BLACK) const;
00294
00296 virtual ThreeButtonDlg* NewThreeButtonDlg(X x, Y y, X w, Y h, const std::string& msg,
00297 const boost::shared_ptr<Font>& font, Clr color, Clr border_color,
00298 Clr button_color, Clr text_color, int buttons, const std::string& zero = "",
00299 const std::string& one = "", const std::string& two = "") const;
00300
00303 virtual ThreeButtonDlg* NewThreeButtonDlg(X w, Y h, const std::string& msg, const boost::shared_ptr<Font>& font,
00304 Clr color, Clr border_color, Clr button_color, Clr text_color, int buttons,
00305 const std::string& zero = "", const std::string& one = "",
00306 const std::string& two = "") const;
00308
00311 virtual void DeleteWnd(Wnd* wnd) const;
00312
00314 static const std::string& DefaultFontName();
00315
00316 template <class Archive>
00317 void serialize(Archive& ar, const unsigned int version) {}
00318 };
00319
00320 }
00321
00322 #endif // _GG_StyleFactory_h_