aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewertexteditor.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llviewertexteditor.h
parentREADME.txt (diff)
downloadmeta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/llviewertexteditor.h')
-rw-r--r--linden/indra/newview/llviewertexteditor.h122
1 files changed, 122 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewertexteditor.h b/linden/indra/newview/llviewertexteditor.h
new file mode 100644
index 0000000..b8452e3
--- /dev/null
+++ b/linden/indra/newview/llviewertexteditor.h
@@ -0,0 +1,122 @@
1/**
2 * @file llviewertexteditor.h
3 * @brief Text editor widget to let users enter a a multi-line document//
4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#ifndef LL_VIEWERTEXTEDITOR_H
29#define LL_VIEWERTEXTEDITOR_H
30
31#include "lltexteditor.h"
32
33class LLInventoryItem;
34class LLEmbeddedItems;
35
36
37//
38// Classes
39//
40class LLViewerTextEditor : public LLTextEditor
41{
42 friend class LLEmbeddedItems;
43 friend class LLTextCmdInsertEmbeddedItem;
44
45public:
46 LLViewerTextEditor(const LLString& name,
47 const LLRect& rect,
48 S32 max_length,
49 const LLString& default_text = "",
50 const LLFontGL* glfont = NULL,
51 BOOL allow_embedded_items = FALSE);
52
53 virtual ~LLViewerTextEditor();
54
55 virtual void makePristine();
56
57 static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
58
59 // mousehandler overrides
60 virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
61 virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
62 virtual BOOL handleHover(S32 x, S32 y, MASK mask);
63 virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask );
64
65 virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect);
66 virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
67 BOOL drop, EDragAndDropType cargo_type,
68 void *cargo_data, EAcceptance *accept, LLString& tooltip_msg);
69
70 const LLInventoryItem* getDragItem() { return mDragItem; }
71 virtual BOOL importBuffer(const LLString& buffer);
72 virtual bool importStream(std::istream& str);
73 virtual BOOL exportBuffer(LLString& buffer);
74 void setNotecardInfo(const LLUUID& notecard_item_id, const LLUUID& object_id)
75 {
76 mNotecardInventoryID = notecard_item_id;
77 mObjectID = object_id;
78 }
79
80 void setASCIIEmbeddedText(const LLString& instr);
81 void setEmbeddedText(const LLString& instr);
82 LLString getEmbeddedText();
83
84 LLString appendTime(bool prepend_newline);
85 // Appends Second Life time, small font, grey
86 // If this starts a line, you need to prepend a newline.
87
88 void copyInventory(LLInventoryItem* item);
89
90protected:
91 // Embedded object operations
92 virtual llwchar pasteEmbeddedItem(llwchar ext_char);
93 virtual void bindEmbeddedChars(const LLFontGL* font);
94 virtual void unbindEmbeddedChars(const LLFontGL* font);
95
96 BOOL getEmbeddedItemToolTipAtPos(S32 pos, LLWString &wmsg);
97 BOOL openEmbeddedItemAtPos( S32 pos );
98 BOOL openEmbeddedItem(LLInventoryItem* item, BOOL saved);
99
100 S32 insertEmbeddedItem(S32 pos, LLInventoryItem* item);
101
102 void openEmbeddedTexture( LLInventoryItem* item );
103 void openEmbeddedSound( LLInventoryItem* item );
104 //void openEmbeddedLandmark( LLInventoryItem* item );
105 void openEmbeddedNotecard( LLInventoryItem* item, BOOL saved );
106 void showCopyToInvDialog( LLInventoryItem* item );
107 void showLandmarkDialog( LLInventoryItem* item );
108
109 static void onCopyToInvDialog( S32 option, void* userdata );
110 static void onNotecardDialog( S32 option, void* userdata );
111 static void onLandmarkDialog( S32 option, void* userdata );
112
113protected:
114 LLPointer<LLInventoryItem> mDragItem;
115 BOOL mDragItemSaved;
116 LLEmbeddedItems* mEmbeddedItemList;
117
118 LLUUID mObjectID;
119 LLUUID mNotecardInventoryID;
120};
121
122#endif // LL_VIEWERTEXTEDITOR_H