第三方框架改为仓内子集并完善构建忽略规则
完整 NIM_Duilib_Framework 仓库移至父目录,third_party 仅保留实际使用的 base、duilib、bin/resources 与许可证;.gitignore 覆盖 MSBuild 与打包产物。
This commit is contained in:
1 parent
249e8548de
commit
e1e26acc49
391 files changed
+342850
No files matched your search
@@ -0,0 +1,82 @@
|
||||
#pragma once
|
||||
|
||||
#include "download_engine.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class DownloaderForm : public ui::WindowImplBase
|
||||
{
|
||||
public:
|
||||
DownloaderForm();
|
||||
~DownloaderForm();
|
||||
|
||||
virtual std::wstring GetSkinFolder() override;
|
||||
virtual std::wstring GetSkinFile() override;
|
||||
virtual std::wstring GetWindowClassName() const override;
|
||||
|
||||
virtual void InitWindow() override;
|
||||
virtual LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
|
||||
virtual LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) override;
|
||||
virtual LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) override;
|
||||
virtual LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) override;
|
||||
|
||||
bool OnClicked(ui::EventArgs* args);
|
||||
bool OnReturn(ui::EventArgs* args);
|
||||
bool OnListItemSelect(ui::EventArgs* args);
|
||||
bool OnListItemDoubleClick(ui::EventArgs* args);
|
||||
|
||||
static const std::wstring kClassName;
|
||||
static constexpr UINT kTrayIconMessage = WM_APP + 1;
|
||||
static constexpr UINT kShowMainWindowMessage = WM_APP + 2;
|
||||
|
||||
private:
|
||||
struct TaskRow
|
||||
{
|
||||
TaskInfo info;
|
||||
ui::ListContainerElement* item = nullptr;
|
||||
ui::Label* name = nullptr;
|
||||
ui::Label* status = nullptr;
|
||||
ui::Progress* progress = nullptr;
|
||||
ui::Label* speed = nullptr;
|
||||
};
|
||||
|
||||
void AddTask(const std::wstring& url);
|
||||
void PauseSelectedTask();
|
||||
void StartSelectedTask();
|
||||
void DeleteSelectedTask();
|
||||
void HandleEngineEvent(const EngineEvent& event);
|
||||
|
||||
void PrepareFileDrag(LPARAM lParam);
|
||||
int HitTestRow(const POINT& pt) const;
|
||||
void ShowTaskMenu(LPARAM lParam);
|
||||
void OpenSelectedLocation();
|
||||
|
||||
TaskRow CreateTaskRow(const TaskInfo& task);
|
||||
void UpdateRow(int index, double speed);
|
||||
void RemoveRow(int index);
|
||||
int FindRowIndex(int64_t id) const;
|
||||
|
||||
void UpdateSummary(const std::wstring& tip = std::wstring());
|
||||
void UpdateSelectedInfo();
|
||||
|
||||
void AddTrayIcon();
|
||||
void RemoveTrayIcon();
|
||||
void ShowTrayMenu();
|
||||
|
||||
NOTIFYICONDATAW tray_icon_ = {};
|
||||
UINT taskbar_created_message_ = 0;
|
||||
|
||||
ui::RichEdit* edit_url_ = nullptr;
|
||||
ui::RichEdit* edit_path_ = nullptr;
|
||||
ui::ListBox* task_list_ = nullptr;
|
||||
ui::Label* lbl_summary_ = nullptr;
|
||||
ui::Label* lbl_selected_ = nullptr;
|
||||
|
||||
std::vector<TaskRow> rows_;
|
||||
std::unique_ptr<DownloadEngine> engine_;
|
||||
|
||||
bool ole_initialized_ = false;
|
||||
bool drag_pending_ = false;
|
||||
POINT drag_origin_ = {};
|
||||
std::wstring drag_path_;
|
||||
};
|
||||
Reference in new issue
Block a user