2 // This file is part of the aMule Project.
4 // Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2002 Merkur ( devs@emule-project.net / http://www.emule-project.net )
7 // Any parts of this program derived from the xMule, lMule or eMule project,
8 // or contributed by third-party developers are copyrighted by their
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include <wx/panel.h> // Needed for wxPanel
30 #include <wx/notebook.h> // needed for wxBookCtrlEvent in wx 2.8
31 #include "Types.h" // Needed for uint32
32 #include "OtherStructs.h"
34 class CSourceListCtrl
;
35 class CDownloadListCtrl
;
38 class wxSplitterEvent
;
45 * This class takes care of managing the lists and other controls contained
46 * in the transfer-window. It's primary function is to manage the user-defined
49 class CTransferWnd
: public wxPanel
55 CTransferWnd(wxWindow
* pParent
= NULL
);
64 * Adds the specified category to the end of the list.
66 * @param category A pointer to the new category.
68 * This function should be called after a category has been
69 * added to the lists of categories. The new category is assumed
70 * to be the last, and thus will be appended to the end of the tabs
71 * on the category-notebook.
73 void AddCategory( Category_Struct
* category
);
76 * Updates the title of the specified category.
78 * @param index The index of the category on the notebook. -1 will update all categories.
80 void UpdateCategory(int index
);
85 void RemoveCategory(int index
);
86 void RemoveCategoryPage(int index
);
89 * This functions updates the displayed client-numbers*
91 * @param number The number of clients on the upload queue.
93 * This function updates both the number of clients on the queue,
94 * as well as the number of banned clients.
96 void ShowQueueCount(uint32 number
);
99 * Helper-function which updates the displayed titles of all existing categories.
101 void UpdateCatTabTitles() { UpdateCategory(-1); }
105 * Call this function before displaying the dialog.
107 * This functions does a few tasks to ensure that the dialog is looking the right way.
111 //! Pointer to the download-queue.
112 CDownloadListCtrl
* downloadlistctrl
;
113 //! Pointer to the list of clients.
114 CSourceListCtrl
* clientlistctrl
;
117 //! Contains the current (or last if the clientlist is hidden) position of the splitter.
119 //! Minimum position of splitter bar
120 static const int s_splitterMin
= 90;
123 * Event-handler for the set status by category menu-item.
125 void OnSetCatStatus( wxCommandEvent
& event
);
128 * Event-handler for the set priority by category menu-item.
130 void OnSetCatPriority( wxCommandEvent
& event
);
133 * Event-handler for the "Add Category" menu-item.
135 void OnAddCategory( wxCommandEvent
& event
);
138 * Event-handler for the "Delete Category" menu-item.
140 void OnDelCategory( wxCommandEvent
& event
);
143 * Event-handler for the "Edit Category" menu-item.
145 void OnEditCategory( wxCommandEvent
& event
);
148 * Event-handler for manipulating the default category.
150 void OnSetDefaultCat( wxCommandEvent
& event
);
153 * Event-handler for the "Clear Completed" button.
155 void OnBtnClearDownloads(wxCommandEvent
&evt
);
158 * Event-handler for changing categories.
160 void OnCategoryChanged(wxBookCtrlEvent
& evt
);
163 * Event-handler for displaying the category-popup menu.
165 void OnNMRclickDLtab(wxMouseEvent
& evt
);
168 * Event-handler for the list-toggle button.
170 void OnToggleClientList( wxCommandEvent
& event
);
173 * Event-handler for changes in the sash divider position.
175 void OnSashPositionChanging(wxSplitterEvent
& evt
);
178 //! Variable used to ensure that the category menu doesn't get displayed twice.
181 //! Pointer to the category tabs.
182 CMuleNotebook
* m_dlTab
;
185 DECLARE_EVENT_TABLE()
190 // File_checked_for_headers