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