00001
00032 #ifndef LL_LLNAMEEDITOR_H
00033 #define LL_LLNAMEEDITOR_H
00034
00035 #include <set>
00036
00037 #include "llview.h"
00038 #include "v4color.h"
00039 #include "llstring.h"
00040 #include "llfontgl.h"
00041 #include "linked_lists.h"
00042 #include "lllineeditor.h"
00043
00044
00045 class LLNameEditor
00046 : public LLLineEditor
00047 {
00048 public:
00049 LLNameEditor(const std::string& name, const LLRect& rect,
00050 const LLUUID& name_id = LLUUID::null,
00051 BOOL is_group = FALSE,
00052 const LLFontGL* glfont = NULL,
00053 S32 max_text_length = 254,
00054 void (*commit_callback)(LLUICtrl* caller, void* user_data) = NULL,
00055 void (*keystroke_callback)(LLLineEditor* caller, void* user_data) = NULL,
00056 void (*focus_lost_callback)(LLUICtrl* caller, void* user_data) = NULL,
00057 void* userdata = NULL,
00058 LLLinePrevalidateFunc prevalidate_func = NULL,
00059 LLViewBorder::EBevel border_bevel = LLViewBorder::BEVEL_IN,
00060 LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE,
00061 S32 border_thickness = 1);
00062
00063
00064
00065
00066 virtual ~LLNameEditor();
00067
00068 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
00069
00070 void setNameID(const LLUUID& name_id, BOOL is_group);
00071
00072 void refresh(const LLUUID& id, const char* first, const char* last,
00073 BOOL is_group);
00074
00075 static void refreshAll(const LLUUID& id, const char* firstname,
00076 const char* lastname, BOOL is_group);
00077
00078 virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_NAME_EDITOR; }
00079 virtual LLString getWidgetTag() const { return LL_NAME_EDITOR_TAG; }
00080
00081
00082 virtual void setValue( LLSD value );
00083 virtual LLSD getValue() const;
00084
00085 private:
00086 static std::set<LLNameEditor*> sInstances;
00087
00088 private:
00089 LLUUID mNameID;
00090
00091 };
00092
00093 #endif