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