Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 :
21 : /****************** I N C L U D E S **************************************/
22 : // C and C++ Includes.
23 : #include <stdlib.h>
24 : #include <stdio.h>
25 : #include <string.h>
26 :
27 : #include <i18npool/mslangid.hxx>
28 : #include <i18npool/languagetag.hxx>
29 : #include <comphelper/string.hxx>
30 : #include <tools/rc.h>
31 : #include <tools/color.hxx>
32 :
33 : #include <vclrsc.hxx>
34 : #include <rscconst.hxx>
35 : #include <rscarray.hxx>
36 : #include <rscclass.hxx>
37 : #include <rsccont.hxx>
38 : #include <rscdb.hxx>
39 :
40 :
41 : #include <rsclex.hxx>
42 : #include <rscyacc.hxx>
43 :
44 : #include <boost/unordered_map.hpp>
45 :
46 : /****************** M A C R O S ******************************************/
47 156166 : void RscTypCont::SETCONST( RscConst * pClass, const char * szString, sal_uInt32 nVal )
48 : {
49 : #if OSL_DEBUG_LEVEL > 2
50 : fprintf( stderr, "setconst : %s\n", szString );
51 : #endif
52 : pClass->SetConstant( aNmTb.Put( szString,
53 156166 : CONSTNAME, nVal ), nVal );
54 156166 : }
55 :
56 13820 : void RscTypCont::SETCONST( RscConst * pClass, Atom nName, sal_uInt32 nVal )
57 : {
58 : #if OSL_DEBUG_LEVEL > 2
59 : fprintf( stderr, "setconst hash: %u\n", (unsigned int)nName );
60 : #endif
61 : pClass->SetConstant( aNmTb.Put( nName,
62 13820 : CONSTNAME, nVal ), nVal );
63 13820 : }
64 :
65 : /****************** C O D E **********************************************/
66 : /*************************************************************************
67 : |* RscTypCont::InitLangType()
68 : |*
69 : |* Beschreibung
70 : *************************************************************************/
71 :
72 : typedef boost::unordered_map< rtl::OString, sal_uInt32, rtl::OStringHash > langmap;
73 691 : static langmap ULong_Iso_map;
74 :
75 533574 : sal_uInt32 GetLangId(const rtl::OString &rLang)
76 : {
77 533574 : langmap::iterator pIter = ULong_Iso_map.find( rLang );
78 533574 : if ( pIter != ULong_Iso_map.end())
79 120356 : return pIter->second;
80 413218 : return 0;
81 : }
82 :
83 691 : void RscLangEnum::Init( RscNameTable& rNames )
84 : {
85 691 : SetConstant( rNames.Put( "SYSTEM", CONSTNAME, (long)LANGUAGE_SYSTEM ), LANGUAGE_SYSTEM );
86 691 : SetConstant( rNames.Put( "DONTKNOW", CONSTNAME, LANGUAGE_DONTKNOW ), LANGUAGE_DONTKNOW );
87 :
88 691 : sal_Int32 nIndex = 0;
89 691 : mnLangId = 0x400; // stay away from selfdefined...
90 : const MsLangId::IsoLangEntry* pLangEntry;
91 :
92 288838 : while ( NULL != ( pLangEntry = MsLangId::getIsoLangEntry( nIndex )) && ( pLangEntry->mnLang != LANGUAGE_DONTKNOW ))
93 : {
94 : #if OSL_DEBUG_LEVEL > 2
95 : fprintf( stderr, "ISO Language in : %d\n",
96 : (int)nIndex,
97 : pLangEntry->mnLang,
98 : OUStringToOString( LanguageTag( pLangEntry->mnLang ).getBcp47(), RTL_TEXTENCODING_ASCII_US).getStr() );
99 : #endif
100 287456 : rtl::OString aLang(pLangEntry->maLangStr, strlen(pLangEntry->maLangStr));
101 287456 : rtl::OString aCountry(pLangEntry->maCountry, strlen(pLangEntry->maCountry));
102 287456 : if ( aCountry.isEmpty() || aLang.equalsIgnoreAsciiCase(aCountry) )
103 : {
104 41460 : SetConstant( rNames.Put( aLang.getStr(), CONSTNAME, mnLangId ), mnLangId );
105 41460 : if ( ! GetLangId( aLang ))
106 32477 : ULong_Iso_map[ aLang ] = mnLangId;
107 : #if OSL_DEBUG_LEVEL > 2
108 : fprintf( stderr, "ISO Language out: %s 0x%lx\n", aLang.getStr(), mnLangId );
109 : #endif
110 41460 : mnLangId++;
111 : }
112 : else
113 : {
114 245996 : SetConstant( rNames.Put( aLang.getStr(), CONSTNAME, mnLangId ), mnLangId );
115 245996 : if ( ! GetLangId( aLang ))
116 141655 : ULong_Iso_map[ aLang ] = mnLangId;
117 : #if OSL_DEBUG_LEVEL > 2
118 : fprintf( stderr, "ISO Language out: %s 0x%lx", aLang.getStr(), mnLangId );
119 : #endif
120 245996 : mnLangId++;
121 245996 : aLang = aLang + rtl::OString( '-' ) + aCountry.toAsciiUpperCase();
122 245996 : SetConstant( rNames.Put( aLang.getStr(), CONSTNAME, mnLangId ), mnLangId );
123 245996 : if ( ! GetLangId( aLang ))
124 239086 : ULong_Iso_map[ aLang ] = mnLangId;
125 : #if OSL_DEBUG_LEVEL > 2
126 : fprintf( stderr, " %s 0x%lx\n", aLang.getStr(), mnLangId );
127 : #endif
128 245996 : mnLangId++;
129 : // hack - survive "x-no-translate"
130 245996 : if (aLang.equalsL(RTL_CONSTASCII_STRINGPARAM("en-US")))
131 : {
132 691 : SetConstant( rNames.Put( "x-comment", CONSTNAME, mnLangId ), mnLangId );
133 691 : mnLangId++;
134 : }
135 : }
136 287456 : nIndex++;
137 287456 : }
138 :
139 691 : rtl::OString aEnvIsoTokens = getenv( "RSC_LANG_ISO" );
140 691 : if ( !aEnvIsoTokens.isEmpty() )
141 : {
142 0 : rtl::OString aIsoToken;
143 0 : sal_uInt16 nTokenCounter = 0;
144 0 : sal_Bool bOneMore = 1;
145 0 : while ( bOneMore )
146 : {
147 0 : aIsoToken = comphelper::string::getToken(aEnvIsoTokens, nTokenCounter, ' ');
148 0 : if ( !aIsoToken.isEmpty() )
149 : {
150 0 : SetConstant( rNames.Put( aIsoToken.getStr(), CONSTNAME, mnLangId ), mnLangId );
151 0 : if ( ! GetLangId( aIsoToken ))
152 0 : ULong_Iso_map[ aIsoToken ] = mnLangId;
153 : #if OSL_DEBUG_LEVEL > 2
154 : fprintf( stderr, "Env ISO Language out: %s 0x%lx\n", aIsoToken.getStr(), mnLangId );
155 : #endif
156 0 : mnLangId++;
157 : }
158 : else
159 0 : bOneMore = 0;
160 0 : nTokenCounter++;
161 0 : }
162 : }
163 :
164 691 : SetConstant( rNames.Put( "LANGUAGE_USER1", CONSTNAME, LANGUAGE_USER1 ), LANGUAGE_USER1 );
165 691 : SetConstant( rNames.Put( "LANGUAGE_USER2", CONSTNAME, LANGUAGE_USER2 ), LANGUAGE_USER2 );
166 691 : SetConstant( rNames.Put( "LANGUAGE_USER3", CONSTNAME, LANGUAGE_USER3 ), LANGUAGE_USER3 );
167 691 : SetConstant( rNames.Put( "LANGUAGE_USER4", CONSTNAME, LANGUAGE_USER4 ), LANGUAGE_USER4 );
168 691 : SetConstant( rNames.Put( "LANGUAGE_USER5", CONSTNAME, LANGUAGE_USER5 ), LANGUAGE_USER5 );
169 691 : SetConstant( rNames.Put( "LANGUAGE_USER6", CONSTNAME, LANGUAGE_USER6 ), LANGUAGE_USER6 );
170 691 : SetConstant( rNames.Put( "LANGUAGE_USER7", CONSTNAME, LANGUAGE_USER7 ), LANGUAGE_USER7 );
171 691 : SetConstant( rNames.Put( "LANGUAGE_USER8", CONSTNAME, LANGUAGE_USER8 ), LANGUAGE_USER8 );
172 691 : SetConstant( rNames.Put( "EXTERN", CONSTNAME, LANGUAGE_USER9 ), LANGUAGE_USER9 );
173 691 : }
174 :
175 0 : Atom RscLangEnum::AddLanguage( const char* pLang, RscNameTable& rNames )
176 : {
177 0 : Atom nResult = 0;
178 : KEY_STRUCT aStruct;
179 0 : if( ! rNames.Get( nResult = pHS->getID( pLang ), &aStruct ) )
180 : {
181 0 : SetConstant( nResult = rNames.Put( pLang, CONSTNAME, mnLangId ), mnLangId );
182 : // insert new lang to ULong_Iso_map
183 0 : rtl::OString aLang( pLang );
184 0 : if ( ! GetLangId( aLang ))
185 0 : ULong_Iso_map[ aLang ] = mnLangId;
186 : // increase id counter
187 0 : mnLangId++;
188 : }
189 : #if OSL_DEBUG_LEVEL > 2
190 : fprintf( stderr, "AddLanguage( %s ) = %d\n", pLang, nResult );
191 : #endif
192 0 : return nResult;
193 : }
194 :
195 691 : RscEnum * RscTypCont::InitLangType()
196 : {
197 691 : aLangType.Init( aNmTb );
198 691 : return( &aLangType );
199 : }
200 :
201 : /*************************************************************************
202 : |*
203 : |* RscTypCont::InitFieldUnitsType()
204 : |*
205 : *************************************************************************/
206 691 : RscEnum * RscTypCont::InitFieldUnitsType()
207 : {
208 : RscEnum * pFieldUnits;
209 691 : pFieldUnits = new RscEnum( pHS->getID( "EnumFieldUnit" ), RSC_NOTYPE );
210 :
211 691 : SETCONST( pFieldUnits, "FUNIT_NONE", FUNIT_NONE );
212 691 : SETCONST( pFieldUnits, "FUNIT_MM", FUNIT_MM );
213 691 : SETCONST( pFieldUnits, "FUNIT_CM", FUNIT_CM );
214 691 : SETCONST( pFieldUnits, "FUNIT_M", FUNIT_M );
215 691 : SETCONST( pFieldUnits, "FUNIT_KM", FUNIT_KM );
216 691 : SETCONST( pFieldUnits, "FUNIT_TWIP", FUNIT_TWIP );
217 691 : SETCONST( pFieldUnits, "FUNIT_POINT", FUNIT_POINT );
218 691 : SETCONST( pFieldUnits, "FUNIT_PICA", FUNIT_PICA );
219 691 : SETCONST( pFieldUnits, "FUNIT_INCH", FUNIT_INCH );
220 691 : SETCONST( pFieldUnits, "FUNIT_FOOT", FUNIT_FOOT );
221 691 : SETCONST( pFieldUnits, "FUNIT_MILE", FUNIT_MILE );
222 691 : SETCONST( pFieldUnits, "FUNIT_CUSTOM", FUNIT_CUSTOM );
223 691 : SETCONST( pFieldUnits, "FUNIT_CHAR", FUNIT_CHAR );
224 691 : SETCONST( pFieldUnits, "FUNIT_LINE", FUNIT_LINE );
225 691 : SETCONST( pFieldUnits, "FUNIT_PERCENT", FUNIT_PERCENT );
226 :
227 691 : return pFieldUnits;
228 : }
229 :
230 : /*************************************************************************
231 : |*
232 : |* RscTypCont::InitTimeFieldFormat()
233 : |*
234 : *************************************************************************/
235 691 : RscEnum * RscTypCont::InitTimeFieldFormat()
236 : {
237 : RscEnum * pTimeFieldFormat;
238 1382 : pTimeFieldFormat = new RscEnum( pHS->getID( "EnumTimeFieldFormat" ),
239 691 : RSC_NOTYPE );
240 :
241 691 : SETCONST( pTimeFieldFormat, "TIMEF_NONE", TIMEF_NONE );
242 691 : SETCONST( pTimeFieldFormat, "TIMEF_SEC", TIMEF_SEC );
243 691 : SETCONST( pTimeFieldFormat, "TIMEF_100TH_SEC", TIMEF_100TH_SEC );
244 :
245 691 : return pTimeFieldFormat;
246 : }
247 :
248 : /*************************************************************************
249 : |*
250 : |* RscTypCont::InitColor()
251 : |*
252 : *************************************************************************/
253 691 : RscEnum * RscTypCont::InitColor(){
254 : RscEnum * pColor;
255 691 : pColor = new RscEnum( pHS->getID( "EnumColor" ), RSC_NOTYPE );
256 :
257 691 : SETCONST( pColor, "COL_BLACK", COL_BLACK );
258 691 : SETCONST( pColor, "COL_BLUE", COL_BLUE );
259 691 : SETCONST( pColor, "COL_GREEN", COL_GREEN );
260 691 : SETCONST( pColor, "COL_CYAN", COL_CYAN );
261 691 : SETCONST( pColor, "COL_RED", COL_RED );
262 691 : SETCONST( pColor, "COL_MAGENTA", COL_MAGENTA );
263 691 : SETCONST( pColor, "COL_BROWN", COL_BROWN );
264 691 : SETCONST( pColor, "COL_GRAY", COL_GRAY );
265 691 : SETCONST( pColor, "COL_LIGHTGRAY", COL_LIGHTGRAY );
266 691 : SETCONST( pColor, "COL_LIGHTBLUE", COL_LIGHTBLUE );
267 691 : SETCONST( pColor, "COL_LIGHTGREEN", COL_LIGHTGREEN );
268 691 : SETCONST( pColor, "COL_LIGHTCYAN", COL_LIGHTCYAN );
269 691 : SETCONST( pColor, "COL_LIGHTRED", COL_LIGHTRED );
270 691 : SETCONST( pColor, "COL_LIGHTMAGENTA", COL_LIGHTMAGENTA );
271 691 : SETCONST( pColor, "COL_YELLOW", COL_YELLOW );
272 691 : SETCONST( pColor, "COL_WHITE", COL_WHITE );
273 :
274 691 : return( pColor );
275 : }
276 :
277 : /*************************************************************************
278 : |*
279 : |* RscTypCont::InitMapUnit()
280 : |*
281 : *************************************************************************/
282 691 : RscEnum * RscTypCont::InitMapUnit(){
283 : RscEnum * pMapUnit;
284 691 : pMapUnit = new RscEnum( pHS->getID( "EnumMapUnit" ), RSC_NOTYPE );
285 :
286 691 : SETCONST( pMapUnit, "MAP_PIXEL", MAP_PIXEL );
287 691 : SETCONST( pMapUnit, "MAP_SYSFONT", MAP_SYSFONT );
288 691 : SETCONST( pMapUnit, "MAP_100TH_MM", MAP_100TH_MM );
289 691 : SETCONST( pMapUnit, "MAP_10TH_MM", MAP_10TH_MM );
290 691 : SETCONST( pMapUnit, "MAP_MM", MAP_MM );
291 691 : SETCONST( pMapUnit, "MAP_CM", MAP_CM );
292 691 : SETCONST( pMapUnit, "MAP_1000TH_INCH", MAP_1000TH_INCH );
293 691 : SETCONST( pMapUnit, "MAP_100TH_INCH", MAP_100TH_INCH );
294 691 : SETCONST( pMapUnit, "MAP_10TH_INCH", MAP_10TH_INCH );
295 691 : SETCONST( pMapUnit, "MAP_INCH", MAP_INCH );
296 691 : SETCONST( pMapUnit, "MAP_POINT", MAP_POINT );
297 691 : SETCONST( pMapUnit, "MAP_TWIP", MAP_TWIP );
298 691 : SETCONST( pMapUnit, "MAP_APPFONT", MAP_APPFONT );
299 691 : SETCONST( pMapUnit, "MAP_SV", RSC_EXTRAMAPUNIT );
300 691 : return( pMapUnit );
301 : }
302 :
303 : /*************************************************************************
304 : |*
305 : |* RscTypCont::InitKey()
306 : |*
307 : *************************************************************************/
308 691 : RscEnum * RscTypCont::InitKey(){
309 : RscEnum * pKey;
310 691 : pKey = new RscEnum( pHS->getID( "EnumKey" ), RSC_NOTYPE );
311 :
312 691 : SETCONST( pKey, "KEY_0", com::sun::star::awt::Key::NUM0 );
313 691 : SETCONST( pKey, "KEY_1", com::sun::star::awt::Key::NUM1 );
314 691 : SETCONST( pKey, "KEY_2", com::sun::star::awt::Key::NUM2 );
315 691 : SETCONST( pKey, "KEY_3", com::sun::star::awt::Key::NUM3 );
316 691 : SETCONST( pKey, "KEY_4", com::sun::star::awt::Key::NUM4 );
317 691 : SETCONST( pKey, "KEY_5", com::sun::star::awt::Key::NUM5 );
318 691 : SETCONST( pKey, "KEY_6", com::sun::star::awt::Key::NUM6 );
319 691 : SETCONST( pKey, "KEY_7", com::sun::star::awt::Key::NUM7 );
320 691 : SETCONST( pKey, "KEY_8", com::sun::star::awt::Key::NUM8 );
321 691 : SETCONST( pKey, "KEY_9", com::sun::star::awt::Key::NUM9 );
322 :
323 691 : SETCONST( pKey, "KEY_A", com::sun::star::awt::Key::A );
324 691 : SETCONST( pKey, "KEY_B", com::sun::star::awt::Key::B );
325 691 : SETCONST( pKey, "KEY_C", com::sun::star::awt::Key::C );
326 691 : SETCONST( pKey, "KEY_D", com::sun::star::awt::Key::D );
327 691 : SETCONST( pKey, "KEY_E", com::sun::star::awt::Key::E );
328 691 : SETCONST( pKey, "KEY_F", com::sun::star::awt::Key::F );
329 691 : SETCONST( pKey, "KEY_G", com::sun::star::awt::Key::G );
330 691 : SETCONST( pKey, "KEY_H", com::sun::star::awt::Key::H );
331 691 : SETCONST( pKey, "KEY_I", com::sun::star::awt::Key::I );
332 691 : SETCONST( pKey, "KEY_J", com::sun::star::awt::Key::J );
333 691 : SETCONST( pKey, "KEY_K", com::sun::star::awt::Key::K );
334 691 : SETCONST( pKey, "KEY_L", com::sun::star::awt::Key::L );
335 691 : SETCONST( pKey, "KEY_M", com::sun::star::awt::Key::M );
336 691 : SETCONST( pKey, "KEY_N", com::sun::star::awt::Key::N );
337 691 : SETCONST( pKey, "KEY_O", com::sun::star::awt::Key::O );
338 691 : SETCONST( pKey, "KEY_P", com::sun::star::awt::Key::P );
339 691 : SETCONST( pKey, "KEY_Q", com::sun::star::awt::Key::Q );
340 691 : SETCONST( pKey, "KEY_R", com::sun::star::awt::Key::R );
341 691 : SETCONST( pKey, "KEY_S", com::sun::star::awt::Key::S );
342 691 : SETCONST( pKey, "KEY_T", com::sun::star::awt::Key::T );
343 691 : SETCONST( pKey, "KEY_U", com::sun::star::awt::Key::U );
344 691 : SETCONST( pKey, "KEY_V", com::sun::star::awt::Key::V );
345 691 : SETCONST( pKey, "KEY_W", com::sun::star::awt::Key::W );
346 691 : SETCONST( pKey, "KEY_X", com::sun::star::awt::Key::X );
347 691 : SETCONST( pKey, "KEY_Y", com::sun::star::awt::Key::Y );
348 691 : SETCONST( pKey, "KEY_Z", com::sun::star::awt::Key::Z );
349 :
350 691 : SETCONST( pKey, "KEY_F1", com::sun::star::awt::Key::F1 );
351 691 : SETCONST( pKey, "KEY_F2", com::sun::star::awt::Key::F2 );
352 691 : SETCONST( pKey, "KEY_F3", com::sun::star::awt::Key::F3 );
353 691 : SETCONST( pKey, "KEY_F4", com::sun::star::awt::Key::F4 );
354 691 : SETCONST( pKey, "KEY_F5", com::sun::star::awt::Key::F5 );
355 691 : SETCONST( pKey, "KEY_F6", com::sun::star::awt::Key::F6 );
356 691 : SETCONST( pKey, "KEY_F7", com::sun::star::awt::Key::F7 );
357 691 : SETCONST( pKey, "KEY_F8", com::sun::star::awt::Key::F8 );
358 691 : SETCONST( pKey, "KEY_F9", com::sun::star::awt::Key::F9 );
359 691 : SETCONST( pKey, "KEY_F10", com::sun::star::awt::Key::F10 );
360 691 : SETCONST( pKey, "KEY_F11", com::sun::star::awt::Key::F11 );
361 691 : SETCONST( pKey, "KEY_F12", com::sun::star::awt::Key::F12 );
362 691 : SETCONST( pKey, "KEY_F13", com::sun::star::awt::Key::F13 );
363 691 : SETCONST( pKey, "KEY_F14", com::sun::star::awt::Key::F14 );
364 691 : SETCONST( pKey, "KEY_F15", com::sun::star::awt::Key::F15 );
365 691 : SETCONST( pKey, "KEY_F16", com::sun::star::awt::Key::F16 );
366 691 : SETCONST( pKey, "KEY_F17", com::sun::star::awt::Key::F17 );
367 691 : SETCONST( pKey, "KEY_F18", com::sun::star::awt::Key::F18 );
368 691 : SETCONST( pKey, "KEY_F19", com::sun::star::awt::Key::F19 );
369 691 : SETCONST( pKey, "KEY_F20", com::sun::star::awt::Key::F20 );
370 691 : SETCONST( pKey, "KEY_F21", com::sun::star::awt::Key::F21 );
371 691 : SETCONST( pKey, "KEY_F22", com::sun::star::awt::Key::F22 );
372 691 : SETCONST( pKey, "KEY_F23", com::sun::star::awt::Key::F23 );
373 691 : SETCONST( pKey, "KEY_F24", com::sun::star::awt::Key::F24 );
374 691 : SETCONST( pKey, "KEY_F25", com::sun::star::awt::Key::F25 );
375 691 : SETCONST( pKey, "KEY_F26", com::sun::star::awt::Key::F26 );
376 :
377 691 : SETCONST( pKey, "KEY_DOWN", com::sun::star::awt::Key::DOWN );
378 691 : SETCONST( pKey, "KEY_UP", com::sun::star::awt::Key::UP );
379 691 : SETCONST( pKey, "KEY_LEFT", com::sun::star::awt::Key::LEFT );
380 691 : SETCONST( pKey, "KEY_RIGHT", com::sun::star::awt::Key::RIGHT );
381 691 : SETCONST( pKey, "KEY_HOME", com::sun::star::awt::Key::HOME );
382 691 : SETCONST( pKey, "KEY_END", com::sun::star::awt::Key::END );
383 691 : SETCONST( pKey, "KEY_PAGEUP", com::sun::star::awt::Key::PAGEUP );
384 691 : SETCONST( pKey, "KEY_PAGEDOWN", com::sun::star::awt::Key::PAGEDOWN );
385 :
386 691 : SETCONST( pKey, "KEY_RETURN", com::sun::star::awt::Key::RETURN );
387 691 : SETCONST( pKey, "KEY_ESCAPE", com::sun::star::awt::Key::ESCAPE );
388 691 : SETCONST( pKey, "KEY_TAB", com::sun::star::awt::Key::TAB );
389 691 : SETCONST( pKey, "KEY_BACKSPACE", com::sun::star::awt::Key::BACKSPACE );
390 691 : SETCONST( pKey, "KEY_SPACE", com::sun::star::awt::Key::SPACE );
391 691 : SETCONST( pKey, "KEY_INSERT", com::sun::star::awt::Key::INSERT );
392 691 : SETCONST( pKey, "KEY_DELETE", com::sun::star::awt::Key::DELETE );
393 :
394 691 : SETCONST( pKey, "KEY_ADD", com::sun::star::awt::Key::ADD );
395 691 : SETCONST( pKey, "KEY_SUBTRACT", com::sun::star::awt::Key::SUBTRACT );
396 691 : SETCONST( pKey, "KEY_MULTIPLY", com::sun::star::awt::Key::MULTIPLY );
397 691 : SETCONST( pKey, "KEY_DIVIDE", com::sun::star::awt::Key::DIVIDE );
398 691 : SETCONST( pKey, "KEY_POINT", com::sun::star::awt::Key::POINT );
399 691 : SETCONST( pKey, "KEY_COMMA", com::sun::star::awt::Key::COMMA );
400 691 : SETCONST( pKey, "KEY_LESS", com::sun::star::awt::Key::LESS );
401 691 : SETCONST( pKey, "KEY_GREATER", com::sun::star::awt::Key::GREATER );
402 691 : SETCONST( pKey, "KEY_EQUAL", com::sun::star::awt::Key::EQUAL );
403 :
404 691 : SETCONST( pKey, "KEY_OPEN", com::sun::star::awt::Key::OPEN );
405 691 : SETCONST( pKey, "KEY_CUT", com::sun::star::awt::Key::CUT );
406 691 : SETCONST( pKey, "KEY_COPY", com::sun::star::awt::Key::COPY );
407 691 : SETCONST( pKey, "KEY_PASTE", com::sun::star::awt::Key::PASTE );
408 691 : SETCONST( pKey, "KEY_UNDO", com::sun::star::awt::Key::UNDO );
409 691 : SETCONST( pKey, "KEY_REPEAT", com::sun::star::awt::Key::REPEAT );
410 691 : SETCONST( pKey, "KEY_FIND", com::sun::star::awt::Key::FIND );
411 691 : SETCONST( pKey, "KEY_PROPERTIES", com::sun::star::awt::Key::PROPERTIES );
412 691 : SETCONST( pKey, "KEY_FRONT", com::sun::star::awt::Key::FRONT );
413 691 : SETCONST( pKey, "KEY_CONTEXTMENU", com::sun::star::awt::Key::CONTEXTMENU );
414 691 : SETCONST( pKey, "KEY_HELP", com::sun::star::awt::Key::HELP );
415 691 : SETCONST( pKey, "KEY_HANGUL_HANJA", com::sun::star::awt::Key::HANGUL_HANJA );
416 691 : SETCONST( pKey, "KEY_DECIMAL", com::sun::star::awt::Key::DECIMAL );
417 691 : SETCONST( pKey, "KEY_TILDE", com::sun::star::awt::Key::TILDE );
418 691 : SETCONST( pKey, "KEY_QUOTELEFT", com::sun::star::awt::Key::QUOTELEFT );
419 :
420 691 : return( pKey );
421 : }
422 :
423 : /*************************************************************************
424 : |*
425 : |* RscTypCont::InitTriState()
426 : |*
427 : *************************************************************************/
428 691 : RscEnum * RscTypCont::InitTriState(){
429 : RscEnum * pTriState;
430 691 : pTriState = new RscEnum( pHS->getID( "EnumTriState" ), RSC_NOTYPE );
431 :
432 691 : SETCONST( pTriState, "STATE_NOCHECK", STATE_NOCHECK );
433 691 : SETCONST( pTriState, "STATE_CHECK", STATE_CHECK );
434 691 : SETCONST( pTriState, "STATE_DONTKNOW", STATE_DONTKNOW );
435 :
436 691 : return( pTriState );
437 : }
438 :
439 : /*************************************************************************
440 : |*
441 : |* RscTypCont::InitMessButtons()
442 : |*
443 : *************************************************************************/
444 691 : RscEnum * RscTypCont::InitMessButtons()
445 : {
446 : RscEnum * pMessButtons;
447 691 : pMessButtons = new RscEnum( pHS->getID( "EnumMessButtons" ), RSC_NOTYPE );
448 691 : SETCONST( pMessButtons, "WB_OK", sal::static_int_cast<sal_uInt32>(WB_OK) );
449 691 : SETCONST( pMessButtons, "WB_OK_CANCEL", sal::static_int_cast<sal_uInt32>(WB_OK_CANCEL) );
450 691 : SETCONST( pMessButtons, "WB_YES_NO", sal::static_int_cast<sal_uInt32>(WB_YES_NO) );
451 691 : SETCONST( pMessButtons, "WB_YES_NO_CANCEL", sal::static_int_cast<sal_uInt32>(WB_YES_NO_CANCEL) );
452 691 : SETCONST( pMessButtons, "WB_RETRY_CANCEL", sal::static_int_cast<sal_uInt32>(WB_RETRY_CANCEL) );
453 691 : SETCONST( pMessButtons, "WB_ABORT_RETRY_IGNORE", sal::static_int_cast<sal_uInt32>(WB_ABORT_RETRY_IGNORE) );
454 691 : return( pMessButtons );
455 : }
456 :
457 : /*************************************************************************
458 : |*
459 : |* RscTypCont::InitMessDefButton()
460 : |*
461 : *************************************************************************/
462 691 : RscEnum * RscTypCont::InitMessDefButton(){
463 : RscEnum * pMessDefButton;
464 1382 : pMessDefButton = new RscEnum( pHS->getID( "EnumMessDefButton" ),
465 691 : RSC_NOTYPE );
466 :
467 691 : SETCONST( pMessDefButton, "WB_DEF_OK", sal::static_int_cast<sal_uInt32>(WB_DEF_OK) );
468 691 : SETCONST( pMessDefButton, "WB_DEF_CANCEL", sal::static_int_cast<sal_uInt32>(WB_DEF_CANCEL) );
469 691 : SETCONST( pMessDefButton, "WB_DEF_RETRY", sal::static_int_cast<sal_uInt32>(WB_DEF_RETRY) );
470 691 : SETCONST( pMessDefButton, "WB_DEF_YES", sal::static_int_cast<sal_uInt32>(WB_DEF_YES) );
471 691 : SETCONST( pMessDefButton, "WB_DEF_NO", sal::static_int_cast<sal_uInt32>(WB_DEF_NO) );
472 691 : SETCONST( pMessDefButton, "WB_DEF_IGNORE", sal::static_int_cast<sal_uInt32>(WB_DEF_IGNORE) );
473 691 : return( pMessDefButton );
474 : }
475 :
476 : /*************************************************************************
477 : |*
478 : |* RscTypCont::InitGeometry()
479 : |*
480 : *************************************************************************/
481 691 : RscTupel * RscTypCont::InitGeometry()
482 : {
483 : RscTop * pTupel;
484 : Atom nId;
485 :
486 : // Clientvariablen einfuegen
487 1382 : pTupel = new RscTupel( pHS->getID( "TupelDeltaSystem" ),
488 691 : RSC_NOTYPE, NULL );
489 691 : nId = aNmTb.Put( "X", VARNAME );
490 691 : pTupel->SetVariable( nId, &aShort );
491 691 : nId = aNmTb.Put( "Y", VARNAME );
492 691 : pTupel->SetVariable( nId, &aShort );
493 691 : nId = aNmTb.Put( "WIDTH", VARNAME );
494 691 : pTupel->SetVariable( nId, &aShort );
495 691 : nId = aNmTb.Put( "HEIGHT", VARNAME );
496 691 : pTupel->SetVariable( nId, &aShort );
497 :
498 691 : return (RscTupel *)pTupel;
499 : }
500 :
501 : /*************************************************************************
502 : |*
503 : |* RscTypCont::InitLangGeometry()
504 : |*
505 : *************************************************************************/
506 691 : RscArray * RscTypCont::InitLangGeometry( RscTupel * pGeo )
507 : {
508 691 : return new RscArray( pHS->getID( "Lang_TupelGeometry" ), RSC_NOTYPE, pGeo, &aLangType );
509 : }
510 :
511 : /*************************************************************************
512 : |*
513 : |* RscTypCont::InitStringList()
514 : |*
515 : *************************************************************************/
516 691 : RscCont * RscTypCont::InitStringList()
517 : {
518 : RscCont * pCont;
519 :
520 691 : pCont = new RscCont( pHS->getID( "Chars[]" ), RSC_NOTYPE );
521 691 : pCont->SetTypeClass( &aString );
522 :
523 691 : return pCont;
524 : }
525 :
526 : /*************************************************************************
527 : |*
528 : |* RscTypCont::InitLangStringList()
529 : |*
530 : *************************************************************************/
531 691 : RscArray * RscTypCont::InitLangStringList( RscCont * pStrLst )
532 : {
533 1382 : return new RscArray( pHS->getID( "Lang_CharsList" ),
534 1382 : RSC_NOTYPE, pStrLst, &aLangType );
535 : }
536 :
537 : /*************************************************************************
538 : |*
539 : |* RscTypCont::InitStringTupel()
540 : |*
541 : *************************************************************************/
542 691 : RscTupel * RscTypCont::InitStringTupel()
543 : {
544 : RscTop * pTupel;
545 : Atom nId;
546 :
547 : // Clientvariablen einfuegen
548 691 : pTupel = new RscTupel( pHS->getID( "CharsTupel" ), RSC_NOTYPE, NULL );
549 691 : nId = aNmTb.Put( "FILTER", VARNAME );
550 691 : pTupel->SetVariable( nId, &aString );
551 691 : nId = aNmTb.Put( "MASK", VARNAME );
552 691 : pTupel->SetVariable( nId, &aString );
553 :
554 691 : return (RscTupel *)pTupel;
555 : }
556 :
557 : /*************************************************************************
558 : |*
559 : |* RscTypCont::InitStringLongTupel()
560 : |*
561 : *************************************************************************/
562 691 : RscTupel * RscTypCont::InitStringLongTupel()
563 : {
564 : RscTop * pTupel;
565 : Atom nId;
566 :
567 : // Clientvariablen einfuegen
568 691 : pTupel = new RscTupel( pHS->getID( "CharsLongTupel" ), RSC_NOTYPE, NULL );
569 691 : nId = aNmTb.Put( "ItemText", VARNAME );
570 691 : pTupel->SetVariable( nId, &aString );
571 691 : nId = aNmTb.Put( "ItemId", VARNAME );
572 691 : pTupel->SetVariable( nId, &aEnumLong );
573 :
574 691 : return (RscTupel *)pTupel;
575 : }
576 :
577 : /*************************************************************************
578 : |*
579 : |* RscTypCont::InitStringTupelList()
580 : |*
581 : *************************************************************************/
582 691 : RscCont * RscTypCont::InitStringTupelList( RscTupel * pTupelString )
583 : {
584 : RscCont * pCont;
585 :
586 691 : pCont = new RscCont( pHS->getID( "CharsCharsTupel[]" ), RSC_NOTYPE );
587 691 : pCont->SetTypeClass( pTupelString );
588 :
589 691 : return pCont;
590 : }
591 :
592 : /*************************************************************************
593 : |*
594 : |* RscTypCont::InitStringLongTupelList()
595 : |*
596 : *************************************************************************/
597 691 : RscCont * RscTypCont::InitStringLongTupelList( RscTupel * pStringLong )
598 : {
599 : RscCont * pCont;
600 :
601 691 : pCont = new RscCont( pHS->getID( "CharsLongTupel[]" ), RSC_NOTYPE );
602 691 : pCont->SetTypeClass( pStringLong );
603 :
604 691 : return pCont;
605 : }
606 :
607 : /*************************************************************************
608 : |*
609 : |* RscTypCont::InitLangStringTupelList()
610 : |*
611 : *************************************************************************/
612 691 : RscArray * RscTypCont::InitLangStringTupelList( RscCont * pStrTupelLst )
613 : {
614 1382 : return new RscArray( pHS->getID( "Lang_CharsCharsTupel" ),
615 1382 : RSC_NOTYPE, pStrTupelLst, &aLangType );
616 : }
617 :
618 : /*************************************************************************
619 : |*
620 : |* RscTypCont::InitLangStringLongTupelList()
621 : |*
622 : *************************************************************************/
623 691 : RscArray * RscTypCont::InitLangStringLongTupelList( RscCont * pStrLongTupelLst )
624 : {
625 1382 : return new RscArray( pHS->getID( "Lang_CharsLongTupelList" ),
626 1382 : RSC_NOTYPE, pStrLongTupelLst, &aLangType );
627 2073 : }
628 :
629 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|