[RAPPS] unuglify icons. CORE-10642
[reactos.git] / reactos / base / applications / rapps / rapps.h
1 #ifndef _RAPPS_H
2 #define _RAPPS_H
3
4 #include <stdarg.h>
5
6 #define WIN32_NO_STATUS
7 #define _INC_WINDOWS
8 #define COM_NO_WINDOWS_H
9 #define COBJMACROS
10
11 #include <windef.h>
12 #include <winbase.h>
13 #include <winreg.h>
14 #include <wingdi.h>
15 #include <winnls.h>
16 #include <winuser.h>
17 #include <wincon.h>
18 #include <richedit.h>
19 #include <shlobj.h>
20 #include <shlwapi.h>
21 #include <stdio.h>
22 #include <strsafe.h>
23 #include <ndk/rtlfuncs.h>
24
25 #include <rappsmsg.h>
26
27 #include "resource.h"
28
29 #ifdef USE_CERT_PINNING
30 #define CERT_ISSUER_INFO "BE\r\nGlobalSign nv-sa\r\nGlobalSign Domain Validation CA - SHA256 - G2"
31 #define CERT_SUBJECT_INFO "Domain Control Validated\r\n*.reactos.org"
32 #endif
33
34 #define APPLICATION_DATABASE_URL L"https://svn.reactos.org/packages/rappmgr.cab"
35
36 #define SPLIT_WIDTH 4
37 #define MAX_STR_LEN 256
38
39 #define LISTVIEW_ICON_SIZE 24
40 #define TREEVIEW_ICON_SIZE 24
41
42 /* EnumType flags for EnumInstalledApplications */
43 #define ENUM_ALL_COMPONENTS 30
44 #define ENUM_APPLICATIONS 31
45 #define ENUM_UPDATES 32
46 /* EnumType flags for EnumAvailableApplications */
47 #define ENUM_ALL_AVAILABLE 0
48 #define ENUM_CAT_AUDIO 1
49 #define ENUM_CAT_VIDEO 2
50 #define ENUM_CAT_GRAPHICS 3
51 #define ENUM_CAT_GAMES 4
52 #define ENUM_CAT_INTERNET 5
53 #define ENUM_CAT_OFFICE 6
54 #define ENUM_CAT_DEVEL 7
55 #define ENUM_CAT_EDU 8
56 #define ENUM_CAT_ENGINEER 9
57 #define ENUM_CAT_FINANCE 10
58 #define ENUM_CAT_SCIENCE 11
59 #define ENUM_CAT_TOOLS 12
60 #define ENUM_CAT_DRIVERS 13
61 #define ENUM_CAT_LIBS 14
62 #define ENUM_CAT_OTHER 15
63
64 #define ENUM_INSTALLED_MIN ENUM_ALL_COMPONENTS
65 #define ENUM_INSTALLED_MAX ENUM_UPDATES
66 #define ENUM_AVAILABLE_MIN ENUM_ALL_AVAILABLE
67 #define ENUM_AVAILABLE_MAX ENUM_CAT_OTHER
68
69 #define IS_INSTALLED_ENUM(a) (a >= ENUM_INSTALLED_MIN && a <= ENUM_INSTALLED_MAX)
70 #define IS_AVAILABLE_ENUM(a) (a >= ENUM_AVAILABLE_MIN && a <= ENUM_AVAILABLE_MAX)
71
72 /* aboutdlg.c */
73 VOID ShowAboutDialog(VOID);
74
75 /* available.c */
76 typedef struct
77 {
78 INT Category;
79 WCHAR szName[MAX_PATH];
80 WCHAR szRegName[MAX_PATH];
81 WCHAR szVersion[MAX_PATH];
82 WCHAR szLicense[MAX_PATH];
83 WCHAR szDesc[MAX_PATH];
84 WCHAR szSize[MAX_PATH];
85 WCHAR szUrlSite[MAX_PATH];
86 WCHAR szUrlDownload[MAX_PATH];
87 WCHAR szCDPath[MAX_PATH];
88
89 /* caching mechanism related entries */
90 WCHAR cFileName[MAX_PATH];
91 FILETIME ftCacheStamp;
92 LIST_ENTRY List;
93
94 /* optional integrity checks (SHA-1 digests are 160 bit = 40 characters in hex string form) */
95 WCHAR szSHA1[40 + 1];
96
97 } APPLICATION_INFO, *PAPPLICATION_INFO;
98
99 BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName);
100
101 typedef struct
102 {
103 HKEY hRootKey;
104 HKEY hSubKey;
105 WCHAR szKeyName[MAX_PATH];
106
107 } INSTALLED_INFO, *PINSTALLED_INFO;
108
109 typedef struct
110 {
111 BOOL bSaveWndPos;
112 BOOL bUpdateAtStart;
113 BOOL bLogEnabled;
114 WCHAR szDownloadDir[MAX_PATH];
115 BOOL bDelInstaller;
116 /* Window Pos */
117 BOOL Maximized;
118 INT Left;
119 INT Top;
120 INT Width;
121 INT Height;
122 /* Proxy settings */
123 INT Proxy;
124 WCHAR szProxyServer[MAX_PATH];
125 WCHAR szNoProxyFor[MAX_PATH];
126
127 } SETTINGS_INFO, *PSETTINGS_INFO;
128
129 /* available.c */
130 typedef BOOL (CALLBACK *AVAILENUMPROC)(PAPPLICATION_INFO Info);
131 BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc);
132 BOOL ShowAvailableAppInfo(INT Index);
133 BOOL UpdateAppsDB(VOID);
134 VOID FreeCachedAvailableEntries(VOID);
135
136 /* installdlg.c */
137 BOOL InstallApplication(INT Index);
138
139 /* installed.c */
140 typedef BOOL (CALLBACK *APPENUMPROC)(INT ItemIndex, LPWSTR lpName, PINSTALLED_INFO Info);
141 BOOL EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc);
142 BOOL GetApplicationString(HKEY hKey, LPWSTR lpKeyName, LPWSTR lpString);
143 BOOL ShowInstalledAppInfo(INT Index);
144 BOOL UninstallApplication(INT Index, BOOL bModify);
145 BOOL IsInstalledApplication(LPWSTR lpRegName, BOOL IsUserKey);
146 VOID RemoveAppFromRegistry(INT Index);
147
148 /* winmain.c */
149 extern HWND hMainWnd;
150 extern HINSTANCE hInst;
151 extern INT SelectedEnumType;
152 extern SETTINGS_INFO SettingsInfo;
153 VOID SaveSettings(HWND hwnd);
154 VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo);
155
156 /* listview.c */
157 extern HWND hListView;
158 extern BOOL bAscending;
159 BOOL CreateListView(HWND hwnd);
160 BOOL ListViewAddColumn(INT Index, LPWSTR lpText, INT Width, INT Format);
161 INT ListViewAddItem(INT ItemIndex, INT IconIndex, LPWSTR lpText, LPARAM lParam);
162 INT CALLBACK ListViewCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
163 PVOID ListViewGetlParam(INT Index);
164
165 /* loaddlg.c */
166 BOOL DownloadApplication(INT Index);
167 VOID DownloadApplicationsDB(LPWSTR lpUrl);
168
169 /* misc.c */
170 INT GetSystemColorDepth(VOID);
171 int GetWindowWidth(HWND hwnd);
172 int GetWindowHeight(HWND hwnd);
173 int GetClientWindowWidth(HWND hwnd);
174 int GetClientWindowHeight(HWND hwnd);
175 VOID CopyTextToClipboard(LPCWSTR lpszText);
176 VOID SetWelcomeText(VOID);
177 VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem);
178 BOOL StartProcess(LPWSTR lpPath, BOOL Wait);
179 BOOL GetStorageDirectory(PWCHAR lpDirectory, DWORD cch);
180 BOOL ExtractFilesFromCab(LPWSTR lpCabName, LPWSTR lpOutputPath);
181 VOID InitLogs(VOID);
182 VOID FreeLogs(VOID);
183 BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPWSTR lpMsg);
184
185 UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPCWSTR lpFileName);
186 UINT ParserGetInt(LPCWSTR lpKeyName, LPCWSTR lpFileName);
187
188 /* richedit.c */
189 extern HWND hRichEdit;
190 extern PWSTR pLink;
191 BOOL CreateRichEdit(HWND hwnd);
192 VOID RichEditOnLink(HWND hwnd, ENLINK *Link);
193 VOID InsertRichEditText(LPCWSTR lpszText, DWORD dwEffects);
194 VOID NewRichEditText(LPCWSTR lpszText, DWORD dwEffects);
195
196 /* settingsdlg.c */
197 VOID CreateSettingsDlg(HWND hwnd);
198
199 /* splitter.c */
200 extern HWND hVSplitter;
201 extern HWND hHSplitter;
202 BOOL CreateVSplitBar(HWND hwnd);
203 BOOL CreateHSplitBar(HWND hwnd);
204 int GetHSplitterPos(VOID);
205 VOID SetHSplitterPos(int Pos);
206
207 /* statusbar.c */
208 extern HWND hStatusBar;
209 BOOL CreateStatusBar(HWND hwnd);
210 VOID SetStatusBarText(LPCWSTR lpszText);
211
212 /* toolbar.c */
213 extern HWND hToolBar;
214 extern HWND hSearchBar;
215 BOOL CreateToolBar(HWND hwnd);
216 VOID ToolBarOnGetDispInfo(LPTOOLTIPTEXT lpttt);
217
218 /* treeview.c */
219 extern HWND hTreeView;
220 BOOL CreateTreeView(HWND hwnd);
221 HTREEITEM TreeViewAddItem(HTREEITEM hParent, LPWSTR lpText, INT Image, INT SelectedImage, LPARAM lParam);
222
223 #endif /* _RAPPS_H */