aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/WixToolset.DUtil/inc/locutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/inc/locutil.h')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/locutil.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/locutil.h b/src/libs/dutil/WixToolset.DUtil/inc/locutil.h
new file mode 100644
index 00000000..38ddda20
--- /dev/null
+++ b/src/libs/dutil/WixToolset.DUtil/inc/locutil.h
@@ -0,0 +1,120 @@
1#pragma once
2// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
3
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9struct LOC_STRING
10{
11 LPWSTR wzId;
12 LPWSTR wzText;
13 BOOL bOverridable;
14};
15
16const int LOC_CONTROL_NOT_SET = INT_MAX;
17
18struct LOC_CONTROL
19{
20 LPWSTR wzControl;
21 int nX;
22 int nY;
23 int nWidth;
24 int nHeight;
25 LPWSTR wzText;
26};
27
28const int WIX_LOCALIZATION_LANGUAGE_NOT_SET = INT_MAX;
29
30struct WIX_LOCALIZATION
31{
32 DWORD dwLangId;
33
34 DWORD cLocStrings;
35 LOC_STRING* rgLocStrings;
36
37 DWORD cLocControls;
38 LOC_CONTROL* rgLocControls;
39};
40
41/********************************************************************
42 LocProbeForFile - Searches for a localization file on disk.
43
44*******************************************************************/
45HRESULT DAPI LocProbeForFile(
46 __in_z LPCWSTR wzBasePath,
47 __in_z LPCWSTR wzLocFileName,
48 __in_z_opt LPCWSTR wzLanguage,
49 __inout LPWSTR* psczPath
50 );
51
52/********************************************************************
53 LocLoadFromFile - Loads a localization file
54
55*******************************************************************/
56HRESULT DAPI LocLoadFromFile(
57 __in_z LPCWSTR wzWxlFile,
58 __out WIX_LOCALIZATION** ppWixLoc
59 );
60
61/********************************************************************
62 LocLoadFromResource - loads a localization file from a module's data
63 resource.
64
65 NOTE: The resource data must be UTF-8 encoded.
66*******************************************************************/
67HRESULT DAPI LocLoadFromResource(
68 __in HMODULE hModule,
69 __in_z LPCSTR szResource,
70 __out WIX_LOCALIZATION** ppWixLoc
71 );
72
73/********************************************************************
74 LocFree - free memory allocated when loading a localization file
75
76*******************************************************************/
77void DAPI LocFree(
78 __in_opt WIX_LOCALIZATION* pWixLoc
79 );
80
81/********************************************************************
82 LocLocalizeString - replace any #(loc.id) in a string with the
83 correct sub string
84*******************************************************************/
85HRESULT DAPI LocLocalizeString(
86 __in const WIX_LOCALIZATION* pWixLoc,
87 __inout LPWSTR* psczInput
88 );
89
90/********************************************************************
91 LocGetControl - returns a control's localization information
92*******************************************************************/
93HRESULT DAPI LocGetControl(
94 __in const WIX_LOCALIZATION* pWixLoc,
95 __in_z LPCWSTR wzId,
96 __out LOC_CONTROL** ppLocControl
97 );
98
99/********************************************************************
100LocGetString - returns a string's localization information
101*******************************************************************/
102extern "C" HRESULT DAPI LocGetString(
103 __in const WIX_LOCALIZATION* pWixLoc,
104 __in_z LPCWSTR wzId,
105 __out LOC_STRING** ppLocString
106 );
107
108/********************************************************************
109LocAddString - adds a localization string
110*******************************************************************/
111extern "C" HRESULT DAPI LocAddString(
112 __in WIX_LOCALIZATION* pWixLoc,
113 __in_z LPCWSTR wzId,
114 __in_z LPCWSTR wzLocString,
115 __in BOOL bOverridable
116 );
117
118#ifdef __cplusplus
119}
120#endif