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