1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_rsc.hxx"
30 /****************** I N C L U D E S **************************************/
32 // C and C++ Includes.
37 #include <tools/solar.h>
39 /****************** C O D E **********************************************/
40 /****************** R s c T o p ******************************************/
41 /*************************************************************************
46 |* Ersterstellung MM 03.06.91
47 |* Letzte Aenderung MM 03.06.91
49 *************************************************************************/
50 RscTop::RscTop( Atom nId
, sal_uInt32 nTypIdent
, RscTop
* pSuperCl
)
52 , pSuperClass( pSuperCl
)
57 SetCallPar( pSuperClass
->aCallPar1
, pSuperClass
->aCallPar2
,
58 pSuperClass
->aCallParType
);
61 /*************************************************************************
63 |* RscTop::SetCallPar()
66 |* Ersterstellung MM 29.10.91
67 |* Letzte Aenderung MM 29.10.91
69 *************************************************************************/
70 void RscTop::SetCallPar( const ByteString
& rPar1
, const ByteString
& rPar2
,
71 const ByteString
& rParType
)
75 aCallParType
= rParType
;
78 /*************************************************************************
80 |* RscTop::GetDefault()
83 |* Ersterstellung MM 29.10.91
84 |* Letzte Aenderung MM 29.10.91
86 *************************************************************************/
87 RSCINST
RscTop::GetDefault()
89 if( !aDfltInst
.IsInst() )
90 aDfltInst
= this->Create( NULL
, RSCINST() );
94 /*************************************************************************
99 |* Ersterstellung MM 19.06.91
100 |* Letzte Aenderung MM 19.06.91
102 *************************************************************************/
103 void RscTop :: Pre_dtor(){
104 if( aDfltInst
.IsInst() ){
105 aDfltInst
.pClass
->Destroy( aDfltInst
);
106 rtl_freeMemory( aDfltInst
.pData
);
107 aDfltInst
= RSCINST();
111 /*************************************************************************
113 |* RscTop::GetConstant()
116 |* Ersterstellung MM 29.10.91
117 |* Letzte Aenderung MM 29.10.91
119 *************************************************************************/
120 Atom
RscTop :: GetConstant( sal_uInt32
){
124 /*************************************************************************
126 |* RscTop::GetIndexType()
129 |* Ersterstellung MM 29.10.91
130 |* Letzte Aenderung MM 29.10.91
132 *************************************************************************/
133 RscTop
* RscTop::GetTypeClass() const
136 return pSuperClass
->GetTypeClass();
141 /*************************************************************************
146 |* Ersterstellung MM 29.10.91
147 |* Letzte Aenderung MM 29.10.91
149 *************************************************************************/
150 sal_uInt32
RscTop :: Size()
153 return pSuperClass
->Size();
158 /*************************************************************************
163 |* Ersterstellung MM 29.10.91
164 |* Letzte Aenderung MM 29.10.91
166 *************************************************************************/
167 ERRTYPE
RscTop :: GetRef( const RSCINST
& rInst
, RscId
* pRscId
){
169 return pSuperClass
->GetRef( rInst
, pRscId
);
171 return ERR_UNKNOWN_METHOD
;
174 /*************************************************************************
176 |* RscTop::InHierarchy()
179 |* Ersterstellung MM 17.05.91
180 |* Letzte Aenderung MM 17.05.91
182 *************************************************************************/
183 sal_Bool
RscTop::InHierarchy( RscTop
* pClass
){
187 return( pSuperClass
->InHierarchy( pClass
) );
191 /*************************************************************************
193 |* RscTop::SetVariable()
196 |* Ersterstellung MM 29.10.91
197 |* Letzte Aenderung MM 29.10.91
199 *************************************************************************/
200 ERRTYPE
RscTop::SetVariable( Atom nVarName
, RscTop
* pClass
,
201 RSCINST
* pDflt
, RSCVAR nVarType
, sal_uInt32 nMask
,
206 SetVariable( nVarName
, pClass
, pDflt
,
207 nVarType
, nMask
, nDataBaseName
);
209 return ERR_UNKNOWN_METHOD
;
212 /*************************************************************************
214 |* RscTop::EnumVariable()
217 |* Ersterstellung MM 03.02.93
218 |* Letzte Aenderung MM 03.02.93
220 *************************************************************************/
221 void RscTop::EnumVariables( void * pData
, VarEnumCallbackProc pProc
)
224 pSuperClass
->EnumVariables( pData
, pProc
);
227 /*************************************************************************
229 |* RscTop::GetVariable()
232 |* Ersterstellung MM 29.10.91
233 |* Letzte Aenderung MM 29.10.91
235 *************************************************************************/
236 RSCINST
RscTop::GetVariable
238 const RSCINST
& rInst
,
240 const RSCINST
& rInitInst
,
242 RscTop
* pCreateClass
247 GetVariable( rInst
, nVarName
, rInitInst
, bInitDflt
, pCreateClass
);
252 /*************************************************************************
254 |* RscTop::GetCopyVar()
257 |* Ersterstellung MM 29.10.91
258 |* Letzte Aenderung MM 29.10.91
260 *************************************************************************/
261 RSCINST
RscTop::GetCopyVar( const RSCINST
& rInst
, Atom nVarName
)
265 GetCopyVar( rInst
, nVarName
);
270 /*************************************************************************
272 |* RscTop::GetTupelVar()
275 |* Ersterstellung MM 29.10.91
276 |* Letzte Aenderung MM 29.10.91
278 *************************************************************************/
279 RSCINST
RscTop::GetTupelVar( const RSCINST
& rInst
, sal_uInt32 nPos
,
280 const RSCINST
& rInitInst
)
283 return pSuperClass
->GetTupelVar( rInst
, nPos
, rInitInst
);
288 /*************************************************************************
290 |* RscTop::GetElement()
293 |* Ersterstellung MM 29.10.91
294 |* Letzte Aenderung MM 29.10.91
296 *************************************************************************/
297 ERRTYPE
RscTop::GetElement( const RSCINST
& rInst
, const RscId
& rEleName
,
298 RscTop
*pCreateClass
, const RSCINST
& rCreateInst
,
303 GetElement( rInst
, rEleName
,
304 pCreateClass
, rCreateInst
,
307 return ERR_UNKNOWN_METHOD
;
310 /*************************************************************************
312 |* RscTop::GetArrayEle()
315 |* Ersterstellung MM 29.10.91
316 |* Letzte Aenderung MM 29.10.91
318 *************************************************************************/
319 ERRTYPE
RscTop::GetArrayEle
321 const RSCINST
& rInst
,
323 RscTop
* pCreateClass
,
328 return pSuperClass
->GetArrayEle( rInst
, nId
, pCreateClass
, pGetInst
);
330 return ERR_UNKNOWN_METHOD
;
333 /*************************************************************************
335 |* RscTop::GetValueEle()
338 |* Ersterstellung MM 29.10.91
339 |* Letzte Aenderung MM 29.10.91
341 *************************************************************************/
342 ERRTYPE
RscTop::GetValueEle
344 const RSCINST
& rInst
,
346 RscTop
* pCreateClass
,
351 return pSuperClass
->GetValueEle( rInst
, lValue
, pCreateClass
, pGetInst
);
353 return ERR_UNKNOWN_METHOD
;
356 /*************************************************************************
358 |* RscTop::SearchEle()
361 |* Ersterstellung MM 29.10.91
362 |* Letzte Aenderung MM 29.10.91
364 *************************************************************************/
365 RSCINST
RscTop::SearchEle( const RSCINST
& rInst
, const RscId
& rEleName
,
370 SearchEle( rInst
, rEleName
, pClass
);
375 /*************************************************************************
377 |* RscTop::GetPosEle()
380 |* Ersterstellung MM 29.10.91
381 |* Letzte Aenderung MM 29.10.91
383 *************************************************************************/
384 RSCINST
RscTop::GetPosEle( const RSCINST
& rInst
, sal_uInt32 nPos
){
387 GetPosEle( rInst
, nPos
);
392 /*************************************************************************
394 |* RscTop::MovePosEle()
397 |* Ersterstellung MM 29.10.91
398 |* Letzte Aenderung MM 29.10.91
400 *************************************************************************/
401 ERRTYPE
RscTop::MovePosEle( const RSCINST
& rInst
, sal_uInt32 nDestPos
,
402 sal_uInt32 nSourcePos
)
406 MovePosEle( rInst
, nDestPos
, nSourcePos
);
408 return ERR_UNKNOWN_METHOD
;
411 /*************************************************************************
413 |* RscTop::SetPosRscId()
416 |* Ersterstellung MM 29.10.91
417 |* Letzte Aenderung MM 29.10.91
419 *************************************************************************/
420 ERRTYPE
RscTop::SetPosRscId( const RSCINST
& rInst
, sal_uInt32 nPos
,
421 const RscId
& rRscId
)
425 SetPosRscId( rInst
, nPos
, rRscId
);
427 return ERR_UNKNOWN_METHOD
;
430 /*************************************************************************
432 |* RscTop::GetInfoEle()
435 |* Ersterstellung MM 29.10.91
436 |* Letzte Aenderung MM 29.10.91
438 *************************************************************************/
439 SUBINFO_STRUCT
RscTop::GetInfoEle( const RSCINST
& rInst
, sal_uInt32 nPos
){
442 GetInfoEle( rInst
, nPos
);
444 return SUBINFO_STRUCT();
447 /*************************************************************************
449 |* RscTop::GetCount()
452 |* Ersterstellung MM 29.10.91
453 |* Letzte Aenderung MM 29.10.91
455 *************************************************************************/
456 sal_uInt32
RscTop::GetCount( const RSCINST
& rInst
){
458 return pSuperClass
->GetCount( rInst
);
463 /*************************************************************************
465 |* RscTop::SetNumber()
468 |* Ersterstellung MM 29.10.91
469 |* Letzte Aenderung MM 29.10.91
471 *************************************************************************/
472 ERRTYPE
RscTop::SetNumber( const RSCINST
& rInst
, sal_Int32 lValue
){
475 SetNumber( rInst
, lValue
);
477 return ERR_UNKNOWN_METHOD
;
480 /*************************************************************************
485 |* Ersterstellung MM 29.10.91
486 |* Letzte Aenderung MM 29.10.91
488 *************************************************************************/
489 ERRTYPE
RscTop::SetBool( const RSCINST
& rInst
, sal_Bool bValue
){
492 SetBool( rInst
, bValue
);
494 return ERR_UNKNOWN_METHOD
;
497 /*************************************************************************
499 |* RscTop::SetConst()
502 |* Ersterstellung MM 29.10.91
503 |* Letzte Aenderung MM 29.10.91
505 *************************************************************************/
506 ERRTYPE
RscTop::SetConst( const RSCINST
& rInst
, Atom nId
, sal_Int32 nVal
)
509 return pSuperClass
->SetConst( rInst
, nId
, nVal
);
511 return ERR_UNKNOWN_METHOD
;
514 /*************************************************************************
516 |* RscTop::SetNotConst()
519 |* Ersterstellung MM 29.10.91
520 |* Letzte Aenderung MM 29.10.91
522 *************************************************************************/
523 ERRTYPE
RscTop::SetNotConst( const RSCINST
& rInst
, Atom nId
){
526 SetNotConst( rInst
, nId
);
528 return ERR_UNKNOWN_METHOD
;
531 /*************************************************************************
533 |* RscTop::SetString()
536 |* Ersterstellung MM 29.10.91
537 |* Letzte Aenderung MM 29.10.91
539 *************************************************************************/
540 ERRTYPE
RscTop::SetString( const RSCINST
& rInst
, const char * pStr
){
543 SetString( rInst
, pStr
);
545 return ERR_UNKNOWN_METHOD
;
548 /*************************************************************************
550 |* RscTop::GetNumber()
553 |* Ersterstellung MM 29.10.91
554 |* Letzte Aenderung MM 29.10.91
556 *************************************************************************/
557 ERRTYPE
RscTop::GetNumber( const RSCINST
& rInst
, sal_Int32
* pN
){
560 GetNumber( rInst
, pN
);
562 return ERR_UNKNOWN_METHOD
;
565 /*************************************************************************
570 |* Ersterstellung MM 29.10.91
571 |* Letzte Aenderung MM 29.10.91
573 *************************************************************************/
574 ERRTYPE
RscTop::GetBool( const RSCINST
& rInst
, sal_Bool
* pB
){
577 GetBool( rInst
, pB
);
579 return ERR_UNKNOWN_METHOD
;
582 /*************************************************************************
587 |* Ersterstellung MM 29.10.91
588 |* Letzte Aenderung MM 29.10.91
590 *************************************************************************/
591 ERRTYPE
RscTop::GetConst( const RSCINST
& rInst
, Atom
* pH
){
594 GetConst( rInst
, pH
);
596 return ERR_UNKNOWN_METHOD
;
599 /*************************************************************************
601 |* RscTop::GetString()
604 |* Ersterstellung MM 29.10.91
605 |* Letzte Aenderung MM 29.10.91
607 *************************************************************************/
608 ERRTYPE
RscTop::GetString( const RSCINST
& rInst
, char ** ppStr
){
611 GetString( rInst
, ppStr
);
613 return ERR_UNKNOWN_METHOD
;
616 /*************************************************************************
621 |* Ersterstellung MM 17.05.91
622 |* Letzte Aenderung MM 17.07.91
624 *************************************************************************/
625 RSCINST
RscTop::Create( RSCINST
* pInst
, const RSCINST
& rDefInst
, sal_Bool bOwnRange
)
629 Create( pInst
, rDefInst
, bOwnRange
);
637 /*************************************************************************
642 |* Ersterstellung MM 29.10.91
643 |* Letzte Aenderung MM 29.10.91
645 *************************************************************************/
646 void RscTop::Destroy( const RSCINST
& rInst
){
648 pSuperClass
->Destroy( rInst
);
651 /*************************************************************************
653 |* RscTop::IsConsistent()
656 |* Ersterstellung MM 29.10.91
657 |* Letzte Aenderung MM 29.10.91
659 *************************************************************************/
660 sal_Bool
RscTop::IsConsistent( const RSCINST
& rInst
,
661 RscInconsList
* pList
)
664 return pSuperClass
->IsConsistent( rInst
, pList
);
669 /*************************************************************************
671 |* RscTop::SetToDefault()
674 |* Ersterstellung MM 29.10.91
675 |* Letzte Aenderung MM 29.10.91
677 *************************************************************************/
678 void RscTop::SetToDefault( const RSCINST
& rInst
)
681 pSuperClass
->SetToDefault( rInst
);
684 /*************************************************************************
686 |* RscTop::IsDefault()
689 |* Ersterstellung MM 29.10.91
690 |* Letzte Aenderung MM 29.10.91
692 *************************************************************************/
693 sal_Bool
RscTop::IsDefault( const RSCINST
& rInst
){
695 return pSuperClass
->IsDefault( rInst
);
700 /*************************************************************************
702 |* RscTop::IsValueDefault()
705 |* Ersterstellung MM 29.10.91
706 |* Letzte Aenderung MM 29.10.91
708 *************************************************************************/
709 sal_Bool
RscTop::IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
){
711 return pSuperClass
->IsValueDefault( rInst
, pDef
);
716 /*************************************************************************
718 |* RscTop::SetDefault()
721 |* Ersterstellung MM 29.10.91
722 |* Letzte Aenderung MM 29.10.91
724 *************************************************************************/
725 void RscTop::SetDefault( const RSCINST
& rInst
, Atom nVarId
){
727 pSuperClass
->SetDefault( rInst
, nVarId
);
730 /*************************************************************************
732 |* RscTop::GetDefault()
735 |* Ersterstellung MM 29.10.91
736 |* Letzte Aenderung MM 29.10.91
738 *************************************************************************/
739 RSCINST
RscTop::GetDefault( Atom nVarId
){
742 GetDefault( nVarId
);
747 /*************************************************************************
752 |* Ersterstellung MM 29.10.91
753 |* Letzte Aenderung MM 29.10.91
755 *************************************************************************/
756 void RscTop::Delete( const RSCINST
& rInst
, RscTop
* pClass
,
760 pSuperClass
->Delete( rInst
, pClass
, rId
);
763 /*************************************************************************
765 |* RscTop::DeletePos()
768 |* Ersterstellung MM 29.10.91
769 |* Letzte Aenderung MM 29.10.91
771 *************************************************************************/
772 void RscTop::DeletePos( const RSCINST
& rInst
, sal_uInt32 nPos
)
775 pSuperClass
->DeletePos( rInst
, nPos
);
778 /*************************************************************************
783 |* Ersterstellung MM 18.09.91
784 |* Letzte Aenderung MM 18.09.91
786 *************************************************************************/
787 ERRTYPE
RscTop::SetRef( const RSCINST
& rInst
, const RscId
& rRefId
){
789 return pSuperClass
->SetRef( rInst
, rRefId
);
791 return ERR_UNKNOWN_METHOD
;
794 /*************************************************************************
796 |* RscTop::WriteHxxHeader()
799 |* Ersterstellung MM 29.05.91
800 |* Letzte Aenderung MM 29.05.91
802 *************************************************************************/
803 ERRTYPE
RscTop::WriteHxxHeader( const RSCINST
& rInst
, FILE * fOutput
,
804 RscTypCont
* pTC
, const RscId
& rId
)
807 return pSuperClass
->WriteHxxHeader( rInst
, fOutput
, pTC
, rId
);
809 return rInst
.pClass
->WriteHxx( rInst
, fOutput
, pTC
, rId
);
812 /*************************************************************************
814 |* RscTop::WriteHxx()
817 |* Ersterstellung MM 29.05.91
818 |* Letzte Aenderung MM 29.05.91
820 *************************************************************************/
821 ERRTYPE
RscTop::WriteHxx( const RSCINST
& rInst
, FILE * fOutput
,
822 RscTypCont
* pTC
, const RscId
& rId
){
824 return pSuperClass
->WriteHxx( rInst
, fOutput
, pTC
, rId
);
829 /*************************************************************************
831 |* RscTop::WriteCxxHeader()
834 |* Ersterstellung MM 29.05.91
835 |* Letzte Aenderung MM 29.05.91
837 *************************************************************************/
838 ERRTYPE
RscTop::WriteCxxHeader( const RSCINST
& rInst
, FILE * fOutput
,
839 RscTypCont
* pTC
, const RscId
& rId
)
842 return pSuperClass
->WriteCxxHeader( rInst
, fOutput
, pTC
, rId
);
844 return rInst
.pClass
->WriteCxx( rInst
, fOutput
, pTC
, rId
);
847 /*************************************************************************
849 |* RscTop::WriteCxx()
852 |* Ersterstellung MM 29.05.91
853 |* Letzte Aenderung MM 29.05.91
855 *************************************************************************/
856 ERRTYPE
RscTop::WriteCxx( const RSCINST
& rInst
, FILE * fOutput
,
857 RscTypCont
* pTC
, const RscId
& rId
){
859 return pSuperClass
->WriteCxx( rInst
, fOutput
, pTC
, rId
);
864 /*************************************************************************
866 |* RscTop::WriteSrcHeader()
869 |* Ersterstellung MM 08.04.91
870 |* Letzte Aenderung MM 08.04.91
872 *************************************************************************/
873 void RscTop::WriteSrcHeader( const RSCINST
& rInst
, FILE * fOutput
,
874 RscTypCont
* pTC
, sal_uInt32 nTab
,
875 const RscId
& rId
, const char * pVarName
)
878 pSuperClass
->WriteSrcHeader( rInst
, fOutput
, pTC
, nTab
, rId
, pVarName
);
880 rInst
.pClass
->WriteSrc( rInst
, fOutput
, pTC
, nTab
, pVarName
);
883 /*************************************************************************
885 |* RscTop::WriteSrc()
888 |* Ersterstellung MM 08.04.91
889 |* Letzte Aenderung MM 08.04.91
891 *************************************************************************/
892 void RscTop::WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
893 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * pVarName
)
896 pSuperClass
->WriteSrc( rInst
, fOutput
, pTC
, nTab
, pVarName
);
899 /*************************************************************************
901 |* RscTop::WriteRcHeader()
904 |* Ersterstellung MM 12.04.91
905 |* Letzte Aenderung MM 12.04.91
907 *************************************************************************/
908 ERRTYPE
RscTop::WriteRcHeader( const RSCINST
& rInst
, RscWriteRc
& rMem
,
909 RscTypCont
* pTC
, const RscId
& rId
,
910 sal_uInt32 nDeep
, sal_Bool bExtra
)
913 return( pSuperClass
->
914 WriteRcHeader( rInst
, rMem
, pTC
, rId
, nDeep
, bExtra
) );
916 return( rInst
.pClass
->WriteRc( rInst
, rMem
, pTC
, nDeep
, bExtra
) );
919 /*************************************************************************
924 |* Ersterstellung MM 08.04.91
925 |* Letzte Aenderung MM 08.04.91
927 *************************************************************************/
928 ERRTYPE
RscTop::WriteRc( const RSCINST
& rInst
, RscWriteRc
& rMem
,
929 RscTypCont
* pTC
, sal_uInt32 nDeep
, sal_Bool bExtra
)
932 return( pSuperClass
->
933 WriteRc( rInst
, rMem
, pTC
, nDeep
, bExtra
) );
938 /*************************************************************************
940 |* RscTop::WriteSyntaxHeader()
943 |* Ersterstellung MM 29.05.91
944 |* Letzte Aenderung MM 29.05.91
946 *************************************************************************/
947 void RscTop::WriteSyntaxHeader( FILE * fOutput
, RscTypCont
* pTC
)
949 if( GetId() != InvalidAtom
)
951 fprintf( fOutput
, "class %s \n{\n", pHS
->getString( GetId() ).getStr() );
952 WriteSyntax( fOutput
, pTC
);
953 fprintf( fOutput
, "};\n\n" );
957 /*************************************************************************
959 |* RscTop::WriteSyntax()
962 |* Ersterstellung MM 29.05.91
963 |* Letzte Aenderung MM 29.05.91
965 *************************************************************************/
966 void RscTop::WriteSyntax( FILE * fOutput
, RscTypCont
* pTC
)
969 pSuperClass
->WriteSyntax( fOutput
, pTC
);
972 //========================================================================
973 void RscTop::WriteRcAccess
976 RscTypCont
* /*pTC*/,
980 if( GetId() != InvalidAtom
)
982 fprintf( fOutput
, "\t\t//%s %s\n",
983 pHS
->getString( GetId() ).getStr(), pName
);
987 //========================================================================
988 void RscTop::WriteRcCtor( FILE * fOutput
, RscTypCont
* pTC
)
991 pSuperClass
->WriteRcCtor( fOutput
, pTC
);