00001 /* 00002 * The Mana World 00003 * Copyright (C) 2004 The Mana World Development Team 00004 * Copyright (C) 2009 Aethyra Development Team 00005 * 00006 * This file is part of The Mana World. 00007 * 00008 * This program is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 */ 00022 00023 #ifndef POPUP_H 00024 #define POPUP_H 00025 00026 #include "gui/widgets/container.h" 00027 00028 #include "configuration.h" 00029 #include "guichanfwd.h" 00030 00031 class Skin; 00032 class WindowContainer; 00033 00044 class Popup : public Container 00045 { 00046 public: 00055 Popup(const std::string &name = "", 00056 const std::string &skin = "graphics/gui/gui.xml"); 00057 00061 ~Popup(); 00062 00066 static void setWindowContainer(WindowContainer *windowContainer); 00067 00072 void loadPopupConfiguration(); 00073 00078 void savePopupConfiguration(); 00079 00083 void draw(gcn::Graphics *graphics); 00084 00088 void setContentSize(int width, int height); 00089 00093 void setLocationRelativeTo(gcn::Widget *widget); 00094 00098 void setMinWidth(int width); 00099 00100 int getMinWidth() const { return mMinWidth; } 00101 00105 void setMinHeight(int height); 00106 00107 int getMinHeight() const { return mMinHeight; } 00108 00112 void setMaxWidth(int width); 00113 00114 int getMaxWidth() const { return mMaxWidth; } 00115 00119 void setMaxHeight(int height); 00120 00121 int getMaxHeight() const { return mMaxHeight; } 00122 00130 int getPadding() const { return mPadding; } 00131 00132 void setPadding(int padding) { mPadding = padding; } 00133 00137 void setPopupName(const std::string &name) 00138 { mPopupName = name; } 00139 00140 const std::string &getPopupName() const 00141 { return mPopupName; } 00142 00147 void scheduleDelete(); 00148 00149 // Inherited from BasicContainer 00150 00151 virtual gcn::Rectangle getChildrenArea(); 00152 00153 private: 00154 std::string mPopupName; 00155 std::string mDefaultSkinPath; 00156 int mMinWidth; 00157 int mMinHeight; 00158 int mMaxWidth; 00159 int mMaxHeight; 00160 int mPadding; 00162 Skin *mSkin; 00163 }; 00164 00165 #endif