Fix crash with wxWidgets 2.9
[amule.git] / src / SharedFilesWnd.h
bloba2743d84eca59c9c2cc85b5b818dc87222ddb639
1 //
2 // This file is part of the aMule Project.
3 //
4 // Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2002-2008 Merkur ( devs@emule-project.net / http://www.emule-project.net )
6 //
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
9 // respective authors.
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.
20 //
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
26 #ifndef SHAREDFILESWND_H
27 #define SHAREDFILESWND_H
29 #include <wx/panel.h> // Needed for wxPanel
32 class CKnownFile;
33 class CSharedFilesCtrl;
34 class CSharedFilePeersListCtrl;
35 class wxListEvent;
36 class wxGauge;
37 class wxSplitterEvent;
39 /**
40 * This class represents the window containing the list of shared files.
42 class CSharedFilesWnd : public wxPanel
44 public:
45 /**
46 * Constructor.
48 CSharedFilesWnd(wxWindow* pParent = NULL);
50 /**
51 * Destructor.
53 ~CSharedFilesWnd();
56 /**
57 * This function updates the statistics of the selected items.
59 * Call this function when an item has been selected, or when a
60 * selected item changes. It
62 void SelectionUpdated();
65 /**
66 * Deletes all files and updates widget
68 void RemoveAllSharedFiles();
70 /**
71 * Call this function before displaying the dialog.
73 * This functions does a few tasks to ensure that the dialog is looking the right way.
75 void Prepare();
77 //! Pointer to the widget containing the list of shared files.
78 CSharedFilesCtrl* sharedfilesctrl;
80 //! Pointer to the list of clients.
81 CSharedFilePeersListCtrl* peerslistctrl;
83 //! Contains the current (or last if the clientlist is hidden) position of the splitter.
84 int m_splitter;
85 private:
86 /**
87 * Event-handler for reloading the list of shared files.
88 */
89 void OnBtnReloadShared(wxCommandEvent &evt);
91 /**
92 * Event-handler for showing details about a shared file(s).
94 void OnItemSelectionChanged(wxListEvent& evt);
96 /**
97 * Event-handler for the list-toggle button.
99 void OnToggleClientList( wxCommandEvent& event );
102 * Event-handler for for changes in the sash divider position.
104 void OnSashPositionChanging(wxSplitterEvent& evt);
106 //! Pointer to the gauge used for showing requests ratio.
107 wxGauge* m_bar_requests;
108 //! Pointer to the gauge used for showing accepted-requests ratio.
109 wxGauge* m_bar_accepted;
110 //! Pointer to the gauge used for showing the transferred ratio.
111 wxGauge* m_bar_transfer;
112 //! Pointer to the gauge used for showing the transferred ratio.
113 bool m_prepared;
116 DECLARE_EVENT_TABLE()
119 #endif
120 // File_checked_for_headers