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