reactos/base/applications/rapps/include/gui.h

147 lines
3.2 KiB
C
Raw Normal View History

#pragma once
#include "rapps.h"
#include "rosui.h"
#include "crichedit.h"
#include "asyncinet.h"
#include "appview.h"
#include <shlobj_undoc.h>
#include <shlguid_undoc.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atltypes.h>
#include <atlwin.h>
#include <wininet.h>
#include <shellutils.h>
#include <ui/rosctrls.h>
#include <gdiplus.h>
#include <math.h>
#define SEARCH_TIMER_ID 'SR'
#define TREEVIEW_ICON_SIZE 24
class CSideTreeView : public CUiWindow<CTreeView>
{
HIMAGELIST hImageTreeView;
public:
CSideTreeView();
HTREEITEM
AddItem(HTREEITEM hParent, CStringW &Text, INT Image, INT SelectedImage, LPARAM lParam);
HTREEITEM
AddCategory(HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex);
HIMAGELIST
SetImageList();
VOID
DestroyImageList();
~CSideTreeView();
};
class CMainWindow : public CWindowImpl<CMainWindow, CWindow, CFrameWinTraits>
{
CUiPanel *m_ClientPanel = NULL;
CUiSplitPanel *m_VSplitter = NULL;
CSideTreeView *m_TreeView = NULL;
CUiWindow<CStatusBar> *m_StatusBar = NULL;
CApplicationView *m_ApplicationView = NULL;
[0.4.15][RAPPS] Backport current RAPPS into 0.4.15 This is a squashed backport of RAPPS from current master into the 0.4.15 release tree. All of these changes were deemed stable and complete. This backport includes the following commits: 5bc6d5914288283606c339534c65ceb81af663e5 [RAPPS] Refresh item info after installer completes (#7697) d5ce3d28abb48c0a1e0b40f7c6802154433c9ac2 [RAPPS] Don't display Freeware license string if the type is also Freeware (#7689) b35becef2eb507c90d5b6d4a8c66a2647445cde1 [RAPPS] Set working directory for zip generated shortcuts (#7674) a23db39c8a422b40c3deab643996aac6e775217d [RAPPS] Allow database to override download filename (#7668) c8b2c4c94d7830ffd924133dfa548e3fea7169b9 [RAPPS] Check Let's Encrypt issuer prefix (#7650) 72951421e6780b85ac1254f7561425ef3b6eb5a9 [RAPPS] Reuse active pending downloads window (#7648) 91b8923601ff4ef4cf47c4fd0b004de1f1db3aa2 [RAPPS] Allow .zip generated installers to skip writing the DisplayIcon value (#7609) 2834e5b3c8435512b54df952e4e3cbf291af86df [RAPPS] Initialize SHBrowseForFolder to current download folder (#7505) 9164e9f85fcd20f4a81cd6de04d1d53aec01cf9d [RAPPS] Update Slovak (sk-SK) translation (#7450) 873488927202bed66a91fa975dc02cdc20c64afb [RAPPS] Update Turkish (tr-TR) translation (#7372) 16f1abe1c872b775ffcba647ed4f4d7335b73f70 [RAPPS] Improve Romanian (ro-RO) translation (#7360) 2f83e6a65d5878f2ca0f56bf610eed0da295d9da [RAPPS] Use different mutex and title for AppWiz mode (#7350) 301675c112f65de2ae1f1cc0a1378ecb90df9613 [RAPPS] Respect partial settings configuration (#7247) 053939e27cbf4d6475fb33b6fc16199bd944880d [RAPPS] Hide the main window during active download/install if the user closes it (#7014) 3ff8adc5537f5b0555708d6f72b635744adcf3ca [RAPPS] Protect database update with a mutex (#7006) 4e598589410e30707b6a69000ed4ebed857237b3 [RAPPS] Change the "Welcome" text with a suitable explanatory one in APPWIZ-mode (#6655) 2af6fd4defce9b7766c56bf565af5f675f6d2f79 [PSDK] Add GetMenuPosFromID() declaration in shlwapi.h
2025-02-17 20:01:35 -07:00
friend class CApplicationView;
CAppDB *m_Db;
CAtlList<CAppInfo *> m_Selected;
BOOL bUpdating = FALSE;
[0.4.15][RAPPS] Backport current RAPPS into 0.4.15 This is a squashed backport of RAPPS from current master into the 0.4.15 release tree. All of these changes were deemed stable and complete. This backport includes the following commits: 5bc6d5914288283606c339534c65ceb81af663e5 [RAPPS] Refresh item info after installer completes (#7697) d5ce3d28abb48c0a1e0b40f7c6802154433c9ac2 [RAPPS] Don't display Freeware license string if the type is also Freeware (#7689) b35becef2eb507c90d5b6d4a8c66a2647445cde1 [RAPPS] Set working directory for zip generated shortcuts (#7674) a23db39c8a422b40c3deab643996aac6e775217d [RAPPS] Allow database to override download filename (#7668) c8b2c4c94d7830ffd924133dfa548e3fea7169b9 [RAPPS] Check Let's Encrypt issuer prefix (#7650) 72951421e6780b85ac1254f7561425ef3b6eb5a9 [RAPPS] Reuse active pending downloads window (#7648) 91b8923601ff4ef4cf47c4fd0b004de1f1db3aa2 [RAPPS] Allow .zip generated installers to skip writing the DisplayIcon value (#7609) 2834e5b3c8435512b54df952e4e3cbf291af86df [RAPPS] Initialize SHBrowseForFolder to current download folder (#7505) 9164e9f85fcd20f4a81cd6de04d1d53aec01cf9d [RAPPS] Update Slovak (sk-SK) translation (#7450) 873488927202bed66a91fa975dc02cdc20c64afb [RAPPS] Update Turkish (tr-TR) translation (#7372) 16f1abe1c872b775ffcba647ed4f4d7335b73f70 [RAPPS] Improve Romanian (ro-RO) translation (#7360) 2f83e6a65d5878f2ca0f56bf610eed0da295d9da [RAPPS] Use different mutex and title for AppWiz mode (#7350) 301675c112f65de2ae1f1cc0a1378ecb90df9613 [RAPPS] Respect partial settings configuration (#7247) 053939e27cbf4d6475fb33b6fc16199bd944880d [RAPPS] Hide the main window during active download/install if the user closes it (#7014) 3ff8adc5537f5b0555708d6f72b635744adcf3ca [RAPPS] Protect database update with a mutex (#7006) 4e598589410e30707b6a69000ed4ebed857237b3 [RAPPS] Change the "Welcome" text with a suitable explanatory one in APPWIZ-mode (#6655) 2af6fd4defce9b7766c56bf565af5f675f6d2f79 [PSDK] Add GetMenuPosFromID() declaration in shlwapi.h
2025-02-17 20:01:35 -07:00
BOOL m_bAppwizMode;
HTREEITEM hRootItemInstalled;
CStringW szSearchPattern;
AppsCategories SelectedEnumType;
public:
[0.4.15][RAPPS] Backport current RAPPS into 0.4.15 This is a squashed backport of RAPPS from current master into the 0.4.15 release tree. All of these changes were deemed stable and complete. This backport includes the following commits: 5bc6d5914288283606c339534c65ceb81af663e5 [RAPPS] Refresh item info after installer completes (#7697) d5ce3d28abb48c0a1e0b40f7c6802154433c9ac2 [RAPPS] Don't display Freeware license string if the type is also Freeware (#7689) b35becef2eb507c90d5b6d4a8c66a2647445cde1 [RAPPS] Set working directory for zip generated shortcuts (#7674) a23db39c8a422b40c3deab643996aac6e775217d [RAPPS] Allow database to override download filename (#7668) c8b2c4c94d7830ffd924133dfa548e3fea7169b9 [RAPPS] Check Let's Encrypt issuer prefix (#7650) 72951421e6780b85ac1254f7561425ef3b6eb5a9 [RAPPS] Reuse active pending downloads window (#7648) 91b8923601ff4ef4cf47c4fd0b004de1f1db3aa2 [RAPPS] Allow .zip generated installers to skip writing the DisplayIcon value (#7609) 2834e5b3c8435512b54df952e4e3cbf291af86df [RAPPS] Initialize SHBrowseForFolder to current download folder (#7505) 9164e9f85fcd20f4a81cd6de04d1d53aec01cf9d [RAPPS] Update Slovak (sk-SK) translation (#7450) 873488927202bed66a91fa975dc02cdc20c64afb [RAPPS] Update Turkish (tr-TR) translation (#7372) 16f1abe1c872b775ffcba647ed4f4d7335b73f70 [RAPPS] Improve Romanian (ro-RO) translation (#7360) 2f83e6a65d5878f2ca0f56bf610eed0da295d9da [RAPPS] Use different mutex and title for AppWiz mode (#7350) 301675c112f65de2ae1f1cc0a1378ecb90df9613 [RAPPS] Respect partial settings configuration (#7247) 053939e27cbf4d6475fb33b6fc16199bd944880d [RAPPS] Hide the main window during active download/install if the user closes it (#7014) 3ff8adc5537f5b0555708d6f72b635744adcf3ca [RAPPS] Protect database update with a mutex (#7006) 4e598589410e30707b6a69000ed4ebed857237b3 [RAPPS] Change the "Welcome" text with a suitable explanatory one in APPWIZ-mode (#6655) 2af6fd4defce9b7766c56bf565af5f675f6d2f79 [PSDK] Add GetMenuPosFromID() declaration in shlwapi.h
2025-02-17 20:01:35 -07:00
static HWND m_hLastFocus;
static bool m_PendingInstalledViewRefresh;
explicit CMainWindow(CAppDB *db, BOOL bAppwiz = FALSE);
~CMainWindow();
private:
VOID
InitCategoriesList();
BOOL
CreateStatusBar();
BOOL
CreateTreeView();
BOOL
CreateApplicationView();
BOOL
CreateVSplitter();
BOOL
CreateLayout();
VOID
LayoutCleanup();
BOOL
InitControls();
VOID
OnSize(HWND hwnd, WPARAM wParam, LPARAM lParam);
VOID
CheckAvailable();
BOOL
RemoveSelectedAppFromRegistry();
BOOL
UninstallSelectedApp(BOOL bModify);
BOOL
ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId);
VOID
ShowAboutDlg();
VOID
OnCommand(WPARAM wParam, LPARAM lParam);
VOID
UpdateStatusBarText();
VOID
UpdateApplicationsList(AppsCategories EnumType, BOOL bReload = FALSE, BOOL bCheckAvailable = FALSE);
VOID
AddApplicationsToView(CAtlList<CAppInfo *> &List);
public:
static ATL::CWndClassInfo &
GetWndClassInfo();
HWND
Create();
// this function is called when a item of application-view is checked/unchecked
// CallbackParam is the param passed to application-view when adding the item (the one getting focus now).
VOID
ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam);
// this function is called when application-view is asked to install an application
// if Info is not zero, this app should be installed. otherwise those checked apps should be installed
BOOL
InstallApplication(CAppInfo *Info);
// this function is called when search text is changed
BOOL
SearchTextChanged(CStringW &SearchText);
void
HandleTabOrder(int direction);
};
// Main window
VOID
MainWindowLoop(CMainWindow *wnd, INT nShowCmd);