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/Font.h>
00033 #include <GG/MultiEdit.h>
00034 #include <GG/StaticGraphic.h>
00035
00036
00037 namespace GG {
00038
00039 class Button;
00040 class ColorDlg;
00041 class DropDownList;
00042 class DynamicGraphic;
00043 class FileDlg;
00044 class ListBox;
00045 class MenuBar;
00046 class RadioButtonGroup;
00047 class Scroll;
00048 class Slider;
00049 template <class T>
00050 class Spin;
00051 class StateButton;
00052 class TabBar;
00053 class TabWnd;
00054 class TextControl;
00055 class Texture;
00056 class ThreeButtonDlg;
00057
00066 class GG_API StyleFactory
00067 {
00068 public:
00070 StyleFactory();
00071 virtual ~StyleFactory();
00072
00073
00075
00076 virtual Button* NewButton(int x, int y, int w, int h, const std::string& str,
00077 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00078 Flags<WndFlag> flags = CLICKABLE) const;
00079
00081 virtual StateButton* NewStateButton(int x, int y, int w, int h, const std::string& str,
00082 const boost::shared_ptr<Font>& font, Flags<TextFormat> format, Clr color,
00083 Clr text_color = CLR_BLACK, Clr interior = CLR_ZERO,
00084 StateButtonStyle style = SBSTYLE_3D_XBOX, Flags<WndFlag> flags = CLICKABLE) const;
00085
00087 virtual RadioButtonGroup* NewRadioButtonGroup(int x, int y, int w, int h, Orientation orientation) const;
00088
00090 virtual DropDownList* NewDropDownList(int x, int y, int w, int h, int drop_ht, Clr color,
00091 Flags<WndFlag> flags = CLICKABLE) const;
00092
00094 virtual DynamicGraphic* NewDynamicGraphic(int x, int y, int w, int h, bool loop, int frame_width, int frame_height,
00095 int margin, const std::vector<boost::shared_ptr<Texture> >& textures,
00096 Flags<GraphicStyle> style = GRAPHIC_NONE, int frames = -1, Flags<WndFlag> flags = Flags<WndFlag>()) const;
00097
00099 virtual Edit* NewEdit(int x, int y, int w, const std::string& str, const boost::shared_ptr<Font>& font,
00100 Clr color, Clr text_color = CLR_BLACK, Clr interior = CLR_ZERO,
00101 Flags<WndFlag> flags = CLICKABLE) const;
00102
00104 virtual ListBox* NewListBox(int x, int y, int w, int h, Clr color, Clr interior = CLR_ZERO,
00105 Flags<WndFlag> flags = CLICKABLE) const;
00106
00108 virtual MenuBar* NewMenuBar(int x, int y, int w, const boost::shared_ptr<Font>& font,
00109 Clr text_color = CLR_WHITE, Clr color = CLR_BLACK,
00110 Clr interior = CLR_SHADOW) const;
00111
00113 virtual MultiEdit* NewMultiEdit(int x, int y, int w, int h, const std::string& str,
00114 const boost::shared_ptr<Font>& font, Clr color, Flags<MultiEditStyle> style = MULTI_LINEWRAP,
00115 Clr text_color = CLR_BLACK, Clr interior = CLR_ZERO,
00116 Flags<WndFlag> flags = CLICKABLE) const;
00117
00119 virtual Scroll* NewScroll(int x, int y, int w, int h, Orientation orientation, Clr color, Clr interior,
00120 Flags<WndFlag> flags = CLICKABLE | REPEAT_BUTTON_DOWN) const;
00121
00123 virtual Slider* NewSlider(int x, int y, int w, int h, int min, int max, Orientation orientation,
00124 SliderLineStyle style, Clr color, int tab_width, int line_width = 5,
00125 Flags<WndFlag> flags = CLICKABLE) const;
00126
00128 virtual Spin<int>* NewIntSpin(int x, int y, int w, int value, int step, int min, int max, bool edits,
00129 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00130 Clr interior = CLR_ZERO, Flags<WndFlag> flags = CLICKABLE) const;
00131
00133 virtual Spin<double>* NewDoubleSpin(int x, int y, int w, double value, double step, double min, double max, bool edits,
00134 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00135 Clr interior = CLR_ZERO, Flags<WndFlag> flags = CLICKABLE) const;
00136
00138 virtual StaticGraphic* NewStaticGraphic(int x, int y, int w, int h, const boost::shared_ptr<Texture>& texture,
00139 Flags<GraphicStyle> style = GRAPHIC_NONE, Flags<WndFlag> flags = Flags<WndFlag>()) const;
00140
00142 virtual TabBar* NewTabBar(int x, int y, int w, const boost::shared_ptr<Font>& font, Clr color,
00143 Clr text_color = CLR_BLACK, TabBarStyle style = TAB_BAR_ATTACHED,
00144 Flags<WndFlag> flags = CLICKABLE) const;
00145
00147 virtual TextControl* NewTextControl(int x, int y, int w, int h, const std::string& str,
00148 const boost::shared_ptr<Font>& font, Clr color = CLR_BLACK,
00149 Flags<TextFormat> format = FORMAT_NONE, Flags<WndFlag> flags = Flags<WndFlag>()) const;
00150
00152 virtual TextControl* NewTextControl(int x, int y, const std::string& str, const boost::shared_ptr<Font>& font,
00153 Clr color = CLR_BLACK, Flags<TextFormat> format = FORMAT_NONE,
00154 Flags<WndFlag> flags = Flags<WndFlag>()) const;
00156
00158
00159 virtual ListBox* NewDropDownListListBox(int x, int y, int w, int h, Clr color, Clr interior = CLR_ZERO,
00160 Flags<WndFlag> flags = CLICKABLE) const;
00161
00163 virtual Scroll* NewListBoxVScroll(int x, int y, int w, int h, Clr color, Clr interior,
00164 Flags<WndFlag> flags = CLICKABLE | REPEAT_BUTTON_DOWN) const;
00165
00167 virtual Scroll* NewListBoxHScroll(int x, int y, int w, int h, Clr color, Clr interior,
00168 Flags<WndFlag> flags = CLICKABLE | REPEAT_BUTTON_DOWN) const;
00169
00171 virtual Scroll* NewMultiEditVScroll(int x, int y, int w, int h, Clr color, Clr interior,
00172 Flags<WndFlag> flags = CLICKABLE | REPEAT_BUTTON_DOWN) const;
00173
00175 virtual Scroll* NewMultiEditHScroll(int x, int y, int w, int h, Clr color, Clr interior,
00176 Flags<WndFlag> flags = CLICKABLE | REPEAT_BUTTON_DOWN) const;
00177
00179 virtual Button* NewScrollUpButton(int x, int y, int w, int h, const std::string& str,
00180 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00181 Flags<WndFlag> flags = CLICKABLE | REPEAT_BUTTON_DOWN) const;
00182
00184 virtual Button* NewScrollDownButton(int x, int y, int w, int h, const std::string& str,
00185 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00186 Flags<WndFlag> flags = CLICKABLE | REPEAT_BUTTON_DOWN) const;
00187
00189 virtual Button* NewVScrollTabButton(int x, int y, int w, int h, const std::string& str,
00190 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00191 Flags<WndFlag> flags = CLICKABLE) const;
00192
00194 virtual Button* NewScrollLeftButton(int x, int y, int w, int h, const std::string& str,
00195 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00196 Flags<WndFlag> flags = CLICKABLE | REPEAT_BUTTON_DOWN) const;
00197
00199 virtual Button* NewScrollRightButton(int x, int y, int w, int h, const std::string& str,
00200 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00201 Flags<WndFlag> flags = CLICKABLE | REPEAT_BUTTON_DOWN) const;
00202
00204 virtual Button* NewHScrollTabButton(int x, int y, int w, int h, const std::string& str,
00205 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00206 Flags<WndFlag> flags = CLICKABLE) const;
00207
00209 virtual Button* NewVSliderTabButton(int x, int y, int w, int h, const std::string& str,
00210 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00211 Flags<WndFlag> flags = CLICKABLE) const;
00212
00214 virtual Button* NewHSliderTabButton(int x, int y, int w, int h, const std::string& str,
00215 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00216 Flags<WndFlag> flags = CLICKABLE) const;
00217
00219 virtual Button* NewSpinIncrButton(int x, int y, int w, int h, const std::string& str,
00220 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00221 Flags<WndFlag> flags = CLICKABLE | REPEAT_BUTTON_DOWN) const;
00222
00224 virtual Button* NewSpinDecrButton(int x, int y, int w, int h, const std::string& str,
00225 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00226 Flags<WndFlag> flags = CLICKABLE | REPEAT_BUTTON_DOWN) const;
00227
00229 virtual Edit* NewSpinEdit(int x, int y, int w, const std::string& str, const boost::shared_ptr<Font>& font,
00230 Clr color, Clr text_color = CLR_BLACK, Clr interior = CLR_ZERO,
00231 Flags<WndFlag> flags = CLICKABLE) const;
00232
00234 virtual StateButton* NewTabBarTab(int x, int y, int w, int h, const std::string& str,
00235 const boost::shared_ptr<Font>& font, Flags<TextFormat> format, Clr color,
00236 Clr text_color = CLR_BLACK, Clr interior = CLR_ZERO,
00237 StateButtonStyle style = SBSTYLE_3D_TOP_ATTACHED_TAB, Flags<WndFlag> flags = CLICKABLE) const;
00238
00240 virtual Button* NewTabBarLeftButton(int x, int y, int w, int h, const std::string& str,
00241 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00242 Flags<WndFlag> flags = CLICKABLE) const;
00243
00245 virtual Button* NewTabBarRightButton(int x, int y, int w, int h, const std::string& str,
00246 const boost::shared_ptr<Font>& font, Clr color, Clr text_color = CLR_BLACK,
00247 Flags<WndFlag> flags = CLICKABLE) const;
00249
00251
00252 virtual TabWnd* NewTabWnd(int x, int y, int w, int h, const boost::shared_ptr<Font>& font, Clr color,
00253 Clr text_color = CLR_BLACK, TabBarStyle style = TAB_BAR_ATTACHED,
00254 Flags<WndFlag> flags = CLICKABLE | DRAGABLE) const;
00256
00258
00259 virtual ColorDlg* NewColorDlg(int x, int y, const boost::shared_ptr<Font>& font,
00260 Clr dialog_color, Clr border_color, Clr text_color = CLR_BLACK) const;
00261
00263 virtual ColorDlg* NewColorDlg(int x, int y, Clr original_color, const boost::shared_ptr<Font>& font,
00264 Clr dialog_color, Clr border_color, Clr text_color = CLR_BLACK) const;
00265
00267 virtual FileDlg* NewFileDlg(const std::string& directory, const std::string& filename, bool save, bool multi,
00268 const boost::shared_ptr<Font>& font, Clr color, Clr border_color,
00269 Clr text_color = CLR_BLACK) const;
00270
00272 virtual ThreeButtonDlg* NewThreeButtonDlg(int x, int y, int w, int h, const std::string& msg,
00273 const boost::shared_ptr<Font>& font, Clr color, Clr border_color,
00274 Clr button_color, Clr text_color, int buttons, const std::string& zero = "",
00275 const std::string& one = "", const std::string& two = "") const;
00276
00278 virtual ThreeButtonDlg* NewThreeButtonDlg(int w, int h, const std::string& msg, const boost::shared_ptr<Font>& font,
00279 Clr color, Clr border_color, Clr button_color, Clr text_color, int buttons,
00280 const std::string& zero = "", const std::string& one = "",
00281 const std::string& two = "") const;
00283
00286 virtual void DeleteWnd(Wnd* wnd) const;
00287
00288 template <class Archive>
00289 void serialize(Archive& ar, const unsigned int version) {}
00290 };
00291
00292 }
00293
00294 #endif // _GG_StyleFactory_h_