Planeshift

pawsactivemagicwindow.h

Go to the documentation of this file.
00001 /*
00002  * pawsactivemagicwindow.h
00003  *
00004  * Copyright (C) 2003 Atomic Blue ([email protected], http://www.atomicblue.org)
00005  *
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation (version 2 of the License)
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  *
00018  */
00019 
00020 #ifndef PAWS_ACTIVEMAGIC_WINDOW_HEADER
00021 #define PAWS_ACTIVEMAGIC_WINDOW_HEADER
00022 
00023 #include "paws/pawswidget.h"
00024 class pawsTextBox;
00025 class pawsListBox;
00026 class pawsMessageTextBox;
00027 class pawsProgressBar;
00028 class pawsCheckBox;
00029 class pawsConfigPopup;
00030 
00031 #include "net/cmdbase.h"
00032 #include "net/subscriber.h"
00033 #include "gui/pawscontrolwindow.h"
00034 #include "gui/pawsscrollmenu.h"
00035 
00036 #define CONFIG_ACTIVEMAGIC_FILE_NAME       "/planeshift/userdata/options/activemagic.xml"
00037 #define CONFIG_ACTIVEMAGIC_FILE_NAME_DEF   "/planeshift/data/options/activemagic_def.xml"
00038 
00041 class pawsActiveMagicWindow : public pawsControlledWindow, public psClientNetSubscriber
00042 {
00043 public:
00044 
00045     pawsActiveMagicWindow();
00046     virtual ~pawsActiveMagicWindow() {}
00047 
00048     bool PostSetup();
00049     bool Setup(iDocumentNode* node);
00050 
00051     void HandleMessage(MsgEntry* me);
00052     void OnResize();
00053 
00054     virtual void Close();
00055     virtual void Hide();
00056     virtual void Show();
00057 
00061     bool LoadSetting();
00062 
00063     void SaveSetting();
00064 
00065     void AutoResize();
00066 
00071     pawsCheckBox*    showWindow;
00072 
00073     void SetUseImages( bool setting );
00074     bool GetUseImages();
00075 
00076     void SetAutoResize( bool setting );
00077     bool GetAutoResize();
00078 
00079     void SetShowEffects( bool setting );
00080     bool GetShowEffects();
00081 
00082     void SetShowWindow( bool setting );
00083     bool GetShowWindow();
00084 
00088     char const * GetFontName()
00089     {
00090         return fontName.GetData();
00091     }
00092 
00093     int GetWarnMode();
00094     void SetWarnMode(int i);
00095     float GetWarnLevel();
00096     void  SetWarnLevel(float val, bool low);
00097 
00098     int GetDangerMode();
00099     void SetDangerMode(int i);
00100     float GetDangerLevel();
00101     void  SetDangerLevel(float val, bool low);
00102 
00103     int GetFlashMode();
00104     void SetFlashMode(int i);
00105     float GetFlashLevel();
00106     void  SetFlashLevel(float val, bool low);
00107 
00108 
00109 private:
00110 
00111     csRef<iVFS> vfs;
00112 
00113     bool useImages,
00114          useTimers,
00115          autoResize,
00116          showEffects,
00117          show;   
00118 
00119 
00120     bool warnLow,
00121          dangerLow,
00122          flashLow;
00123 
00124     float warnLevel,
00125           dangerLevel,
00126           flashLevel;
00127 
00128     int warnMode,
00129         dangerMode,
00130         flashMode;
00131 
00132     pawsScrollMenu*  buffList;
00133     uint32_t         lastIndex;    
00134 
00135     pawsConfigPopup* configPopup;  
00136 
00137     int  Orientation;
00138 
00139 
00140 };
00141 
00142 CREATE_PAWS_FACTORY(pawsActiveMagicWindow);
00143 
00144 #endif