llviewertexteditor.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_VIEWERTEXTEDITOR_H
00033 #define LL_VIEWERTEXTEDITOR_H
00034 
00035 #include "lltexteditor.h"
00036 
00037 
00038 //
00039 // Classes
00040 //
00041 class LLViewerTextEditor : public LLTextEditor
00042 {
00043         
00044 public:
00045         LLViewerTextEditor(const LLString& name,
00046                                            const LLRect& rect,
00047                                            S32 max_length,
00048                                            const LLString& default_text = LLString(),
00049                                            const LLFontGL* glfont = NULL,
00050                                            BOOL allow_embedded_items = FALSE);
00051 
00052         virtual ~LLViewerTextEditor();
00053 
00054         virtual void makePristine();
00055         
00056         static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
00057 
00058         // mousehandler overrides
00059         virtual BOOL    handleMouseDown(S32 x, S32 y, MASK mask);
00060         virtual BOOL    handleMouseUp(S32 x, S32 y, MASK mask);
00061         virtual BOOL    handleRightMouseDown(S32 x, S32 y, MASK mask);
00062         virtual BOOL    handleHover(S32 x, S32 y, MASK mask);
00063         virtual BOOL    handleDoubleClick(S32 x, S32 y, MASK mask );
00064 
00065         virtual BOOL    handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect);
00066         virtual BOOL    handleDragAndDrop(S32 x, S32 y, MASK mask,
00067                                                                                 BOOL drop, EDragAndDropType cargo_type, 
00068                                                                                 void *cargo_data, EAcceptance *accept, LLString& tooltip_msg);
00069 
00070         const class LLInventoryItem* getDragItem() const { return mDragItem; }
00071         virtual BOOL    importBuffer(const LLString& buffer);
00072         virtual bool    importStream(std::istream& str);
00073         virtual BOOL    exportBuffer(LLString& buffer);
00074         void setNotecardInfo(const LLUUID& notecard_item_id, const LLUUID& object_id)
00075         {
00076                 mNotecardInventoryID = notecard_item_id;
00077                 mObjectID = object_id;
00078         }
00079         
00080         void setASCIIEmbeddedText(const LLString& instr);
00081         void setEmbeddedText(const LLString& instr);
00082         LLString getEmbeddedText();
00083         
00084         // Appends Second Life time, small font, grey.
00085         // If this starts a line, you need to prepend a newline.
00086         LLString appendTime(bool prepend_newline);
00087 
00088         void copyInventory(const LLInventoryItem* item, U32 callback_id = 0);
00089 
00090         // returns true if there is embedded inventory.
00091         // *HACK: This is only useful because the notecard verifier may
00092         // change the asset if there is embedded inventory. This mechanism
00093         // should be changed to get a different asset id from the verifier
00094         // rather than checking if a re-load is necessary. Phoenix 2007-02-27
00095         bool hasEmbeddedInventory();
00096 
00097 private:
00098         // Embedded object operations
00099         virtual llwchar pasteEmbeddedItem(llwchar ext_char);
00100         virtual void    bindEmbeddedChars(LLFontGL* font) const;
00101         virtual void    unbindEmbeddedChars(LLFontGL* font) const;
00102 
00103         BOOL                    getEmbeddedItemToolTipAtPos(S32 pos, LLWString &wmsg) const;
00104         BOOL                    openEmbeddedItemAtPos( S32 pos );
00105         BOOL                    openEmbeddedItem(LLInventoryItem* item);
00106 
00107         S32                             insertEmbeddedItem(S32 pos, LLInventoryItem* item);
00108 
00109         void                    openEmbeddedTexture( LLInventoryItem* item );
00110         void                    openEmbeddedSound( LLInventoryItem* item );
00111         void                    openEmbeddedLandmark( LLInventoryItem* item );
00112         void                    openEmbeddedNotecard( LLInventoryItem* item);
00113         void                    showCopyToInvDialog( LLInventoryItem* item );
00114         void                    showUnsavedAlertDialog( LLInventoryItem* item );
00115 
00116         static void             onCopyToInvDialog( S32 option, void* userdata );
00117         static void             onNotecardDialog( S32 option, void* userdata );
00118         
00119         LLPointer<LLInventoryItem> mDragItem;
00120         BOOL mDragItemSaved;
00121         class LLEmbeddedItems* mEmbeddedItemList;
00122 
00123         LLUUID mObjectID;
00124         LLUUID mNotecardInventoryID;
00125 
00126         LLPointer<class LLEmbeddedNotecardOpener> mInventoryCallback;
00127 
00128         // *TODO: Add right click menus for SLURLs
00129         //LLViewHandle mPopupMenuHandle;
00130 
00131         //
00132         // Inner classes
00133         //
00134 
00135         class LLTextCmdInsertEmbeddedItem;
00136 };
00137 
00138 #endif  // LL_VIEWERTEXTEDITOR_H

Generated on Fri May 16 08:34:17 2008 for SecondLife by  doxygen 1.5.5