Planeshift
|
00001 /* 00002 * Author: Andrew Robberts 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 EEDIT_INPUTBOX_MANAGER_HEADER 00021 #define EEDIT_INPUTBOX_MANAGER_HEADER 00022 00023 #include <csutil/csstring.h> 00024 #include <csgeom/vector3.h> 00025 00026 00027 class PawsManager; 00028 00029 class EEditSelectFloat; 00030 class EEditSelectString; 00031 class EEditSelectVec3; 00032 class EEditSelectYesNo; 00033 class EEditSelectList; 00034 class EEditSelectNewAnchor; 00035 class EEditSelectEditAnchor; 00036 class EEditSelectNewAnchorKeyFrame; 00037 00043 class EEditInputboxManager 00044 { 00045 public: 00046 EEditInputboxManager(); 00047 ~EEditInputboxManager(); 00048 00055 bool LoadWidgets(PawsManager * paws); 00056 00062 bool RegisterFactories() const; 00063 00064 // Select Float 00065 class iSelectFloat 00066 { 00067 public: 00068 virtual void Select(float value) = 0; 00069 virtual ~iSelectFloat() {}; 00070 }; 00071 void SelectFloat(float startValue, iSelectFloat * callback); 00072 00073 // Select String 00074 class iSelectString 00075 { 00076 public: 00077 virtual void Select(const csString & value) = 0; 00078 virtual ~iSelectString() {}; 00079 }; 00080 void SelectString(const csString & startValue, iSelectString * callback); 00081 00082 // Select 3D Vector 00083 class iSelectVec3 00084 { 00085 public: 00086 virtual void Select(const csVector3 & value) = 0; 00087 virtual ~iSelectVec3() {}; 00088 }; 00089 void SelectVec3(const csVector3 & startValue, iSelectVec3 * callback); 00090 00091 // Select YesNo 00092 class iSelectYesNo 00093 { 00094 public: 00095 virtual void Select(bool value) = 0; 00096 virtual ~iSelectYesNo() {}; 00097 }; 00098 void SelectYesNo(bool startValue, iSelectYesNo * callback); 00099 00100 // Select List 00101 class iSelectList 00102 { 00103 public: 00104 virtual void Select(const csString & value, size_t index) = 0; 00105 virtual ~iSelectList() {}; 00106 }; 00107 void SelectList(csString * list, size_t listCount, const csString & defaultValue, iSelectList * callback); 00108 00109 // Select NewAnchor 00110 class iSelectNewAnchor 00111 { 00112 public: 00113 virtual void Select(const csString & newName, const csString & newAnchorType) = 0; 00114 virtual ~iSelectNewAnchor() {}; 00115 }; 00116 void SelectNewAnchor(iSelectNewAnchor * callback); 00117 00118 // Select EditAnchor 00119 class iSelectEditAnchor 00120 { 00121 public: 00122 virtual void ChangeName(const csString & newName) = 0; 00123 virtual void DeleteAnchor() = 0; 00124 virtual ~iSelectEditAnchor() {}; 00125 }; 00126 void SelectEditAnchor(const csString & currName, iSelectEditAnchor * callback); 00127 00128 // Select NewAnchorKeyFrame 00129 class iSelectNewAnchorKeyFrame 00130 { 00131 public: 00132 virtual void Select(float newTime) = 0; 00133 virtual ~iSelectNewAnchorKeyFrame() {}; 00134 }; 00135 void SelectNewAnchorKeyFrame(iSelectNewAnchorKeyFrame * callback); 00136 00137 class iSelectEditAnchorKeyFrame 00138 { 00139 public: 00140 virtual void Select(float newTime) = 0; 00141 virtual ~iSelectEditAnchorKeyFrame() {}; 00142 }; 00143 00144 private: 00145 00146 EEditSelectFloat * selectFloat; 00147 EEditSelectString * selectString; 00148 EEditSelectVec3 * selectVec3; 00149 EEditSelectYesNo * selectYesNo; 00150 EEditSelectList * selectList; 00151 EEditSelectNewAnchor * selectNewAnchor; 00152 EEditSelectEditAnchor * selectEditAnchor; 00153 EEditSelectNewAnchorKeyFrame * selectNewAnchorKeyFrame; 00154 }; 00155 00158 #endif