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