I2P

Invisible Internet Project


root/src/kadNodesListView.h @ f795f01a025d61deff07e2f90673085b2effa456

Revision f795f01a025d61deff07e2f90673085b2effa456, 1.3 KB (checked in by mkvore-commit@…, 13 months ago)

compiles up to PrefsUnifiedDlg?.cpp

Line 
1//
2// C++ Interface: kadNodesListView
3//
4// Description: list of kad contacts in the routing zone
5//
6//
7// Author: MKVore <mkvore@mail.i2p>, (C) 2008
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12
13#ifndef _KAD_NODES_LIST_VIEW_H_
14#define _KAD_NODES_LIST_VIEW_H_
15
16#include <wx/wx.h>
17#include <wx/listctrl.h>
18#include "GuiEvents.h"
19#include <vector>
20#include <map>
21
22namespace Kademlia
23{
24class CContact ;
25class CUInt128 ;
26}
27
28class KadNodesListView : public wxListView
29{
30public:
31        KadNodesListView(wxWindow* parent, wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxListCtrlNameStr);
32
33        void AddNode       ( Kademlia::CContact * contact  );
34        void DeleteNode    ( Kademlia::CContact * contact  );
35        void OnColumnLClick( wxListEvent & event );
36
37protected:
38        virtual wxString OnGetItemText(long item, long column) const;
39        virtual wxListItemAttr * OnGetItemAttr(long item) const;
40private :
41        void SortItems();
42        std::map<Kademlia::CUInt128, long> _contacts_map;
43        std::vector<Kademlia::CContact> _contacts_list ;
44        std::vector<Kademlia::CContact> _sorted_contacts_list ;
45
46        DECLARE_EVENT_TABLE()
47};
48#endif
Note: See TracBrowser for help on using the browser.