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