merge the formfield patch from ooo-build
[ooovba.git] / idl / source / prj / globals.cxx
blob8e7547934616135ca33a4709648456920aea749a
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: globals.cxx,v $
10 * $Revision: 1.7 $
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 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_idl.hxx"
34 /****************** I N C L U D E S **************************************/
35 #include <tools/shl.hxx>
37 #include <globals.hxx>
38 #include <database.hxx>
40 /****************** G L O B A L S ****************************************/
41 #ifdef DOS
42 static IdlDll * pApp = NULL;
43 IdlDll * GetIdlApp()
45 if( !pApp )
46 pApp = new IdlDll();
47 return pApp;
49 #else
50 IdlDll * GetIdlApp()
52 if( !(*(IdlDll**)GetAppData(SHL_IDL)) )
54 (*(IdlDll**)GetAppData(SHL_IDL)) = new IdlDll();
55 // Temporaer, sonst nur wenn Compiler
56 //GetIdlApp()->pHashTable = new SvStringHashTable( 2801 );
57 //GetIdlApp()->pGlobalNames = new SvGlobalHashNames();
59 return (*(IdlDll**)GetAppData(SHL_IDL));
61 #endif
63 IdlDll::IdlDll()
64 : pHashTable( NULL )
65 , pClassMgr( NULL )
66 , pGlobalNames( NULL )
69 pClassMgr = new SvClassManager();
70 // File OBJECT.HXX:
71 pClassMgr->SV_CLASS_REGISTER( SvMetaAttribute );
72 pClassMgr->SV_CLASS_REGISTER( SvMetaClass );
73 //File SLOT.HXX:
74 pClassMgr->SV_CLASS_REGISTER( SvMetaSlot );
75 //File MODULE.HXX:
76 pClassMgr->SV_CLASS_REGISTER( SvMetaModule );
77 //File BASOBJ.HXX:
78 pClassMgr->SV_CLASS_REGISTER( SvMetaObject );
79 pClassMgr->SV_CLASS_REGISTER( SvMetaName );
80 pClassMgr->SV_CLASS_REGISTER( SvMetaExtern );
81 pClassMgr->SV_CLASS_REGISTER( SvMetaReference );
82 //File TYPES.HXX:
83 pClassMgr->SV_CLASS_REGISTER( SvMetaType );
84 pClassMgr->SV_CLASS_REGISTER( SvMetaTypeString );
85 pClassMgr->SV_CLASS_REGISTER( SvMetaEnumValue );
86 pClassMgr->SV_CLASS_REGISTER( SvMetaTypeEnum );
87 pClassMgr->SV_CLASS_REGISTER( SvMetaTypevoid );
88 pClassMgr->SV_CLASS_REGISTER( SvClassElement );
91 IdlDll::~IdlDll()
93 delete pGlobalNames;
94 delete pClassMgr;
95 delete pHashTable;
98 /*************************************************************************
100 |* SvGlobalHashNames::SvGlobalHashNames()
102 |* Beschreibung
103 |* Ersterstellung MM 08.08.91
104 |* Letzte Aenderung MM 08.08.91
106 *************************************************************************/
107 inline SvStringHashEntry * INS( const ByteString & rName )
109 UINT32 nIdx;
110 IDLAPP->pHashTable->Insert( rName, &nIdx );
111 return (SvStringHashEntry * )IDLAPP->pHashTable->Get( nIdx );
113 #define A_ENTRY( Name ) , MM_##Name( INS( #Name ) )
115 SvGlobalHashNames::SvGlobalHashNames()
116 : MM_Name( INS( "Name" ) )
117 , MM_module( INS( "module" ) )
118 , MM_interface( INS( "interface" ) )
119 , MM_in( INS( "in" ) )
120 , MM_out( INS( "out" ) )
121 , MM_inout( INS( "inout" ) )
122 , MM_String( INS( "String" ) )
123 , MM_UCHAR( INS( "UCHAR" ) )
124 , MM_USHORT( INS( "USHORT" ) )
125 , MM_uuid( INS( "uuid" ) )
126 , MM_HelpContext( INS( "HelpContext" ) )
127 , MM_HelpText( INS( "HelpText" ) )
128 , MM_void( INS( "void" ) )
129 , MM_shell( INS( "shell" ) )
130 , MM_Get( INS( "Get" ) )
131 , MM_Set( INS( "Set" ) )
132 , MM_SlotId( INS( "SlotId" ) )
133 , MM_HasCoreId( INS( "HasCoreId" ) )
134 , MM_Cachable( INS( "Cachable" ) )
135 // , MM_Volatile( INS( "Volatile" ) )
136 , MM_Toggle( INS( "Toggle" ) )
137 , MM_AutoUpdate( INS( "AutoUpdate" ) )
138 , MM_Synchron( INS( "Synchron" ) )
139 , MM_Asynchron( INS( "Asynchron" ) )
140 A_ENTRY(RecordPerSet)
141 A_ENTRY(RecordPerItem)
142 A_ENTRY(RecordManual)
143 A_ENTRY(NoRecord)
144 A_ENTRY(RecordAbsolute)
145 A_ENTRY(enum)
146 A_ENTRY(UINT16)
147 A_ENTRY(INT16)
148 A_ENTRY(UINT32)
149 A_ENTRY(INT32)
150 A_ENTRY(int)
151 A_ENTRY(BOOL)
152 A_ENTRY(char)
153 A_ENTRY(BYTE)
154 A_ENTRY(float)
155 A_ENTRY(double)
156 A_ENTRY(item)
157 A_ENTRY(PseudoSlots)
158 A_ENTRY(map)
159 A_ENTRY(Default)
160 A_ENTRY(HelpFile)
161 A_ENTRY(Version)
162 A_ENTRY(import)
163 A_ENTRY(SlotIdFile)
164 A_ENTRY(SvName)
165 A_ENTRY(SbxName)
166 A_ENTRY(ItemName)
167 A_ENTRY(OdlName)
168 A_ENTRY(include)
169 A_ENTRY(ExecMethod)
170 A_ENTRY(StateMethod)
171 A_ENTRY(GroupId)
172 A_ENTRY(HasDialog)
173 A_ENTRY(TypeLibFile)
174 A_ENTRY(Export)
175 A_ENTRY(Automation)
176 A_ENTRY(PseudoPrefix)
177 A_ENTRY(define)
178 A_ENTRY(MenuConfig)
179 A_ENTRY(ToolBoxConfig)
180 A_ENTRY(StatusBarConfig)
181 A_ENTRY(AccelConfig)
182 A_ENTRY(AllConfig)
183 A_ENTRY(FastCall)
184 A_ENTRY(SbxObject)
185 A_ENTRY(Container)
186 A_ENTRY(ImageRotation)
187 A_ENTRY(ImageReflection)
188 A_ENTRY(IsCollection)
189 A_ENTRY(ReadOnlyDoc)
190 A_ENTRY(ConfigName)
191 A_ENTRY(union)
192 A_ENTRY(struct)
193 A_ENTRY(typedef)
194 A_ENTRY(Readonly)
195 A_ENTRY(SlotType)
196 A_ENTRY(ModulePrefix)
197 A_ENTRY(DisableFlags)
198 A_ENTRY(Hidden)
199 A_ENTRY(Description)
200 A_ENTRY(UnoName)