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