lok: add character parameter to renderFont
[LibreOffice.git] / l10ntools / inc / gL10nMem.hxx
blobc657c8225b2c9e1e80af1f9779f5925fe4d45920
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 .
19 #ifndef GL10NMEM_HXX
20 #define GL10NMEM_HXX
22 class l10nMem_enus_entry;
23 class l10nMem_file_entry;
24 class l10nMem_lang_list_entry;
25 class l10nMem
27 public:
28 l10nMem();
29 ~l10nMem();
31 typedef enum {
32 ENTRY_DELETED,
33 ENTRY_ADDED,
34 ENTRY_CHANGED,
35 ENTRY_NORMAL
36 } ENTRY_STATE;
38 static int showError (const string& sText, int iLineNo = 0);
39 static void showWarning(const string& sText, int iLineNo = 0);
40 static void showDebug (const string& sText, int iLineNo = 0);
41 static void showVerbose(const string& sText, int iLineNo = 0);
42 static void keyToLower (string& sKey);
44 void setModuleName(const string& sModuleName);
45 const string& getModuleName(void);
46 void setLanguage(const string& sLanguage,
47 bool bCreate);
48 void setConvert(bool bConvert,
49 bool bStrict);
50 void setVerbose(const bool doVerbose);
51 void setDebug(const bool doDebug);
53 void loadEntryKey(int iLineNo,
54 const string& sSourceFile,
55 const string& sKey,
56 const string& sOrgText,
57 const string& sText,
58 const string& sComment,
59 const string& sResource,
60 const string& sGroup,
61 bool bIsFuzzy);
62 void setSourceKey(int iLineNo,
63 const string& sFilename,
64 const string& sKey,
65 const string& sText,
66 const string& sComment,
67 const string& sResource,
68 const string& sGroup,
69 bool bMustExist);
71 void saveTemplates(const string& sTargetDir,
72 bool bForce);
73 void saveLanguages(l10nMem& cMem,
74 const string& sTargetDir,
75 bool bForce);
76 void dumpMem(const string& sTargetDir);
77 int prepareMerge();
78 bool getMergeLang(string& sLang,
79 string& sText);
80 void showNOconvert();
81 bool isError();
82 void convertToInetString(string& sText);
83 void convertFromInetString(string& sText);
85 private:
86 bool mbVerbose;
87 bool mbDebug;
88 bool mbInError;
89 string msModuleName;
90 int miCurFileInx;
91 int miCurLangInx;
92 int miCurENUSinx;
93 bool mbConvertMode;
94 bool mbStrictMode;
95 vector<l10nMem_enus_entry> mcENUSlist;
96 vector<l10nMem_file_entry> mcFileList;
97 vector<l10nMem_lang_list_entry> mcLangList;
99 void formatAndShowText(const string& sType, int iLineNo, const string& sText);
100 bool needWrite(const string sFileName, bool bForce);
101 bool convFilterWarning(const string& sSourceFile,
102 const string& sKey,
103 const string& sMsgId);
104 void convEntryKey(int iLineNo,
105 const string& sSourceFile,
106 const string& sKey,
107 const string& sMsgId,
108 const string& sMsgStr,
109 bool bIsFuzzy);
110 void loadENUSkey(int iLineNo,
111 const string& sSourceFile,
112 const string& sKey,
113 const string& sMsgId,
114 const string& sComment,
115 const string& sResource,
116 const string& sGroup);
117 void loadLangKey(int iLineNo,
118 const string& sSourceFile,
119 const string& sKey,
120 const string& sMsgId,
121 const string& sMsgStr,
122 bool bFuzzy);
123 void reorganize(bool bConvert);
124 bool locateKey(int iLineNo,
125 const string& sSourceFile,
126 const string& sKey,
127 const string& sMsgId,
128 bool bThrow);
129 void addKey(int iLineNo,
130 const string& sSourceFile,
131 const string& sKey,
132 const string& sMsgId,
133 const string& sComment,
134 const string& sResource,
135 const string& sGroup,
136 l10nMem::ENTRY_STATE eStat);
137 bool findFileName(const string& sSourceFile);
139 #endif