1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sjctrl.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <bf_sfx2/sfxjs.hxx>
44 // Basis-Klasse aller VCControl-Wrapper-Klassen
45 // Haelt Verweis auf das Control und handelt einige gemeinsame Properties
46 class ImpSjJScriptControlBase
52 // Beibehalten bis zum Vollupdate
54 String getName() const;
55 void setName( const String & aStrg );
56 String getValue() const;
57 String getType() const;
60 // Methoden von Java --> C++ (f"ur Properties)
61 //--------------------------------------------
62 String
ImpGetName() const;
63 void ImpSetName( const String
& aStrg
);
64 String
ImpGetValue() const;
65 void ImpSetValue( const String
& aStrg
);
66 String
ImpGetType() const;
69 ImpSjJScriptControlBase::ImpSjJScriptControlBase( VCControl
* _pControl
);
72 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
75 class ImpSjJScriptButtonObject
: public SjJScriptButtonObject
, ImpSjJScriptControlBase
78 // Methoden von Java --> C++ (f"ur Properties)
79 //--------------------------------------------
80 // Basisklassen-Properties, werden an ImpSjJScriptControlBase durchgereicht
81 virtual String
getName() const;
82 virtual void setName( const String
& aStrg
);
83 virtual String
getValue() const;
84 virtual void setValue( const String
& aStrg
);
85 virtual String
getType() const;
87 // Methoden des Objektes
90 // Events (C++ --> Java)
91 //----------------------
92 // Neue Event-Schnittstelle mit Function-Objekten
93 virtual SjJScriptFunctionObject
* getOnClick_Fct() const;
94 virtual void setOnClick_Fct( SjJScriptFunctionObject
* pFunctionObject
);
95 virtual String
getOnClick() const;
96 virtual void setOnClick( const String
& aSourceStrg
);
100 ImpSjJScriptButtonObject( VCControl
* _pControl
, SjJSbxObject
* p
);
103 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
105 // PasswordControl (Edit-Control zur Password-Eingabe)
106 class ImpSjJScriptPasswordObject
: public SjJScriptPasswordObject
, ImpSjJScriptControlBase
109 // Methoden von Java --> C++ (f"ur Properties)
110 //--------------------------------------------
111 // Basisklassen-Properties, werden an ImpSjJScriptControlBase durchgereicht
112 virtual String
getName() const;
113 virtual void setName( const String
& aStrg
);
114 virtual String
getValue() const;
115 virtual String
getType() const;
117 virtual String
getDefaultValue() const;
118 virtual void setDefaultValue( const String
& aStrg
);
119 virtual void setValue( const String
& aStrg
);
121 // Methoden des Objektes
122 virtual void focus();
124 virtual void select();
126 // Events (C++ --> Java)
127 //----------------------
131 ImpSjJScriptPasswordObject( VCControl
* _pControl
, SjJSbxObject
* p
);
134 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
136 class ImpSjJScriptCheckboxObject
: public SjJScriptCheckboxObject
, ImpSjJScriptControlBase
139 // Methoden von Java --> C++ (f"ur Properties)
140 //--------------------------------------------
141 // Basisklassen-Properties, werden an ImpSjJScriptControlBase durchgereicht
142 virtual String
getName() const;
143 virtual void setName( const String
& aStrg
);
144 virtual String
getValue() const;
145 virtual String
getType() const;
147 virtual BOOL
getChecked() const;
148 virtual void setChecked( BOOL bCheck
);
149 virtual BOOL
getDefaultChecked() const;
150 virtual void setDefaultChecked( BOOL bCheck
);
151 // getValue() wird in der Basisklasse definiert
152 virtual void setValue( const String
& aStrg
);
154 // Methoden des Objektes
155 virtual void click();
157 // Events (C++ --> Java)
158 //----------------------
159 // Neue Event-Schnittstelle mit Function-Objekten
160 virtual SjJScriptFunctionObject
* getOnClick_Fct() const;
161 virtual void setOnClick_Fct( SjJScriptFunctionObject
* pFunctionObject
);
162 virtual String
getOnClick() const;
163 virtual void setOnClick( const String
& aSourceStrg
);
167 ImpSjJScriptCheckboxObject( VCControl
* _pControl
, SjJSbxObject
* p
);
170 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
172 // Wrapper-Klasse fuer RadioArray
173 class ImpSjJScriptRadioArray
: public SjJSbxArrayObject
175 VCRadioManager
* pMgr
;
177 INT32
ImpSjJScriptRadioArray::getLength() const;
178 SjJSbxObject
* ImpSjJScriptRadioArray::getElement( INT32 nIndex
) const;
179 SjJSbxObject
* ImpSjJScriptRadioArray::getElement_String( const String
& aName
) const;
182 ImpSjJScriptRadioArray::ImpSjJScriptRadioArray( VCRadioManager
* _pMgr
, SjJSbxObject
* p
);
185 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
187 class ImpSjJScriptRadioObject
: public SjJScriptRadioObject
, ImpSjJScriptControlBase
190 // Methoden von Java --> C++ (f"ur Properties)
191 //--------------------------------------------
192 // Basisklassen-Properties, werden an ImpSjJScriptControlBase durchgereicht
193 virtual String
getName() const;
194 virtual void setName( const String
& aStrg
);
195 virtual String
getValue() const;
196 virtual String
getType() const;
198 // Properties von SjJScriptCheckboxObject
199 virtual BOOL
getChecked() const;
200 virtual void setChecked( BOOL bCheck
);
201 virtual BOOL
getDefaultChecked() const;
202 virtual void setDefaultChecked( BOOL bCheck
);
203 // getValue() wird in der Basisklasse definiert
204 virtual void setValue( const String
& aStrg
);
206 // yyy Raus zum inkompatiblen
207 //virtual INT32 getLength();
209 // Methoden des Objektes
210 virtual void click();
212 // Events (C++ --> Java)
213 // Neue Event-Schnittstelle mit Function-Objekten
214 virtual SjJScriptFunctionObject
* getOnClick_Fct() const;
215 virtual void setOnClick_Fct( SjJScriptFunctionObject
* pFunctionObject
);
216 virtual String
getOnClick() const;
217 virtual void setOnClick( const String
& aSourceStrg
);
221 ImpSjJScriptRadioObject( VCControl
* _pControl
, SjJSbxObject
* p
);
224 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
226 class ImpSjJScriptSelectObject
: public SjJScriptSelectObject
, ImpSjJScriptControlBase
229 // Methoden von Java --> C++ (f"ur Properties)
230 //--------------------------------------------
231 // Basisklassen-Properties, werden an ImpSjJScriptControlBase durchgereicht
232 virtual String
getName() const;
233 virtual void setName( const String
& aStrg
);
234 virtual String
getValue() const;
235 virtual String
getType() const;
237 virtual INT32
getLength();
238 virtual INT32
getSelectedIndex() const;
239 virtual void setSelectedIndex( INT32 nNo
);
241 // liefert eine Array von Option-Objekten
242 //yyy Raus zum inkompatiblen
243 //virtual SjJSbxArrayObject * getOptions();
245 // Methoden des Objektes
246 virtual void focus();
249 // Events (C++ --> Java)
250 //----------------------
251 // Neue Event-Schnittstelle mit Function-Objekten
252 virtual SjJScriptFunctionObject
* getOnBlur_Fct() const;
253 virtual void setOnBlur_Fct( SjJScriptFunctionObject
* pFunctionObject
);
254 virtual SjJScriptFunctionObject
* getOnChange_Fct() const;
255 virtual void setOnChange_Fct( SjJScriptFunctionObject
* pFunctionObject
);
256 virtual SjJScriptFunctionObject
* getOnFocus_Fct() const;
257 virtual void setOnFocus_Fct( SjJScriptFunctionObject
* pFunctionObject
);
258 virtual String
getOnBlur() const;
259 virtual void setOnBlur( const String
& aSourceStrg
);
261 virtual String
getOnChange() const;
262 virtual void setOnChange( const String
& aSourceStrg
);
264 virtual String
getOnFocus() const;
265 virtual void setOnFocus( const String
& aSourceStrg
);
268 // SjJSbxArrayObject-Methoden
269 virtual INT32
getLength() const;
270 // Zugriff "uber den Index
271 virtual SjJSbxObject
* getElement( INT32 nIndex
) const;
272 // Zugriff "uber den Namen
273 // native Java-Methoden k"onnen (noch) nicht "uberladen werden
274 //virtual SjJSbxObject * getElement_String( const String & aName ) const;
277 ImpSjJScriptSelectObject( VCControl
* _pControl
, SjJSbxObject
* p
);
279 // zum Setzen von Eintr"agen am Objket (zum Aufruf von Java aus) 15.1.1997
280 virtual void setOption( INT32 nIndex
, const String
& aOptionText
,
281 const String
& aOptionValue
,
282 BOOL bDefaultSelected
, BOOL bSelected
);
284 // Schnittstelle fuer die Properties der Option-Objekte
285 virtual BOOL
getOptionDefaultSelected( INT32 nIndex
) const;
286 virtual void setOptionDefaultSelected( BOOL bSelected
, INT32 nIndex
);
287 virtual BOOL
getOptionSelected( INT32 nIndex
) const;
288 virtual void setOptionSelected( BOOL bSelected
, INT32 nIndex
);
289 virtual String
getOptionText( INT32 nIndex
) const;
290 virtual void setOptionText( const String
& sText
, INT32 nIndex
);
291 virtual void setOptionValue( const String
& sText
, INT32 nIndex
);
292 virtual String
getOptionValue( INT32 nIndex
) const;
295 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
297 // Wieso von Controlbase abgeleitet?
299 class ImpSjJScriptOptionObject
: public SjJScriptOptionObject
, ImpSjJScriptControlBase
301 USHORT nListBoxIndex
;
303 // Methoden von Java --> C++ (f"ur Properties)
304 //--------------------------------------------
305 virtual BOOL
getdefaultSelected() const;
306 virtual void setdefaultSelected( BOOL bSelected
);
307 virtual INT32
getIndex() const;
308 virtual BOOL
getSelected() const;
309 virtual void setSelected( BOOL bSelected
);
312 //yyy Zum Vollupdate raus:
314 virtual INT32 getSelectedIndex() const;
315 virtual void setSelectedIndex( INT32 nNo );
319 virtual String
getText() const;
320 virtual void setText( const String
& sText
);
321 // getValue() wird in der Basisklasse definiert
322 virtual String
getValue() const;
323 virtual void setValue( const String
& aStrg
);
327 virtual String
getName() const { return "";}
328 virtual void setName( const String
&s
) { }
329 virtual String
getType() const { return "";}
330 // Methoden des Objektes
333 // Events (C++ --> Java)
334 //----------------------
338 ImpSjJScriptOptionObject( VCControl
* _pControl
, SjJSbxObject
* p
, USHORT _nListBoxIndex
);
341 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
343 // Eigene Klasse fuer forms-Array anlegen
344 class SjJSbxFormsArray
: public SfxJSArray
349 // SjJSbxArrayObject-Methoden
350 virtual INT32
getLength() const;
351 // Zugriff "uber den Index
352 virtual SjJSbxObject
* getElement( INT32 nIndex
) const;
353 // Zugriff "uber den Namen
354 // native Java-Methoden k"onnen (noch) nicht "uberladen werden
355 virtual SjJSbxObject
* getElement_String( const String
& aName
) const;
358 SjJSbxFormsArray( VCManager
* _pManager
, SjJSbxObject
* p
);
361 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
363 class ImpSjJScriptTextObject
: public SjJScriptTextObject
, ImpSjJScriptControlBase
366 // Methoden von Java --> C++ (f"ur Properties)
367 //--------------------------------------------
368 // Basisklassen-Properties, werden an ImpSjJScriptControlBase durchgereicht
369 virtual String
getName() const;
370 virtual void setName( const String
& aStrg
);
371 virtual String
getValue() const;
372 virtual String
getType() const;
374 virtual String
getDefaultValue() const;
375 virtual void setDefaultValue( const String
& aStrg
);
376 // getValue() wird in der Basisklasse definiert
377 virtual void setValue( const String
& aStrg
);
379 // Methoden des Objektes
380 virtual void focus();
382 virtual void select();
384 // Events (C++ --> Java)
385 //----------------------
386 // Neue Event-Schnittstelle mit Function-Objekten
387 virtual SjJScriptFunctionObject
* getOnBlur_Fct() const;
388 virtual void setOnBlur_Fct( SjJScriptFunctionObject
* pFunctionObject
);
389 virtual SjJScriptFunctionObject
* getOnChange_Fct() const;
390 virtual void setOnChange_Fct( SjJScriptFunctionObject
* pFunctionObject
);
391 virtual SjJScriptFunctionObject
* getOnFocus_Fct() const;
392 virtual void setOnFocus_Fct( SjJScriptFunctionObject
* pFunctionObject
);
393 virtual SjJScriptFunctionObject
* getOnSelect_Fct() const;
394 virtual void setOnSelect_Fct( SjJScriptFunctionObject
* pFunctionObject
);
395 virtual String
getOnBlur() const;
396 virtual void setOnBlur( const String
& aSourceStrg
);
398 virtual String
getOnChange() const;
399 virtual void setOnChange( const String
& aSourceStrg
);
401 virtual String
getOnFocus() const;
402 virtual void setOnFocus( const String
& aSourceStrg
);
404 virtual String
getOnSelect() const;
405 virtual void setOnSelect( const String
& aSourceStrg
);
409 ImpSjJScriptTextObject( VCControl
* _pControl
, SjJSbxObject
* p
);
412 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
414 class ImpSjJScriptTextareaObject
: public SjJScriptTextareaObject
, ImpSjJScriptControlBase
417 // Methoden von Java --> C++ (f"ur Properties)
418 //--------------------------------------------
419 // Basisklassen-Properties, werden an ImpSjJScriptControlBase durchgereicht
420 virtual String
getName() const;
421 virtual void setName( const String
& aStrg
);
422 virtual String
getValue() const;
423 virtual String
getType() const;
425 virtual String
getDefaultValue() const;
426 virtual void setDefaultValue( const String
& aStrg
);
427 // getValue() wird in der Basisklasse definiert
428 virtual void setValue( const String
& aStrg
);
430 // Methoden des Objektes
431 virtual void focus();
433 virtual void select();
435 // Events (C++ --> Java)
436 //----------------------
437 // Neue Event-Schnittstelle mit Function-Objekten
438 virtual SjJScriptFunctionObject
* getOnBlur_Fct() const;
439 virtual void setOnBlur_Fct( SjJScriptFunctionObject
* pFunctionObject
);
440 virtual SjJScriptFunctionObject
* getOnChange_Fct() const;
441 virtual void setOnChange_Fct( SjJScriptFunctionObject
* pFunctionObject
);
442 virtual SjJScriptFunctionObject
* getOnFocus_Fct() const;
443 virtual void setOnFocus_Fct( SjJScriptFunctionObject
* pFunctionObject
);
444 virtual SjJScriptFunctionObject
* getOnSelect_Fct() const;
445 virtual void setOnSelect_Fct( SjJScriptFunctionObject
* pFunctionObject
);
446 virtual String
getOnBlur() const;
447 virtual void setOnBlur( const String
& aSourceStrg
);
449 virtual String
getOnChange() const;
450 virtual void setOnChange( const String
& aSourceStrg
);
452 virtual String
getOnFocus() const;
453 virtual void setOnFocus( const String
& aSourceStrg
);
455 virtual String
getOnSelect() const;
456 virtual void setOnSelect( const String
& aSourceStrg
);
460 ImpSjJScriptTextareaObject( VCControl
* _pControl
, SjJSbxObject
* p
);
463 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
465 class ImpSjJScriptSubmitObject
: public SjJScriptSubmitObject
, ImpSjJScriptControlBase
467 // Identisch mit ButtonObject
469 // Methoden von Java --> C++ (f"ur Properties)
470 //--------------------------------------------
471 // Basisklassen-Properties, werden an ImpSjJScriptControlBase durchgereicht
472 virtual String
getName() const;
473 virtual void setName( const String
& aStrg
);
474 virtual String
getValue() const;
475 virtual void setValue( const String
& aStrg
);
476 virtual String
getType() const;
478 // Methoden des Objektes
479 virtual void click();
481 // Events (C++ --> Java)
482 //----------------------
483 // Neue Event-Schnittstelle mit Function-Objekten
484 virtual SjJScriptFunctionObject
* getOnClick_Fct() const;
485 virtual void setOnClick_Fct( SjJScriptFunctionObject
* pFunctionObject
);
486 virtual String
getOnClick() const;
487 virtual void setOnClick( const String
& aSourceStrg
);
491 ImpSjJScriptSubmitObject( VCControl
* _pControl
, SjJSbxObject
* p
);
494 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
496 class ImpSjJScriptResetObject
: public SjJScriptResetObject
, ImpSjJScriptControlBase
498 // Identisch mit ButtonObject
500 // Methoden von Java --> C++ (f"ur Properties)
501 //--------------------------------------------
502 // Basisklassen-Properties, werden an ImpSjJScriptControlBase durchgereicht
503 virtual String
getName() const;
504 virtual void setName( const String
& aStrg
);
505 virtual String
getValue() const;
506 virtual void setValue( const String
& aStrg
);
507 virtual String
getType() const;
509 // Methoden des Objektes
510 virtual void click();
512 // Events (C++ --> Java)
513 //----------------------
514 // Neue Event-Schnittstelle mit Function-Objekten
515 virtual SjJScriptFunctionObject
* getOnClick_Fct() const;
516 virtual void setOnClick_Fct( SjJScriptFunctionObject
* pFunctionObject
);
517 virtual String
getOnClick() const;
518 virtual void setOnClick( const String
& aSourceStrg
);
522 ImpSjJScriptResetObject( VCControl
* _pControl
, SjJSbxObject
* p
);
525 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
527 class ImpSjJScriptHiddenObject
: public SjJScriptHiddenObject
, ImpSjJScriptControlBase
530 // Methoden von Java --> C++ (f"ur Properties)
531 //--------------------------------------------
532 // Basisklassen-Properties, werden an ImpSjJScriptControlBase durchgereicht
533 virtual String
getName() const;
534 virtual void setName( const String
& aStrg
);
535 virtual String
getValue() const;
536 virtual String
getType() const;
538 // getValue() wird in der Basisklasse definiert
539 virtual void setValue( const String
& aStrg
);
541 // Methoden des Objektes
544 // Events (C++ --> Java)
545 //----------------------
549 ImpSjJScriptHiddenObject( VCControl
* _pControl
, SjJSbxObject
* p
);
552 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
554 class ImpSjJScriptFileUploadObject
: public SjJScriptFileUploadObject
, ImpSjJScriptControlBase
557 // Methoden von Java --> C++ (f"ur Properties)
558 //--------------------------------------------
559 // Basisklassen-Properties, werden an ImpSjJScriptControlBase durchgereicht
560 virtual String
getName() const;
561 virtual void setName( const String
& aStrg
);
562 virtual String
getValue() const;
563 virtual String
getType() const;
565 // Methoden des Objektes
568 // Events (C++ --> Java)
569 //----------------------
573 ImpSjJScriptFileUploadObject( VCControl
* _pControl
, SjJSbxObject
* p
);
576 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
578 class ImpSjJScriptFormObject
: public SjJScriptFormObject
583 // Methoden von Java --> C++ (f"ur Properties)
584 //--------------------------------------------
585 virtual String
getName() const;
586 virtual void setName( const String
& aStrg
);
587 virtual String
getValue() const;
588 virtual String
getType() const;
590 virtual String
getAction() const;
591 virtual void setAction( const String
& sValue
);
592 virtual String
getEncoding() const;
593 virtual void setEncoding( const String
& sValue
);
594 virtual String
getMethod() const;
595 virtual void setMethod( const String
& sValue
);
596 virtual String
getTarget() const;
597 virtual void setTarget( const String
& sValue
);
599 // SjJSbxArrayObject-Methoden
600 INT32
getLength() const;
601 SjJSbxObject
* getElement( INT32 nIndex
) const;
602 SjJSbxObject
* getElement_String( const String
& aName
) const;
604 // liefert ein Array-Objekt mit Elementen vom Typ JScriptAbstractControlsObject
605 // yyy Raus zum inkompatiblen
606 //virtual SjJSbxArrayObject * getElements();
608 // Zugriff ueber den Namen eines Controls (falls ein Name zugeordnet ist)
609 // yyy Raus zum inkompatiblen
610 //virtual SjJSbxObject * getElement( const String & aName );
612 // Methoden des Objektes
613 virtual void submit();
614 virtual void reset();
616 // Events (C++ --> Java)
617 //----------------------
618 // Neue Event-Schnittstelle mit Function-Objekten
619 virtual SjJScriptFunctionObject
* getOnSubmit_Fct() const;
620 virtual void setOnSubmit_Fct( SjJScriptFunctionObject
* pFunctionObject
);
621 virtual SjJScriptFunctionObject
* getOnReset_Fct() const;
622 virtual void setOnReset_Fct( SjJScriptFunctionObject
* pFunctionObject
);
623 virtual String
getOnSubmit() const;
624 virtual void setOnSubmit( const String
& aSourceStrg
);
626 virtual String
getOnReset() const;
627 virtual void setOnReset( const String
& aSourceStrg
);
631 ImpSjJScriptFormObject( VCForm
* _pVCForm
, SjJSbxObject
* p
);
634 }//end of namespace binfilter