xref: /aoo42x/main/basic/source/runtime/props.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_basic.hxx"
30 
31 #include "runtime.hxx"
32 #include "stdobj.hxx"
33 #include "rtlproto.hxx"
34 #include "errobject.hxx"
35 
36 
37 // Properties und Methoden legen beim Get (bWrite = sal_False) den Returnwert
38 // im Element 0 des Argv ab; beim Put (bWrite = sal_True) wird der Wert aus
39 // Element 0 gespeichert.
40 
41 RTLFUNC(Erl)
42 {
43     (void)pBasic;
44     (void)bWrite;
45 
46 	rPar.Get( 0 )->PutLong( StarBASIC::GetErl() );
47 }
48 
49 RTLFUNC(Err)
50 {
51     (void)pBasic;
52     (void)bWrite;
53 
54 	if( SbiRuntime::isVBAEnabled() )
55 	{
56 		rPar.Get( 0 )->PutObject( SbxErrObject::getErrObject() );
57 	}
58 	else
59 	{
60 		if( bWrite )
61 		{
62 			sal_Int32 nVal = rPar.Get( 0 )->GetLong();
63 			if( nVal <= 65535L )
64 				StarBASIC::Error( StarBASIC::GetSfxFromVBError( (sal_uInt16) nVal ) );
65 		}
66 		else
67 			rPar.Get( 0 )->PutLong( StarBASIC::GetVBErrorCode( StarBASIC::GetErrBasic() ) );
68 	}
69 }
70 
71 RTLFUNC(False)
72 {
73     (void)pBasic;
74     (void)bWrite;
75 
76 	rPar.Get(0)->PutBool( sal_False );
77 }
78 
79 RTLFUNC(Empty)
80 {
81     (void)pBasic;
82     (void)bWrite;
83     (void)rPar;
84 }
85 
86 RTLFUNC(Nothing)
87 {
88     (void)pBasic;
89     (void)bWrite;
90 
91 	// liefert eine leere Objekt-Variable.
92 	rPar.Get( 0 )->PutObject( NULL );
93 }
94 
95 RTLFUNC(Null)
96 {
97     (void)pBasic;
98     (void)bWrite;
99 
100 	// liefert eine leere Objekt-Variable.
101 	rPar.Get( 0 )->PutNull();
102 }
103 
104 RTLFUNC(PI)
105 {
106     (void)pBasic;
107     (void)bWrite;
108 
109 	rPar.Get( 0 )->PutDouble( F_PI );
110 }
111 
112 RTLFUNC(True)
113 {
114     (void)pBasic;
115     (void)bWrite;
116 
117 	rPar.Get( 0 )->PutBool( sal_True );
118 }
119 
120 RTLFUNC(ATTR_NORMAL)
121 {
122     (void)pBasic;
123     (void)bWrite;
124 
125 	rPar.Get(0)->PutInteger(0);
126 }
127 RTLFUNC(ATTR_READONLY)
128 {
129     (void)pBasic;
130     (void)bWrite;
131 
132 	rPar.Get(0)->PutInteger(1);
133 }
134 RTLFUNC(ATTR_HIDDEN)
135 {
136     (void)pBasic;
137     (void)bWrite;
138 
139 	rPar.Get(0)->PutInteger(2);
140 }
141 RTLFUNC(ATTR_SYSTEM)
142 {
143     (void)pBasic;
144     (void)bWrite;
145 
146 	rPar.Get(0)->PutInteger(4);
147 }
148 RTLFUNC(ATTR_VOLUME)
149 {
150     (void)pBasic;
151     (void)bWrite;
152 
153 	rPar.Get(0)->PutInteger(8);
154 }
155 RTLFUNC(ATTR_DIRECTORY)
156 {
157     (void)pBasic;
158     (void)bWrite;
159 
160 	rPar.Get(0)->PutInteger(16);
161 }
162 RTLFUNC(ATTR_ARCHIVE)
163 {
164     (void)pBasic;
165     (void)bWrite;
166 
167 	rPar.Get(0)->PutInteger(32);
168 }
169 
170 RTLFUNC(V_EMPTY)
171 {
172     (void)pBasic;
173     (void)bWrite;
174 
175 	rPar.Get(0)->PutInteger(0);
176 }
177 RTLFUNC(V_NULL)
178 {
179     (void)pBasic;
180     (void)bWrite;
181 
182 	rPar.Get(0)->PutInteger(1);
183 }
184 RTLFUNC(V_INTEGER)
185 {
186     (void)pBasic;
187     (void)bWrite;
188 
189 	rPar.Get(0)->PutInteger(2);
190 }
191 RTLFUNC(V_LONG)
192 {
193     (void)pBasic;
194     (void)bWrite;
195 
196 	rPar.Get(0)->PutInteger(3);
197 }
198 RTLFUNC(V_SINGLE)
199 {
200     (void)pBasic;
201     (void)bWrite;
202 
203 	rPar.Get(0)->PutInteger(4);
204 }
205 RTLFUNC(V_DOUBLE)
206 {
207     (void)pBasic;
208     (void)bWrite;
209 
210 	rPar.Get(0)->PutInteger(5);
211 }
212 RTLFUNC(V_CURRENCY)
213 {
214     (void)pBasic;
215     (void)bWrite;
216 
217 	rPar.Get(0)->PutInteger(6);
218 }
219 RTLFUNC(V_DATE)
220 {
221     (void)pBasic;
222     (void)bWrite;
223 
224 	rPar.Get(0)->PutInteger(7);
225 }
226 RTLFUNC(V_STRING)
227 {
228     (void)pBasic;
229     (void)bWrite;
230 
231 	rPar.Get(0)->PutInteger(8);
232 }
233 
234 RTLFUNC(MB_OK)
235 {
236     (void)pBasic;
237     (void)bWrite;
238 
239 	rPar.Get(0)->PutInteger(0);
240 }
241 RTLFUNC(MB_OKCANCEL)
242 {
243     (void)pBasic;
244     (void)bWrite;
245 
246 	rPar.Get(0)->PutInteger(1);
247 }
248 RTLFUNC(MB_ABORTRETRYIGNORE)
249 {
250     (void)pBasic;
251     (void)bWrite;
252 
253 	rPar.Get(0)->PutInteger(2);
254 }
255 RTLFUNC(MB_YESNOCANCEL)
256 {
257     (void)pBasic;
258     (void)bWrite;
259 
260 	rPar.Get(0)->PutInteger(3);
261 }
262 RTLFUNC(MB_YESNO)
263 {
264     (void)pBasic;
265     (void)bWrite;
266 
267 	rPar.Get(0)->PutInteger(4);
268 }
269 RTLFUNC(MB_RETRYCANCEL)
270 {
271     (void)pBasic;
272     (void)bWrite;
273 
274 	rPar.Get(0)->PutInteger(5);
275 }
276 RTLFUNC(MB_ICONSTOP)
277 {
278     (void)pBasic;
279     (void)bWrite;
280 
281 	rPar.Get(0)->PutInteger(16);
282 }
283 RTLFUNC(MB_ICONQUESTION)
284 {
285     (void)pBasic;
286     (void)bWrite;
287 
288 	rPar.Get(0)->PutInteger(32);
289 }
290 RTLFUNC(MB_ICONEXCLAMATION)
291 {
292     (void)pBasic;
293     (void)bWrite;
294 
295 	rPar.Get(0)->PutInteger(48);
296 }
297 RTLFUNC(MB_ICONINFORMATION)
298 {
299     (void)pBasic;
300     (void)bWrite;
301 
302 	rPar.Get(0)->PutInteger(64);
303 }
304 RTLFUNC(MB_DEFBUTTON1)
305 {
306     (void)pBasic;
307     (void)bWrite;
308 
309 	rPar.Get(0)->PutInteger(0);
310 }
311 RTLFUNC(MB_DEFBUTTON2)
312 {
313     (void)pBasic;
314     (void)bWrite;
315 
316 	rPar.Get(0)->PutInteger(256);
317 }
318 RTLFUNC(MB_DEFBUTTON3)
319 {
320     (void)pBasic;
321     (void)bWrite;
322 
323 	rPar.Get(0)->PutInteger(512);
324 }
325 RTLFUNC(MB_APPLMODAL)
326 {
327     (void)pBasic;
328     (void)bWrite;
329 
330 	rPar.Get(0)->PutInteger(0);
331 }
332 RTLFUNC(MB_SYSTEMMODAL)
333 {
334     (void)pBasic;
335     (void)bWrite;
336 
337 	rPar.Get(0)->PutInteger(4096);
338 }
339 
340 RTLFUNC(IDOK)
341 {
342     (void)pBasic;
343     (void)bWrite;
344 
345 	rPar.Get(0)->PutInteger(1);
346 }
347 
348 RTLFUNC(IDCANCEL)
349 {
350     (void)pBasic;
351     (void)bWrite;
352 
353 	rPar.Get(0)->PutInteger(2);
354 }
355 RTLFUNC(IDABORT)
356 {
357     (void)pBasic;
358     (void)bWrite;
359 
360 	rPar.Get(0)->PutInteger(3);
361 }
362 RTLFUNC(IDRETRY)
363 {
364     (void)pBasic;
365     (void)bWrite;
366 
367 	rPar.Get(0)->PutInteger(4);
368 }
369 RTLFUNC(IDYES)
370 {
371     (void)pBasic;
372     (void)bWrite;
373 
374 	rPar.Get(0)->PutInteger(6);
375 }
376 RTLFUNC(IDNO)
377 {
378     (void)pBasic;
379     (void)bWrite;
380 
381 	rPar.Get(0)->PutInteger(7);
382 }
383 
384 RTLFUNC(CF_TEXT)
385 {
386     (void)pBasic;
387     (void)bWrite;
388 
389 	rPar.Get(0)->PutInteger(1);
390 }
391 RTLFUNC(CF_BITMAP)
392 {
393     (void)pBasic;
394     (void)bWrite;
395 
396 	rPar.Get(0)->PutInteger(2);
397 }
398 RTLFUNC(CF_METAFILEPICT)
399 {
400     (void)pBasic;
401     (void)bWrite;
402 
403 	rPar.Get(0)->PutInteger(3);
404 }
405 
406 RTLFUNC(TYP_AUTHORFLD)
407 {
408     (void)pBasic;
409     (void)bWrite;
410 
411 	rPar.Get(0)->PutInteger(7);
412 }
413 RTLFUNC(TYP_CHAPTERFLD)
414 {
415     (void)pBasic;
416     (void)bWrite;
417 
418 	rPar.Get(0)->PutInteger(4);
419 }
420 RTLFUNC(TYP_CONDTXTFLD)
421 {
422     (void)pBasic;
423     (void)bWrite;
424 
425 	rPar.Get(0)->PutInteger(27);
426 }
427 RTLFUNC(TYP_DATEFLD)
428 {
429     (void)pBasic;
430     (void)bWrite;
431 
432 	rPar.Get(0)->PutInteger(0);
433 }
434 RTLFUNC(TYP_DBFLD)
435 {
436     (void)pBasic;
437     (void)bWrite;
438 
439 	rPar.Get(0)->PutInteger(19);
440 }
441 RTLFUNC(TYP_DBNAMEFLD)
442 {
443     (void)pBasic;
444     (void)bWrite;
445 
446 	rPar.Get(0)->PutInteger(3);
447 }
448 RTLFUNC(TYP_DBNEXTSETFLD)
449 {
450     (void)pBasic;
451     (void)bWrite;
452 
453 	rPar.Get(0)->PutInteger(24);
454 }
455 RTLFUNC(TYP_DBNUMSETFLD)
456 {
457     (void)pBasic;
458     (void)bWrite;
459 
460 	rPar.Get(0)->PutInteger(25);
461 }
462 RTLFUNC(TYP_DBSETNUMBERFLD)
463 {
464     (void)pBasic;
465     (void)bWrite;
466 
467 	rPar.Get(0)->PutInteger(26);
468 }
469 RTLFUNC(TYP_DDEFLD)
470 {
471     (void)pBasic;
472     (void)bWrite;
473 
474 	rPar.Get(0)->PutInteger(14);
475 }
476 RTLFUNC(TYP_DOCINFOFLD)
477 {
478     (void)pBasic;
479     (void)bWrite;
480 
481 	rPar.Get(0)->PutInteger(18);
482 }
483 RTLFUNC(TYP_DOCSTATFLD)
484 {
485     (void)pBasic;
486     (void)bWrite;
487 
488 	rPar.Get(0)->PutInteger(6);
489 }
490 RTLFUNC(TYP_EXTUSERFLD)
491 {
492     (void)pBasic;
493     (void)bWrite;
494 
495 	rPar.Get(0)->PutInteger(30);
496 }
497 RTLFUNC(TYP_FILENAMEFLD)
498 {
499     (void)pBasic;
500     (void)bWrite;
501 
502 	rPar.Get(0)->PutInteger(2);
503 }
504 RTLFUNC(TYP_FIXDATEFLD)
505 {
506     (void)pBasic;
507     (void)bWrite;
508 
509 	rPar.Get(0)->PutInteger(31);
510 }
511 RTLFUNC(TYP_FIXTIMEFLD)
512 {
513     (void)pBasic;
514     (void)bWrite;
515 
516 	rPar.Get(0)->PutInteger(32);
517 }
518 RTLFUNC(TYP_FORMELFLD)
519 {
520     (void)pBasic;
521     (void)bWrite;
522 
523 	rPar.Get(0)->PutInteger(10);
524 }
525 RTLFUNC(TYP_GETFLD)
526 {
527     (void)pBasic;
528     (void)bWrite;
529 
530 	rPar.Get(0)->PutInteger(9);
531 }
532 RTLFUNC(TYP_GETREFFLD)
533 {
534     (void)pBasic;
535     (void)bWrite;
536 
537 	rPar.Get(0)->PutInteger(13);
538 }
539 RTLFUNC(TYP_HIDDENPARAFLD)
540 {
541     (void)pBasic;
542     (void)bWrite;
543 
544 	rPar.Get(0)->PutInteger(17);
545 }
546 RTLFUNC(TYP_HIDDENTXTFLD)
547 {
548     (void)pBasic;
549     (void)bWrite;
550 
551 	rPar.Get(0)->PutInteger(11);
552 }
553 RTLFUNC(TYP_INPUTFLD)
554 {
555     (void)pBasic;
556     (void)bWrite;
557 
558 	rPar.Get(0)->PutInteger(16);
559 }
560 RTLFUNC(TYP_MACROFLD)
561 {
562     (void)pBasic;
563     (void)bWrite;
564 
565 	rPar.Get(0)->PutInteger(15);
566 }
567 RTLFUNC(TYP_NEXTPAGEFLD)
568 {
569     (void)pBasic;
570     (void)bWrite;
571 
572 	rPar.Get(0)->PutInteger(28);
573 }
574 RTLFUNC(TYP_PAGENUMBERFLD)
575 {
576     (void)pBasic;
577     (void)bWrite;
578 
579 	rPar.Get(0)->PutInteger(5);
580 }
581 RTLFUNC(TYP_POSTITFLD)
582 {
583     (void)pBasic;
584     (void)bWrite;
585 
586 	rPar.Get(0)->PutInteger(21);
587 }
588 RTLFUNC(TYP_PREVPAGEFLD)
589 {
590     (void)pBasic;
591     (void)bWrite;
592 
593 	rPar.Get(0)->PutInteger(29);
594 }
595 RTLFUNC(TYP_SEQFLD)
596 {
597     (void)pBasic;
598     (void)bWrite;
599 
600 	rPar.Get(0)->PutInteger(23);
601 }
602 RTLFUNC(TYP_SETFLD)
603 {
604     (void)pBasic;
605     (void)bWrite;
606 
607 	rPar.Get(0)->PutInteger(8);
608 }
609 RTLFUNC(TYP_SETINPFLD)
610 {
611     (void)pBasic;
612     (void)bWrite;
613 
614 	rPar.Get(0)->PutInteger(33);
615 }
616 RTLFUNC(TYP_SETREFFLD)
617 {
618     (void)pBasic;
619     (void)bWrite;
620 
621 	rPar.Get(0)->PutInteger(12);
622 }
623 RTLFUNC(TYP_TEMPLNAMEFLD)
624 {
625     (void)pBasic;
626     (void)bWrite;
627 
628 	rPar.Get(0)->PutInteger(22);
629 }
630 RTLFUNC(TYP_TIMEFLD)
631 {
632     (void)pBasic;
633     (void)bWrite;
634 
635 	rPar.Get(0)->PutInteger(1);
636 }
637 RTLFUNC(TYP_USERFLD)
638 {
639     (void)pBasic;
640     (void)bWrite;
641 
642 	rPar.Get(0)->PutInteger(20);
643 }
644 RTLFUNC(TYP_USRINPFLD)
645 {
646     (void)pBasic;
647     (void)bWrite;
648 
649 	rPar.Get(0)->PutInteger(34);
650 }
651 RTLFUNC(TYP_SETREFPAGEFLD)
652 {
653     (void)pBasic;
654     (void)bWrite;
655 
656 	rPar.Get(0)->PutInteger(35);
657 }
658 RTLFUNC(TYP_GETREFPAGEFLD)
659 {
660     (void)pBasic;
661     (void)bWrite;
662 
663 	rPar.Get(0)->PutInteger(36);
664 }
665 RTLFUNC(TYP_INTERNETFLD)
666 {
667     (void)pBasic;
668     (void)bWrite;
669 
670 	rPar.Get(0)->PutInteger(37);
671 }
672 
673 RTLFUNC(SET_ON)
674 {
675     (void)pBasic;
676     (void)bWrite;
677 
678 	rPar.Get(0)->PutInteger(1);
679 }
680 RTLFUNC(SET_OFF)
681 {
682     (void)pBasic;
683     (void)bWrite;
684 
685 	rPar.Get(0)->PutInteger(0);
686 }
687 RTLFUNC(TOGGLE)
688 {
689     (void)pBasic;
690     (void)bWrite;
691 
692 	rPar.Get(0)->PutInteger(2);
693 }
694 
695 RTLFUNC(FRAMEANCHORPAGE)
696 {
697     (void)pBasic;
698     (void)bWrite;
699 
700 	rPar.Get(0)->PutInteger(1);
701 }
702 RTLFUNC(FRAMEANCHORPARA)
703 {
704     (void)pBasic;
705     (void)bWrite;
706 
707 	rPar.Get(0)->PutInteger(14);
708 }
709 RTLFUNC(FRAMEANCHORCHAR)
710 {
711     (void)pBasic;
712     (void)bWrite;
713 
714 	rPar.Get(0)->PutInteger(15);
715 }
716 
717 RTLFUNC(CLEAR_ALLTABS)
718 {
719     (void)pBasic;
720     (void)bWrite;
721 
722 	rPar.Get(0)->PutInteger(2);
723 }
724 RTLFUNC(CLEAR_TAB)
725 {
726     (void)pBasic;
727     (void)bWrite;
728 
729 	rPar.Get(0)->PutInteger(1);
730 }
731 RTLFUNC(SET_TAB)
732 {
733     (void)pBasic;
734     (void)bWrite;
735 
736 	rPar.Get(0)->PutInteger(0);
737 }
738 
739 RTLFUNC(LINEPROP)
740 {
741     (void)pBasic;
742     (void)bWrite;
743 
744 	rPar.Get(0)->PutInteger(0);
745 }
746 RTLFUNC(LINE_1)
747 {
748     (void)pBasic;
749     (void)bWrite;
750 
751 	rPar.Get(0)->PutInteger(1);
752 }
753 RTLFUNC(LINE_15)
754 {
755     (void)pBasic;
756     (void)bWrite;
757 
758 	rPar.Get(0)->PutInteger(2);
759 }
760 RTLFUNC(LINE_2)
761 {
762     (void)pBasic;
763     (void)bWrite;
764 
765 	rPar.Get(0)->PutInteger(3);
766 }
767 
768 RTLFUNC(TYP_JUMPEDITFLD)
769 {
770     (void)pBasic;
771     (void)bWrite;
772 
773 	rPar.Get(0)->PutInteger(38);
774 }
775 
776 
777