Commit f46ef8de4492e932d33c5a27292a3f75fada3b03
1 parent
0825fa40
Exists in
master
and in
5 other branches
Implementando restante dos métodos
Showing
5 changed files
with
221 additions
and
1 deletions
Show diff stats
src/loffice/get.cc
@@ -86,3 +86,71 @@ | @@ -86,3 +86,71 @@ | ||
86 | return -1; | 86 | return -1; |
87 | 87 | ||
88 | } | 88 | } |
89 | + | ||
90 | + ::sal_Int32 SAL_CALL session_impl::getCursorAddress() throw (::com::sun::star::uno::RuntimeException) | ||
91 | + { | ||
92 | + try | ||
93 | + { | ||
94 | + CHECK_SESSION_HANDLE | ||
95 | + return hSession->get_cursor_addr(); | ||
96 | + | ||
97 | + } catch(std::exception &e) | ||
98 | + { | ||
99 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
100 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
101 | + } | ||
102 | + | ||
103 | + return -1; | ||
104 | + | ||
105 | + } | ||
106 | + | ||
107 | + ::sal_Int32 SAL_CALL session_impl::getFieldStart( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException) | ||
108 | + { | ||
109 | + try | ||
110 | + { | ||
111 | + CHECK_SESSION_HANDLE | ||
112 | + return hSession->get_field_start(addr); | ||
113 | + | ||
114 | + } catch(std::exception &e) | ||
115 | + { | ||
116 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
117 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
118 | + } | ||
119 | + | ||
120 | + return -1; | ||
121 | + | ||
122 | + } | ||
123 | + | ||
124 | + ::sal_Int32 SAL_CALL session_impl::getFieldLen( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException) | ||
125 | + { | ||
126 | + try | ||
127 | + { | ||
128 | + CHECK_SESSION_HANDLE | ||
129 | + return hSession->get_field_len(addr); | ||
130 | + | ||
131 | + } catch(std::exception &e) | ||
132 | + { | ||
133 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
134 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
135 | + } | ||
136 | + | ||
137 | + return -1; | ||
138 | + | ||
139 | + } | ||
140 | + | ||
141 | + ::sal_Int32 SAL_CALL session_impl::getNextUnprotected( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException) | ||
142 | + { | ||
143 | + try | ||
144 | + { | ||
145 | + CHECK_SESSION_HANDLE | ||
146 | + return hSession->get_next_unprotected(addr); | ||
147 | + | ||
148 | + } catch(std::exception &e) | ||
149 | + { | ||
150 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
151 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
152 | + } | ||
153 | + | ||
154 | + return -1; | ||
155 | + | ||
156 | + } |
src/loffice/globals.hpp
@@ -116,12 +116,25 @@ | @@ -116,12 +116,25 @@ | ||
116 | // Screen contents | 116 | // Screen contents |
117 | virtual ::rtl::OUString SAL_CALL getTextAt( ::sal_Int16 row, ::sal_Int16 col, ::sal_Int16 size ) throw (::com::sun::star::uno::RuntimeException); | 117 | virtual ::rtl::OUString SAL_CALL getTextAt( ::sal_Int16 row, ::sal_Int16 col, ::sal_Int16 size ) throw (::com::sun::star::uno::RuntimeException); |
118 | virtual ::sal_Int16 SAL_CALL setTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& str ) throw (::com::sun::star::uno::RuntimeException); | 118 | virtual ::sal_Int16 SAL_CALL setTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& str ) throw (::com::sun::star::uno::RuntimeException); |
119 | + virtual ::sal_Int32 SAL_CALL getFieldStart( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException); | ||
120 | + virtual ::sal_Int32 SAL_CALL getFieldLen( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException); | ||
121 | + virtual ::sal_Int32 SAL_CALL getNextUnprotected( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException); | ||
119 | 122 | ||
120 | // Wait | 123 | // Wait |
121 | virtual ::sal_Int16 SAL_CALL waitForReady( ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException); | 124 | virtual ::sal_Int16 SAL_CALL waitForReady( ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException); |
122 | virtual ::sal_Int16 SAL_CALL waitForTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& str, ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException); | 125 | virtual ::sal_Int16 SAL_CALL waitForTextAt( ::sal_Int16 row, ::sal_Int16 col, const ::rtl::OUString& str, ::sal_Int16 seconds ) throw (::com::sun::star::uno::RuntimeException); |
123 | 126 | ||
124 | - | 127 | + // Actions |
128 | + virtual ::sal_Int16 SAL_CALL enter() throw (::com::sun::star::uno::RuntimeException); | ||
129 | + virtual ::sal_Int16 SAL_CALL pfkey( ::sal_Int16 key ) throw (::com::sun::star::uno::RuntimeException); | ||
130 | + virtual ::sal_Int16 SAL_CALL pakey( ::sal_Int16 key ) throw (::com::sun::star::uno::RuntimeException); | ||
131 | + virtual ::sal_Int16 SAL_CALL quit() throw (::com::sun::star::uno::RuntimeException); | ||
132 | + virtual ::sal_Int16 SAL_CALL erase_eof() throw (::com::sun::star::uno::RuntimeException); | ||
133 | + | ||
134 | + // Cursor | ||
135 | + virtual ::sal_Int32 SAL_CALL setCursorAt( ::sal_Int16 row, ::sal_Int16 col ) throw (::com::sun::star::uno::RuntimeException); | ||
136 | + virtual ::sal_Int32 SAL_CALL setCursorAddress( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException); | ||
137 | + virtual ::sal_Int32 SAL_CALL getCursorAddress() throw (::com::sun::star::uno::RuntimeException); | ||
125 | 138 | ||
126 | private: | 139 | private: |
127 | h3270::session * hSession; | 140 | h3270::session * hSession; |
src/loffice/init.cc
@@ -93,3 +93,22 @@ void session_impl::initialize( Sequence< Any > const & args ) throw (Exception) | @@ -93,3 +93,22 @@ void session_impl::initialize( Sequence< Any > const & args ) throw (Exception) | ||
93 | } | 93 | } |
94 | return -1; | 94 | return -1; |
95 | } | 95 | } |
96 | + | ||
97 | + ::sal_Int16 SAL_CALL session_impl::quit() throw (::com::sun::star::uno::RuntimeException) | ||
98 | + { | ||
99 | + try | ||
100 | + { | ||
101 | + CHECK_SESSION_HANDLE | ||
102 | + return hSession->quit(); | ||
103 | + } catch(std::exception &e) | ||
104 | + { | ||
105 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
106 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
107 | + } | ||
108 | + | ||
109 | + return -1; | ||
110 | + | ||
111 | + } | ||
112 | + | ||
113 | + | ||
114 | + |
src/loffice/pw3270.idl
@@ -57,6 +57,25 @@ module pw3270 | @@ -57,6 +57,25 @@ module pw3270 | ||
57 | short setTextAt([in] short row, [in] short col, [in] string str); | 57 | short setTextAt([in] short row, [in] short col, [in] string str); |
58 | short waitForTextAt([in] short row, [in] short col, [in] string str, [in] short seconds); | 58 | short waitForTextAt([in] short row, [in] short col, [in] string str, [in] short seconds); |
59 | 59 | ||
60 | + // Cursor | ||
61 | + long setCursorAt([in] short row, [in] short col); | ||
62 | + long setCursorAddress([in] long addr); | ||
63 | + long getCursorAddress(); | ||
64 | + | ||
65 | + // Field positioning | ||
66 | + long getFieldStart([in] long addr); | ||
67 | + long getFieldLen([in] long addr); | ||
68 | + long getNextUnprotected([in] long addr); | ||
69 | + | ||
70 | + // Keyboard actions | ||
71 | + short enter(); | ||
72 | + short pfkey([in] short key); | ||
73 | + short pakey([in] short key); | ||
74 | + | ||
75 | + // Misc actions | ||
76 | + short quit(); | ||
77 | + short erase_eof(); | ||
78 | + | ||
60 | // Misc Settings | 79 | // Misc Settings |
61 | short setSessionName([in] string name); | 80 | short setSessionName([in] string name); |
62 | 81 |
src/loffice/set.cc
@@ -141,3 +141,104 @@ | @@ -141,3 +141,104 @@ | ||
141 | 141 | ||
142 | } | 142 | } |
143 | 143 | ||
144 | + ::sal_Int16 SAL_CALL session_impl::enter() throw (::com::sun::star::uno::RuntimeException) | ||
145 | + { | ||
146 | + try | ||
147 | + { | ||
148 | + CHECK_SESSION_HANDLE | ||
149 | + return hSession->enter(); | ||
150 | + | ||
151 | + } catch(std::exception &e) | ||
152 | + { | ||
153 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
154 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
155 | + } | ||
156 | + | ||
157 | + return -1; | ||
158 | + | ||
159 | + } | ||
160 | + | ||
161 | + ::sal_Int16 SAL_CALL session_impl::pfkey( ::sal_Int16 key ) throw (::com::sun::star::uno::RuntimeException) | ||
162 | + { | ||
163 | + try | ||
164 | + { | ||
165 | + CHECK_SESSION_HANDLE | ||
166 | + return hSession->pfkey(key); | ||
167 | + | ||
168 | + } catch(std::exception &e) | ||
169 | + { | ||
170 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
171 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
172 | + } | ||
173 | + | ||
174 | + return -1; | ||
175 | + | ||
176 | + } | ||
177 | + | ||
178 | + ::sal_Int16 SAL_CALL session_impl::pakey( ::sal_Int16 key ) throw (::com::sun::star::uno::RuntimeException) | ||
179 | + { | ||
180 | + try | ||
181 | + { | ||
182 | + CHECK_SESSION_HANDLE | ||
183 | + return hSession->pakey(key); | ||
184 | + | ||
185 | + } catch(std::exception &e) | ||
186 | + { | ||
187 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
188 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
189 | + } | ||
190 | + | ||
191 | + return -1; | ||
192 | + | ||
193 | + } | ||
194 | + | ||
195 | +::sal_Int32 SAL_CALL session_impl::setCursorAt( ::sal_Int16 row, ::sal_Int16 col ) throw (::com::sun::star::uno::RuntimeException) | ||
196 | + { | ||
197 | + try | ||
198 | + { | ||
199 | + CHECK_SESSION_HANDLE | ||
200 | + return hSession->set_cursor_position(row,col); | ||
201 | + | ||
202 | + } catch(std::exception &e) | ||
203 | + { | ||
204 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
205 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
206 | + } | ||
207 | + | ||
208 | + return -1; | ||
209 | + | ||
210 | + } | ||
211 | + | ||
212 | + ::sal_Int32 SAL_CALL session_impl::setCursorAddress( ::sal_Int32 addr ) throw (::com::sun::star::uno::RuntimeException) | ||
213 | + { | ||
214 | + try | ||
215 | + { | ||
216 | + CHECK_SESSION_HANDLE | ||
217 | + return hSession->set_cursor_addr(addr); | ||
218 | + | ||
219 | + } catch(std::exception &e) | ||
220 | + { | ||
221 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
222 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
223 | + } | ||
224 | + | ||
225 | + return -1; | ||
226 | + | ||
227 | + } | ||
228 | + | ||
229 | + ::sal_Int16 SAL_CALL session_impl::erase_eof() throw (::com::sun::star::uno::RuntimeException) | ||
230 | + { | ||
231 | + try | ||
232 | + { | ||
233 | + CHECK_SESSION_HANDLE | ||
234 | + return hSession->erase_eof(); | ||
235 | + | ||
236 | + } catch(std::exception &e) | ||
237 | + { | ||
238 | + OUString msg = OUString(e.what(),strlen(e.what()),RTL_TEXTENCODING_UTF8,RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE); | ||
239 | + throw css::uno::RuntimeException(msg,static_cast< cppu::OWeakObject * >(this)); | ||
240 | + } | ||
241 | + | ||
242 | + return -1; | ||
243 | + | ||
244 | + } |