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 .
20 #ifndef INCLUDED_RSC_INC_RSCDB_HXX
21 #define INCLUDED_RSC_INC_RSCDB_HXX
25 #include <rscconst.hxx>
26 #include <rscflag.hxx>
27 #include <rscrange.hxx>
29 #include <rscarray.hxx>
39 enum class SymbolType
: sal_uInt16
;
40 enum class ToolBoxItemBits
;
41 enum class WindowBorderStyle
: sal_Int16
;
42 enum class KeyFuncType
: sal_Int32
;
43 enum class MenuItemBits
: sal_Int16
;
44 enum class ToolBoxItemType
;
45 enum class ButtonType
;
51 OString aOutputSysList
;
55 // Liste die alle Basistypen enthaelt
56 typedef ::std::vector
< RscTop
* > RscBaseList
;
58 // Tabelle fuer Systemabhaengige Resourcen
68 typedef ::std::vector
< RscSysEntry
* > RscSysList
;
72 rtl_TextEncoding nSourceCharSet
;
73 sal_uInt32 nMachineId
; // Globaler Maschinentyp
74 RSCBYTEORDER_TYPE nByteOrder
; // Intel oder
75 OString aLanguage
; // output language
76 std::vector
< sal_uInt32
> aLangFallbacks
; // language fallback list (entry 0 is language itself)
77 OString aSearchPath
; // Suchen der Bitmap, Icon, Pointer
78 OString aSysSearchPath
; // aSearchPath plus language specific paths
79 sal_uInt32 nUniqueId
; // eindeutiger Id fuer Systemresourcen
80 sal_uLong nFilePos
; // Position in der Datei ( MTF )
81 sal_uInt32 nPMId
; // eindeutiger Id fuer PM-Rseourcefile
82 // muss groesser als RSC_VERSIONCONTROL_ID sein
83 RscTop
* pRoot
; // Zeiger auf die Wurzel vom Typenbaum
84 RSCINST aVersion
; // Versionskontrollinstanz
86 RscBaseList aBaseLst
; // Liste der einfachen Resourceklasse
87 RscSysList aSysLst
; // Liste der Systemresourcen
89 Atom nWinBitVarId
; // Name der Winbitvariablen
125 Atom nHideWhenDeactivateId
;
128 Atom nDDExtraWidthId
;
136 Atom nEnableResizingId
;
146 void Init(); // Initialisiert Klassen und Tabelle
147 void SETCONST( RscConst
*, const char *, sal_uInt32
);
148 void SETCONST( RscConst
*, Atom
, sal_uInt32
);
149 inline void SETCONST( RscConst
*p1
, const char * p2
, SymbolType p3
) { SETCONST(p1
, p2
, static_cast<sal_uInt32
>(p3
)); }
150 inline void SETCONST( RscConst
*p1
, Atom p2
, ToolBoxItemBits p3
) { SETCONST(p1
, p2
, static_cast<sal_uInt32
>(p3
)); }
151 inline void SETCONST( RscConst
*p1
, Atom p2
, WindowBorderStyle p3
) { SETCONST(p1
, p2
, static_cast<sal_uInt32
>(p3
)); }
152 inline void SETCONST( RscConst
*p1
, const char * p2
, KeyFuncType p3
) { SETCONST(p1
, p2
, static_cast<sal_uInt32
>(p3
)); }
153 inline void SETCONST( RscConst
*p1
, const char * p2
, MenuItemBits p3
) { SETCONST(p1
, p2
, static_cast<sal_uInt32
>(p3
)); }
154 inline void SETCONST( RscConst
*p1
, Atom p2
, MenuItemBits p3
) { SETCONST(p1
, p2
, static_cast<sal_uInt32
>(p3
)); }
155 inline void SETCONST( RscConst
*p1
, const char * p2
, ToolBoxItemType p3
) { SETCONST(p1
, p2
, static_cast<sal_uInt32
>(p3
)); }
156 inline void SETCONST( RscConst
*p1
, Atom p2
, ButtonType p3
) { SETCONST(p1
, p2
, static_cast<sal_uInt32
>(p3
)); }
157 inline void SETCONST( RscConst
*p1
, const char * p2
, ButtonType p3
) { SETCONST(p1
, p2
, static_cast<sal_uInt32
>(p3
)); }
158 RscEnum
* InitLangType();
159 RscEnum
* InitFieldUnitsType();
160 RscEnum
* InitColor();
161 RscEnum
* InitMapUnit();
163 RscEnum
* InitTriState();
164 RscTupel
* InitGeometry();
165 RscArray
* InitLangGeometry( RscTupel
* pGeo
);
166 RscArray
* InitSystemGeometry( RscTupel
* pGeo
);
167 RscCont
* InitStringList();
168 RscArray
* InitLangStringList( RscCont
* pStrLst
);
169 RscTupel
* InitStringTupel();
170 RscTupel
* InitStringLongTupel();
171 static RscCont
* InitStringTupelList( RscTupel
* pStringTupel
);
172 static RscCont
* InitStringLongTupelList( RscTupel
* pStringLongTupel
);
173 RscArray
* InitLangStringTupelList( RscCont
* pStrTupelLst
);
174 RscArray
* InitLangStringLongTupelList( RscCont
* pStrLongTupelLst
);
176 RscTop
* InitClassMgr();
177 RscTop
* InitClassString( RscTop
* pSuper
);
178 RscTop
* InitClassBitmap( RscTop
* pSuper
);
179 RscTop
* InitClassColor( RscTop
* pSuper
, RscEnum
* pColor
);
180 RscTop
* InitClassImage( RscTop
* pSuper
, RscTop
*pClassBitmap
,
181 RscTop
* pClassColor
);
182 RscTop
* InitClassImageList( RscTop
* pSuper
,
183 RscTop
* pClassColor
, RscCont
* pStrLst
);
184 RscTop
* InitClassWindow( RscTop
* pSuper
, RscEnum
* pMapUnit
,
185 RscArray
* pLangGeo
);
186 RscTop
* InitClassSystemWindow( RscTop
* pSuper
);
187 RscTop
* InitClassWorkWindow( RscTop
* pSuper
);
188 RscTop
* InitClassControl( RscTop
* pSuper
);
189 RscTop
* InitClassCheckBox( RscTop
* pSuper
);
190 RscTop
* InitClassPushButton( RscTop
* pSuper
);
191 RscTop
* InitClassImageButton( RscTop
* pSuper
, RscTop
* pClassImage
,
192 RscEnum
* pTriState
);
193 RscTop
* InitClassEdit( RscTop
* pSuper
);
194 RscTop
* InitClassScrollBar( RscTop
* pSuper
);
195 RscTop
* InitClassListBox( RscTop
* pSuper
, RscArray
* pStrLst
);
196 RscTop
* InitClassComboBox( RscTop
* pSuper
, RscArray
* pStrLst
);
197 RscTop
* InitClassFixedText( RscTop
* pSuper
);
198 RscTop
* InitClassFixedImage( RscTop
* pSuper
, RscTop
* pClassImage
);
199 RscTop
* InitClassRadioButton( RscTop
* pSuper
);
200 RscTop
* InitClassKeyCode( RscTop
* pSuper
, RscEnum
* pKey
);
201 RscTop
* InitClassAccelItem( RscTop
* pSuper
, RscTop
* pKeyCode
);
202 RscTop
* InitClassAccel( RscTop
* pSuper
, RscTop
* pClassAccelItem
);
203 RscTop
* InitClassMenuItem( RscTop
* pSuper
, RscTop
* pClassBitmap
,
204 RscTop
* pClassKeyCode
);
205 RscTop
* InitClassMenu( RscTop
* pSuper
, RscTop
* pMenuItem
);
206 RscTop
* InitClassSplitWindow( RscTop
* pSuper
);
208 RscTop
* InitClassNumericFormatter( RscTop
* pSuper
);
209 RscTop
* InitClassMetricFormatter( RscTop
* pSuper
,
210 RscEnum
* pFieldUnits
);
212 RscTop
* InitClassSpinField( RscTop
* pSuper
);
213 RscTop
* InitClassNumericField( RscTop
* pSuper
);
214 RscTop
* InitClassMetricField( RscTop
* pSuper
);
216 RscTop
* InitClassDockingWindow( RscTop
* pSuper
,
217 RscEnum
* pMapUnit
);
218 RscTop
* InitClassToolBoxItem( RscTop
* pSuper
, RscTop
* pClassBitmap
,
219 RscTop
* pClassImage
,
220 RscEnum
* pTriState
);
221 RscTop
* InitClassToolBox( RscTop
* pSuper
, RscTop
* pClassToolBoxItem
,
222 RscTop
* pClassImageList
);
223 RscTop
* InitClassSfxStyleFamilyItem( RscTop
* pSuper
,
224 RscTop
* pClassBitmap
,
225 RscTop
* pClassImage
,
226 RscArray
* pStrLst
);
227 RscTop
* InitClassSfxTemplateDialog( RscTop
* pSuper
,
228 RscTop
* pStyleFamily
);
229 RscTop
* InitClassSfxSlotInfo( RscTop
* pSuper
);
231 void InsWinBit( RscTop
* pClass
, const OString
& rName
,
233 void WriteInc( FILE * fOutput
, sal_uLong lKey
);
240 RscLongEnumRange aEnumLong
;
241 RscIdRange aIdUShort
;
242 RscIdRange aIdNoZeroUShort
;
243 RscBreakRange aNoZeroShort
;
246 RscString aStringLiteral
;
248 RscLangEnum aLangType
;
249 RscLangArray aLangString
;
250 RscLangArray aLangShort
;
252 Atom nAcceleratorType
;
254 RscError
* pEH
; // Fehlerhandler
255 RscNameTable aNmTb
; // Tabelle fuer Namen
256 RscFileTab aFileTab
; // Tabelle der Dateinamen
258 std::map
<sal_uInt64
, sal_uLong
> aIdTranslator
; //Ordnet Resourcetypen und Id's einen Id zu
259 //(unter PM), oder eine Dateiposition (MTF)
261 RscTypCont( RscError
*, RSCBYTEORDER_TYPE
, const OString
& rSearchPath
, sal_uInt32 nFlags
);
264 Atom
AddLanguage( const char* );
266 bool IsPreload() const
267 { return (nFlags
& PRELOAD_FLAG
) != 0; }
268 bool IsSysResTest() const
269 { return (nFlags
& NOSYSRESTEST_FLAG
) == 0; }
270 bool IsSrsDefault() const
271 { return (nFlags
& SRSDEFAULT_FLAG
) != 0; }
272 OString
ChangeLanguage(const OString
& rNewLang
);
273 const std::vector
< sal_uInt32
>& GetFallbacks() const
274 { return aLangFallbacks
; }
276 RSCBYTEORDER_TYPE
GetByteOrder() const { return nByteOrder
; }
277 rtl_TextEncoding
GetSourceCharSet() const { return nSourceCharSet
; }
278 rtl_TextEncoding
SetSourceCharSet( rtl_TextEncoding aCharSet
)
280 rtl_TextEncoding aOld
= nSourceCharSet
;
281 nSourceCharSet
= aCharSet
;
284 void SetSearchPath( const OString
& rStr
) { aSearchPath
= rStr
; }
285 OString
GetSearchPath() const { return aSearchPath
; }
286 void SetSysSearchPath( const OString
& rStr
) { aSysSearchPath
= rStr
; }
287 void InsertType( RscTop
* pType
)
289 aBaseLst
.push_back( pType
);
291 RscTop
* SearchType( Atom nTypId
);
292 // loescht alle Resourceobjekte diese Datei
293 void Delete( sal_uLong lFileKey
);
294 RscTop
* GetRoot() { return pRoot
; }
295 sal_uInt32
PutSysName( sal_uInt32 nRscTyp
, char * pName
, sal_uInt32 nConst
,
296 sal_uInt32 nId
, bool bFirst
);
297 void ClearSysNames();
298 ERRTYPE
WriteRc( WriteRcContext
& rContext
);
299 void WriteSrc( FILE * fOutput
, sal_uLong nFileIndex
,
301 sal_uInt32
PutTranslatorKey( sal_uInt64 nKey
);
302 void IncFilePos( sal_uLong nOffset
){ nFilePos
+= nOffset
; }
307 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */