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 "lllineeditor.h"
00042
00043
00044 class LLNameEditor
00045 : public LLLineEditor
00046 {
00047 public:
00048 LLNameEditor(const std::string& name, const LLRect& rect,
00049 const LLUUID& name_id = LLUUID::null,
00050 BOOL is_group = FALSE,
00051 const LLFontGL* glfont = NULL,
00052 S32 max_text_length = 254,
00053 void (*commit_callback)(LLUICtrl* caller, void* user_data) = NULL,
00054 void (*keystroke_callback)(LLLineEditor* caller, void* user_data) = NULL,
00055 void (*focus_lost_callback)(LLFocusableElement* caller, void* user_data) = NULL,
00056 void* userdata = NULL,
00057 LLLinePrevalidateFunc prevalidate_func = NULL);
00058
00059
00060
00061
00062 virtual ~LLNameEditor();
00063
00064 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
00065
00066 void setNameID(const LLUUID& name_id, BOOL is_group);
00067
00068 void refresh(const LLUUID& id, const char* first, const char* last,
00069 BOOL is_group);
00070
00071 static void refreshAll(const LLUUID& id, const char* firstname,
00072 const char* lastname, BOOL is_group);
00073
00074
00075
00076 virtual void setValue( const LLSD& value );
00077 virtual LLSD getValue() const;
00078
00079 private:
00080 static std::set<LLNameEditor*> sInstances;
00081
00082 private:
00083 LLUUID mNameID;
00084
00085 };
00086
00087 #endif