Simplify a bit
[LibreOffice.git] / idl / inc / globals.hxx
blobb72d53fafae2e82768bfad5cf2f27c4578765803
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include "hash.hxx"
23 #include <memory>
25 struct SvGlobalHashNames
27 SvStringHashEntry* MM_module;
28 SvStringHashEntry* MM_interface;
29 SvStringHashEntry* MM_shell;
30 SvStringHashEntry* MM_Toggle;
31 SvStringHashEntry* MM_AutoUpdate;
32 SvStringHashEntry* MM_Asynchron;
33 SvStringHashEntry* MM_RecordPerSet;
34 SvStringHashEntry* MM_RecordPerItem;
35 SvStringHashEntry* MM_NoRecord;
36 SvStringHashEntry* MM_RecordAbsolute;
37 SvStringHashEntry* MM_enum;
38 SvStringHashEntry* MM_UINT16;
39 SvStringHashEntry* MM_INT16;
40 SvStringHashEntry* MM_UINT32;
41 SvStringHashEntry* MM_INT32;
42 SvStringHashEntry* MM_BOOL;
43 SvStringHashEntry* MM_BYTE;
44 SvStringHashEntry* MM_float;
45 SvStringHashEntry* MM_double;
46 SvStringHashEntry* MM_item;
47 SvStringHashEntry* MM_import;
48 SvStringHashEntry* MM_SlotIdFile;
49 SvStringHashEntry* MM_include;
50 SvStringHashEntry* MM_ExecMethod;
51 SvStringHashEntry* MM_StateMethod;
52 SvStringHashEntry* MM_GroupId;
53 SvStringHashEntry* MM_define;
54 SvStringHashEntry* MM_MenuConfig;
55 SvStringHashEntry* MM_ToolBoxConfig;
56 SvStringHashEntry* MM_AccelConfig;
57 SvStringHashEntry* MM_FastCall;
58 SvStringHashEntry* MM_SbxObject;
59 SvStringHashEntry* MM_Container;
60 SvStringHashEntry* MM_ReadOnlyDoc;
61 SvStringHashEntry* MM_struct;
62 SvStringHashEntry* MM_DisableFlags;
64 SvGlobalHashNames();
67 class IdlDll
69 public:
70 std::unique_ptr<SvStringHashTable> pHashTable;
71 std::unique_ptr<SvGlobalHashNames> pGlobalNames;
73 IdlDll();
74 ~IdlDll();
77 IdlDll & GetIdlApp();
79 #define HASH_INLINE( Name ) \
80 inline SvStringHashEntry * SvHash_##Name() \
81 { \
82 if( !GetIdlApp().pGlobalNames ) \
83 GetIdlApp().pGlobalNames.reset( new SvGlobalHashNames() ); \
84 return GetIdlApp().pGlobalNames->MM_##Name; \
87 HASH_INLINE(module)
88 HASH_INLINE(interface)
89 HASH_INLINE(shell)
90 HASH_INLINE(Toggle)
91 HASH_INLINE(AutoUpdate)
92 HASH_INLINE(Asynchron)
93 HASH_INLINE(RecordPerItem)
94 HASH_INLINE(RecordPerSet)
95 HASH_INLINE(NoRecord)
96 HASH_INLINE(RecordAbsolute)
97 HASH_INLINE(enum)
98 HASH_INLINE(UINT16)
99 HASH_INLINE(INT16)
100 HASH_INLINE(UINT32)
101 HASH_INLINE(INT32)
102 HASH_INLINE(BOOL)
103 HASH_INLINE(BYTE)
104 HASH_INLINE(item)
105 HASH_INLINE(import)
106 HASH_INLINE(SlotIdFile)
107 HASH_INLINE(include)
108 HASH_INLINE(ExecMethod)
109 HASH_INLINE(StateMethod)
110 HASH_INLINE(GroupId)
111 HASH_INLINE(float)
112 HASH_INLINE(double)
113 HASH_INLINE(define)
114 HASH_INLINE(MenuConfig)
115 HASH_INLINE(ToolBoxConfig)
116 HASH_INLINE(AccelConfig)
117 HASH_INLINE(FastCall)
118 HASH_INLINE(SbxObject)
119 HASH_INLINE(Container)
120 HASH_INLINE(ReadOnlyDoc)
121 HASH_INLINE(struct)
122 HASH_INLINE(DisableFlags)
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */