forked from irwir/eMule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSearchResultsWnd.h
159 lines (133 loc) · 5.1 KB
/
SearchResultsWnd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
//this file is part of eMule
//Copyright (C)2002-2008 Merkur ( strEmail.Format("%s@%s", "devteam", "emule-project.net") / http://www.emule-project.net )
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either
//version 2 of the License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#pragma once
#include "ResizableLib\ResizableFormView.h"
#include "SearchListCtrl.h"
#include "ClosableTabCtrl.h"
#include "IconStatic.h"
#include "EditX.h"
#include "EditDelayed.h"
#include "ComboBoxEx2.h"
#include "ListCtrlEditable.h"
class CCustomAutoComplete;
class Packet;
class CSafeMemFile;
class CSearchParamsWnd;
struct SSearchParams;
class CDropDownButton;
class CButtonsTabCtrl;
///////////////////////////////////////////////////////////////////////////////
// CSearchResultsSelector
class CSearchResultsSelector : public CClosableTabCtrl
{
public:
CSearchResultsSelector(){}
protected:
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
};
///////////////////////////////////////////////////////////////////////////////
// CSearchResultsWnd dialog
class CSearchResultsWnd : public CResizableFormView
{
DECLARE_DYNCREATE(CSearchResultsWnd)
public:
CSearchResultsWnd(CWnd* pParent = NULL); // standard constructor
virtual ~CSearchResultsWnd();
enum { IDD = IDD_SEARCH };
CSearchListCtrl searchlistctrl;
CSearchResultsSelector searchselect;
CSearchParamsWnd* m_pwndParams;
CStringArray m_astrFilter;
void Localize();
void StartSearch(SSearchParams* pParams);
bool SearchMore();
void CancelSearch(UINT uSearchID = 0);
bool DoNewEd2kSearch(SSearchParams* pParams);
void CancelEd2kSearch();
bool IsLocalEd2kSearchRunning() const { return (m_uTimerLocalServer != 0); }
bool IsGlobalEd2kSearchRunning() const { return (global_search_timer != 0); }
void LocalEd2kSearchEnd(UINT count, bool bMoreResultsAvailable);
void AddGlobalEd2kSearchResults(UINT count);
void SetNextSearchID(uint32 uNextID) {m_nEd2kSearchID = uNextID;}
bool DoNewKadSearch(SSearchParams* pParams);
void CancelKadSearch(UINT uSearchID);
bool CanSearchRelatedFiles() const;
void SearchRelatedFiles(CPtrList& listFiles);
void DownloadSelected();
void DownloadSelected(bool bPaused);
bool CanDeleteSearch(uint32 nSearchID) const;
bool CanDeleteAllSearches() const;
void DeleteSearch(uint32 nSearchID);
void DeleteAllSearches();
void DeleteSelectedSearch();
bool CreateNewTab(SSearchParams* pParams, bool bActiveIcon = true);
void ShowSearchSelector(bool visible);
int GetSelectedCat();
void UpdateCatTabs();
SSearchParams* GetSearchResultsParams(UINT uSearchID) const;
uint32 GetFilterColumn() const { return m_nFilterColumn; }
protected:
Packet* searchpacket;
bool m_b64BitSearchPacket;
UINT_PTR global_search_timer;
UINT m_uTimerLocalServer;
CProgressCtrl searchprogress;
CHeaderCtrl m_ctlSearchListHeader;
CEditDelayed m_ctlFilter;
CButton m_ctlOpenParamsWnd;
bool canceld;
uint16 servercount;
bool globsearch;
uint32 m_nEd2kSearchID;
CImageList m_imlSearchResults;
CButtonsTabCtrl *m_cattabs;
CDropDownButton* m_btnSearchListMenu;
int m_iSentMoreReq;
uint32 m_nFilterColumn;
bool StartNewSearch(SSearchParams* pParams);
void SearchStarted();
void SearchCanceled(UINT uSearchID);
CString CreateWebQuery(SSearchParams* pParams);
void ShowResults(const SSearchParams* pParams);
void SetAllIcons();
void SetSearchResultsIcon(UINT uSearchID, int iImage);
void SetActiveSearchResultsIcon(UINT uSearchID);
void SetInactiveSearchResultsIcon(UINT uSearchID);
virtual void OnInitialUpdate();
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
afx_msg void OnDblClkSearchList(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnSelChangeTab(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg LRESULT OnCloseTab(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnDblClickTab(WPARAM wParam, LPARAM lParam);
afx_msg void OnDestroy();
afx_msg void OnSysColorChange();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnBnClickedDownloadSelected();
afx_msg void OnBnClickedClearAll();
afx_msg void OnClose();
afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
afx_msg LRESULT OnIdleUpdateCmdUI(WPARAM wParam, LPARAM lParam);
afx_msg void OnBnClickedOpenParamsWnd();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg LRESULT OnChangeFilter(WPARAM wParam, LPARAM lParam);
afx_msg void OnSearchListMenuBtnDropDown(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
};