1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
25 #include <rscconst.hxx>
26 #include <rscflag.hxx>
27 #include <rscrange.hxx>
29 #include <rscarray.hxx>
31 #include <tools/string.hxx>
45 OString aOutputSysList
;
49 // Liste die alle Basistypen enthaelt
50 typedef ::std::vector
< RscTop
* > RscBaseList
;
52 // Tabelle fuer Systemabhaengige Resourcen
62 typedef ::std::vector
< RscSysEntry
* > RscSysList
;
66 CharSet nSourceCharSet
;
67 sal_uInt32 nMachineId
; // Globaler Maschinentyp
68 RSCBYTEORDER_TYPE nByteOrder
; // Intel oder
69 OString aLanguage
; // output language
70 std::vector
< sal_uInt32
> aLangFallbacks
; // language fallback list (entry 0 is language itself)
71 OString aSearchPath
; // Suchen der Bitmap, Icon, Pointer
72 OString aSysSearchPath
; // aSearchPath plus language specific paths
73 sal_uInt32 nUniqueId
; // eindeutiger Id fuer Systemresourcen
74 sal_uLong nFilePos
; // Position in der Datei ( MTF )
75 sal_uInt32 nPMId
; // eindeutiger Id fuer PM-Rseourcefile
76 // muss groesser als RSC_VERSIONCONTROL_ID sein
77 RscTop
* pRoot
; // Zeiger auf die Wurzel vom Typenbaum
78 RSCINST aVersion
; // Versionskontrollinstanz
80 RscBaseList aBaseLst
; // Liste der einfachen Resourceklasse
81 RscSysList aSysLst
; // Liste der Systemresourcen
83 Atom nWinBitVarId
; // Name der Winbitvariablen
119 Atom nHideWhenDeactivateId
;
122 Atom nDDExtraWidthId
;
130 Atom nEnableResizingId
;
140 void Init(); // Initialisiert Klassen und Tabelle
141 void SETCONST( RscConst
*, const char *, sal_uInt32
);
142 void SETCONST( RscConst
*, Atom
, sal_uInt32
);
143 RscEnum
* InitLangType();
144 RscEnum
* InitFieldUnitsType();
145 RscEnum
* InitTimeFieldFormat();
146 RscEnum
* InitColor();
147 RscEnum
* InitMapUnit();
149 RscEnum
* InitTriState();
150 RscEnum
* InitMessButtons();
151 RscEnum
* InitMessDefButton();
152 RscTupel
* InitGeometry();
153 RscArray
* InitLangGeometry( RscTupel
* pGeo
);
154 RscArray
* InitSystemGeometry( RscTupel
* pGeo
);
155 RscCont
* InitStringList();
156 RscArray
* InitLangStringList( RscCont
* pStrLst
);
157 RscTupel
* InitStringTupel();
158 RscTupel
* InitStringLongTupel();
159 RscCont
* InitStringTupelList( RscTupel
* pStringTupel
);
160 RscCont
* InitStringLongTupelList( RscTupel
* pStringLongTupel
);
161 RscArray
* InitLangStringTupelList( RscCont
* pStrTupelLst
);
162 RscArray
* InitLangStringLongTupelList( RscCont
* pStrLongTupelLst
);
164 RscTop
* InitClassMgr();
165 RscTop
* InitClassString( RscTop
* pSuper
);
166 RscTop
* InitClassBitmap( RscTop
* pSuper
);
167 RscTop
* InitClassColor( RscTop
* pSuper
, RscEnum
* pColor
);
168 RscTop
* InitClassImage( RscTop
* pSuper
, RscTop
*pClassBitmap
,
169 RscTop
* pClassColor
);
170 RscTop
* InitClassImageList( RscTop
* pSuper
,
171 RscTop
* pClassColor
, RscCont
* pStrLst
);
172 RscTop
* InitClassWindow( RscTop
* pSuper
, RscEnum
* pMapUnit
,
173 RscArray
* pLangGeo
);
174 RscTop
* InitClassSystemWindow( RscTop
* pSuper
);
175 RscTop
* InitClassWorkWindow( RscTop
* pSuper
);
176 RscTop
* InitClassModalDialog( RscTop
* pSuper
);
177 RscTop
* InitClassModelessDialog( RscTop
* pSuper
);
178 RscTop
* InitClassControl( RscTop
* pSuper
);
179 RscTop
* InitClassCheckBox( RscTop
* pSuper
);
180 RscTop
* InitClassPushButton( RscTop
* pSuper
);
181 RscTop
* InitClassTriStateBox( RscTop
* pSuper
, RscEnum
* pTriState
);
182 RscTop
* InitClassMenuButton( RscTop
* pSuper
, RscTop
* pClasMenu
);
183 RscTop
* InitClassImageButton( RscTop
* pSuper
, RscTop
* pClassImage
,
184 RscEnum
* pTriState
);
185 RscTop
* InitClassEdit( RscTop
* pSuper
);
186 RscTop
* InitClassMultiLineEdit( RscTop
* pSuper
);
187 RscTop
* InitClassScrollBar( RscTop
* pSuper
);
188 RscTop
* InitClassListBox( RscTop
* pSuper
, RscArray
* pStrLst
);
189 RscTop
* InitClassMultiListBox( RscTop
* pSuper
);
190 RscTop
* InitClassComboBox( RscTop
* pSuper
, RscArray
* pStrLst
);
191 RscTop
* InitClassFixedText( RscTop
* pSuper
);
192 RscTop
* InitClassFixedBitmap( RscTop
* pSuper
, RscTop
* pClassBitmap
);
193 RscTop
* InitClassFixedImage( RscTop
* pSuper
, RscTop
* pClassImage
);
194 RscTop
* InitClassRadioButton( RscTop
* pSuper
);
195 RscTop
* InitClassImageRadioButton( RscTop
* pSuper
, RscTop
* pClassImage
);
196 RscTop
* InitClassKeyCode( RscTop
* pSuper
, RscEnum
* pKey
);
197 RscTop
* InitClassAccelItem( RscTop
* pSuper
, RscTop
* pKeyCode
);
198 RscTop
* InitClassAccel( RscTop
* pSuper
, RscTop
* pClassAccelItem
);
199 RscTop
* InitClassMenuItem( RscTop
* pSuper
, RscTop
* pClassBitmap
,
200 RscTop
* pClassKeyCode
);
201 RscTop
* InitClassMenu( RscTop
* pSuper
, RscTop
* pMenuItem
);
202 RscTop
* InitClassMessBox( RscTop
* pSuper
,
203 RscEnum
* pMessButtons
,
204 RscEnum
* pMessDefButton
);
205 RscTop
* InitClassSplitter( RscTop
* pSuper
);
206 RscTop
* InitClassSplitWindow( RscTop
* pSuper
);
207 RscTop
* InitClassTime( RscTop
* pSuper
);
208 RscTop
* InitClassDate( RscTop
* pSuper
);
210 RscTop
* InitClassPatternFormatter( RscTop
* pSuper
);
211 RscTop
* InitClassNumericFormatter( RscTop
* pSuper
);
212 RscTop
* InitClassMetricFormatter( RscTop
* pSuper
,
213 RscEnum
* pFieldUnits
);
214 RscTop
* InitClassCurrencyFormatter( RscTop
* pSuper
);
215 RscTop
* InitClassDateFormatter( RscTop
* pSuper
, RscTop
* pClassDate
);
216 RscTop
* InitClassTimeFormatter( RscTop
* pSuper
, RscTop
* pClassTime
,
217 RscEnum
* pTimeFieldFormat
);
219 RscTop
* InitClassSpinField( RscTop
* pSuper
);
220 RscTop
* InitClassPatternField( RscTop
* pSuper
);
221 RscTop
* InitClassNumericField( RscTop
* pSuper
);
222 RscTop
* InitClassMetricField( RscTop
* pSuper
);
223 RscTop
* InitClassCurrencyField( const char * pClassName
, sal_uInt32 nRT
,
225 RscTop
* InitClassDateField( RscTop
* pSuper
, RscTop
* pClassDate
);
226 RscTop
* InitClassTimeField( RscTop
* pSuper
, RscTop
* pClassTime
);
227 RscTop
* InitClassPatternBox( RscTop
* pSuper
);
228 RscTop
* InitClassNumericBox( RscTop
* pSuper
);
229 RscTop
* InitClassMetricBox( RscTop
* pSuper
);
230 RscTop
* InitClassCurrencyBox( const char * pClassName
, sal_uInt32 nRT
,
232 RscTop
* InitClassDateBox( RscTop
* pSuper
);
233 RscTop
* InitClassTimeBox( RscTop
* pSuper
);
235 RscTop
* InitClassDockingWindow( RscTop
* pSuper
,
236 RscEnum
* pMapUnit
);
237 RscTop
* InitClassToolBoxItem( RscTop
* pSuper
, RscTop
* pClassBitmap
,
238 RscTop
* pClassImage
,
239 RscEnum
* pTriState
);
240 RscTop
* InitClassToolBox( RscTop
* pSuper
, RscTop
* pClassToolBoxItem
,
241 RscTop
* pClassImageList
);
242 RscTop
* InitClassStatusBar( RscTop
* pSuper
);
243 RscTop
* InitClassMoreButton( RscTop
* pSuper
, RscEnum
* pMapUnit
);
244 RscTop
* InitClassFloatingWindow( RscTop
* pSuper
,
245 RscEnum
* pMapUnit
);
246 RscTop
* InitClassTabControlItem( RscTop
* pSuper
);
247 RscTop
* InitClassTabControl( RscTop
* pSuper
,
248 RscTop
* pClassTabControlItem
);
249 RscTop
* InitClassSfxStyleFamilyItem( RscTop
* pSuper
,
250 RscTop
* pClassBitmap
,
251 RscTop
* pClassImage
,
252 RscArray
* pStrLst
);
253 RscTop
* InitClassSfxTemplateDialog( RscTop
* pSuper
,
254 RscTop
* pStyleFamily
);
255 RscTop
* InitClassSfxSlotInfo( RscTop
* pSuper
);
257 void InsWinBit( RscTop
* pClass
, const OString
& rName
,
259 void WriteInc( FILE * fOutput
, sal_uLong lKey
);
266 RscLongEnumRange aEnumLong
;
267 RscIdRange aIdUShort
;
268 RscIdRange aIdNoZeroUShort
;
269 RscBreakRange aNoZeroShort
;
270 RscRange a1to12Short
;
271 RscRange a0to23Short
;
272 RscRange a1to31Short
;
273 RscRange a0to59Short
;
274 RscRange a0to99Short
;
275 RscRange a0to9999Short
;
278 RscString aStringLiteral
;
280 RscLangEnum aLangType
;
281 RscLangArray aLangString
;
282 RscLangArray aLangShort
;
284 Atom nAcceleratorType
;
286 RscError
* pEH
; // Fehlerhandler
287 RscNameTable aNmTb
; // Tabelle fuer Namen
288 RscFileTab aFileTab
; // Tabelle der Dateinamen
290 std::map
<sal_uInt64
, sal_uLong
> aIdTranslator
; //Ordnet Resourcetypen und Id's einen Id zu
291 //(unter PM), oder eine Dateiposition (MTF)
293 RscTypCont( RscError
*, RSCBYTEORDER_TYPE
, const OString
& rSearchPath
, sal_uInt32 nFlags
);
296 Atom
AddLanguage( const char* );
298 sal_Bool
IsPreload() const
299 { return (nFlags
& PRELOAD_FLAG
) ? sal_True
: sal_False
; }
300 sal_Bool
IsSysResTest() const
301 { return (nFlags
& NOSYSRESTEST_FLAG
) ? sal_False
: sal_True
; }
302 sal_Bool
IsSrsDefault() const
303 { return (nFlags
& SRSDEFAULT_FLAG
) ? sal_True
: sal_False
; }
304 OString
ChangeLanguage(const OString
& rNewLang
);
305 const std::vector
< sal_uInt32
>& GetFallbacks() const
306 { return aLangFallbacks
; }
308 RSCBYTEORDER_TYPE
GetByteOrder() const { return nByteOrder
; }
309 CharSet
GetSourceCharSet() const { return nSourceCharSet
; }
310 CharSet
SetSourceCharSet( CharSet aCharSet
)
312 CharSet aOld
= nSourceCharSet
;
313 nSourceCharSet
= aCharSet
;
316 void SetSearchPath( const OString
& rStr
) { aSearchPath
= rStr
; }
317 OString
GetSearchPath() const { return aSearchPath
; }
318 void SetSysSearchPath( const OString
& rStr
) { aSysSearchPath
= rStr
; }
319 void InsertType( RscTop
* pType
)
321 aBaseLst
.push_back( pType
);
323 RscTop
* SearchType( Atom nTypId
);
324 // loescht alle Resourceobjekte diese Datei
325 void Delete( sal_uLong lFileKey
);
326 RscTop
* GetRoot() { return( pRoot
); };
327 sal_uInt32
PutSysName( sal_uInt32 nRscTyp
, char * pName
, sal_uInt32 nConst
,
328 sal_uInt32 nId
, sal_Bool bFirst
);
329 void ClearSysNames();
330 ERRTYPE
WriteRc( WriteRcContext
& rContext
);
331 void WriteSrc( FILE * fOutput
, sal_uLong nFileIndex
,
332 sal_Bool bName
= sal_True
);
333 sal_uInt32
PutTranslatorKey( sal_uInt64 nKey
);
334 void IncFilePos( sal_uLong nOffset
){ nFilePos
+= nOffset
; }
339 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */