aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/libraries/include/llmozlib.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/libraries/include/llmozlib.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 '')
-rw-r--r--linden/libraries/include/llmozlib.h145
1 files changed, 145 insertions, 0 deletions
diff --git a/linden/libraries/include/llmozlib.h b/linden/libraries/include/llmozlib.h
new file mode 100644
index 0000000..f4ac0dc
--- /dev/null
+++ b/linden/libraries/include/llmozlib.h
@@ -0,0 +1,145 @@
1////////////////////////////////////////////////////////////////////////////////
2//
3//
4//
5//
6//
7//
8//
9//
10//
11////////////////////////////////////////////////////////////////////////////////
12#ifndef LLMOZLIB_H
13#define LLMOZLIB_H
14
15#include <string>
16#include <map>
17
18class LLEmbeddedBrowser;
19class LLEmbeddedBrowserWindow;
20
21////////////////////////////////////////////////////////////////////////////////
22// data class that is passed with an event
23class LLEmbeddedBrowserWindowEvent
24{
25 public:
26 LLEmbeddedBrowserWindowEvent( int eventWindowIdIn ) :
27 mEventWindowId( eventWindowIdIn )
28 {
29 };
30
31 LLEmbeddedBrowserWindowEvent( int eventWindowIdIn, int intValIn ) :
32 mEventWindowId( eventWindowIdIn ),
33 mIntVal( intValIn )
34 {
35 };
36
37 LLEmbeddedBrowserWindowEvent( int eventWindowIdIn, std::string stringValIn ) :
38 mEventWindowId( eventWindowIdIn ),
39 mStringVal( stringValIn )
40 {
41 };
42
43 virtual ~LLEmbeddedBrowserWindowEvent()
44 {
45 };
46
47 int getEventWindowId() const
48 {
49 return mEventWindowId;
50 };
51
52 int getIntValue() const
53 {
54 return mIntVal;
55 };
56
57 std::string getStringValue() const
58 {
59 return mStringVal;
60 };
61
62 private:
63 int mEventWindowId;
64 int mIntVal;
65 std::string mStringVal;
66};
67
68////////////////////////////////////////////////////////////////////////////////
69// Override these methods to observe browser events
70class LLEmbeddedBrowserWindowObserver
71{
72 public:
73 virtual ~LLEmbeddedBrowserWindowObserver() { };
74
75 typedef LLEmbeddedBrowserWindowEvent EventType;
76 virtual void onNavigateBegin( const EventType& eventIn ) { };
77 virtual void onNavigateComplete( const EventType& eventIn ) { };
78 virtual void onUpdateProgress( const EventType& eventIn ) { };
79 virtual void onStatusTextChange( const EventType& eventIn ) { };
80 virtual void onLocationChange( const EventType& eventIn ) { };
81 virtual void onClickLinkHref( const EventType& eventIn ) { };
82 virtual void onClickLinkSecondLife( const EventType& eventIn ) { };
83};
84
85////////////////////////////////////////////////////////////////////////////////
86//
87class LLMozLib
88{
89 public:
90 virtual ~LLMozLib();
91
92 // singleton access
93 static LLMozLib* getInstance();
94
95 // housekeeping
96 bool init( std::string appBaseDirIn, std::string profileDirIn );
97 bool reset();
98 bool clearCache();
99 int getLastError();
100 const std::string getVersion();
101 void setBrowserAgentId( std::string idIn );
102
103 // browser window
104 int createBrowserWindow( void* nativeWindowHandleIn, int browserWindowWidthIn, int browserWindowHeightIn );
105 bool destroyBrowserWindow( int browserWindowIdIn );
106 bool setSize( int browserWindowIdIn, int widthIn, int heightIn );
107 bool scrollByLines( int browserWindowIdIn, int linesIn );
108 void setBackgroundColor( int browserWindowIdIn, int redIn, int greenIn, int blueIn );
109
110 // observer interface
111 bool addObserver( int browserWindowIdIn, LLEmbeddedBrowserWindowObserver* subjectIn );
112 bool remObserver( int browserWindowIdIn, LLEmbeddedBrowserWindowObserver* subjectIn );
113
114 // navigation
115 bool navigateTo( int browserWindowIdIn, const std::string uriIn );
116 bool navigateStop( int browserWindowIdIn );
117 bool canNavigateBack( int browserWindowIdIn );
118 bool navigateBack( int browserWindowIdIn );
119 bool canNavigateForward( int browserWindowIdIn );
120 bool navigateForward( int browserWindowIdIn );
121
122 // access to rendered bitmap data
123 const unsigned char* grabBrowserWindow( int browserWindowIdIn );
124 const unsigned char* getBrowserWindowPixels( int browserWindowIdIn );
125 const int getBrowserWidth( int browserWindowIdIn );
126 const int getBrowserHeight( int browserWindowIdIn );
127 const int getBrowserDepth( int browserWindowIdIn );
128 const int getBrowserRowSpan( int browserWindowIdIn );
129
130 // mouse/keyboard interaction
131 bool mouseDown( int browserWindowIdIn, int xPosIn, int yPosIn );
132 bool mouseUp( int browserWindowIdIn, int xPosIn, int yPosIn );
133 bool mouseMove( int browserWindowIdIn, int xPosIn, int yPosIn );
134 bool keyPress( int browserWindowIdIn, int keyCodeIn );
135 bool focusBrowser( int browserWindowIdIn, bool focusBrowserIn );
136
137 private:
138 LLMozLib();
139 LLEmbeddedBrowserWindow* getBrowserWindowFromWindowId( int browserWindowIdIn );
140 static LLMozLib* sInstance;
141 const int mMaxBrowserWindows;
142 LLEmbeddedBrowserWindow** mBrowserWindowList;
143};
144
145#endif // LLMOZLIB_H \ No newline at end of file