source: trunk/src/NewTorrentPeersLV.hpp @ 508

Revision 508, 2.2 KB checked in by Eoin, 13 years ago (diff)

Major SortList? de-blobbing.

Line 
1
2//         Copyright Eóin O'Callaghan 2006 - 2007.
3// Distributed under the Boost Software License, Version 1.0.
4//    (See accompanying file LICENSE_1_0.txt or copy at
5//          http://www.boost.org/LICENSE_1_0.txt)
6
7#pragma once
8
9#define ID_NTPLVM_BEGIN         19000
10#define ID_NTPLVM_NEW           ID_NTPLVM_BEGIN + 1
11#define ID_NTPLVM_EDIT          ID_NTPLVM_BEGIN + 2
12#define ID_NTPLVM_DELETE        ID_NTPLVM_BEGIN + 3
13#define HAL_NTPLVM_NAMES        ID_NTPLVM_BEGIN + 4
14
15#ifndef RC_INVOKED
16
17#include <boost/signals.hpp>
18#include <boost/function.hpp>
19
20#include "stdAfx.hpp"
21#include "global/string_conv.hpp"
22#include "halIni.hpp"
23#include "HaliteSortListViewCtrl.hpp"
24
25#include "GenericAddListView.hpp"
26
27class NewTorrent_PeersListViewCtrl :
28        public CHaliteSortListViewCtrl<NewTorrent_PeersListViewCtrl>,
29        public hal::IniBase<NewTorrent_PeersListViewCtrl>,
30        public WTLx::GenericAddListView<NewTorrent_PeersListViewCtrl, true>,
31        private boost::noncopyable
32{
33        typedef NewTorrent_PeersListViewCtrl thisClass;
34        typedef hal::IniBase<thisClass> iniClass;
35        typedef CHaliteSortListViewCtrl<thisClass> listClass;
36        typedef WTLx::GenericAddListView<thisClass, true> genericAddlistClass;
37
38        friend class listClass;
39       
40public:
41        enum { 
42                LISTVIEW_ID_MENU = HAL_GENERIC_ADD_LV_MENU,
43                LISTVIEW_ID_COLUMNNAMES = HAL_NTPLVM_NAMES,
44                LISTVIEW_ID_COLUMNWIDTHS = HAL_TRACKER_LISTVIEW_DEFAULTS
45        };
46       
47        NewTorrent_PeersListViewCtrl() :
48                iniClass("listviews/NewTorrentPeers", "NewPeersListView")
49        {}
50
51        BEGIN_MSG_MAP_EX(thisClass)
52                MSG_WM_DESTROY(OnDestroy)
53
54                CHAIN_MSG_MAP(genericAddlistClass)
55                CHAIN_MSG_MAP(listClass)
56                DEFAULT_REFLECTION_HANDLER()
57        END_MSG_MAP()
58
59        void uiUpdate(const hal::torrent_details_ptr pT);
60        void saveSettings();
61
62    friend class boost::serialization::access;
63    template<class Archive>
64    void serialize(Archive& ar, const unsigned int version)
65    {
66                ar & boost::serialization::make_nvp("listview", boost::serialization::base_object<listClass>(*this));
67    }
68
69        void newItem();
70        void editItem(int);
71        void deleteItem(int);
72
73private:
74        void OnAttach();
75        void OnDestroy();
76};
77
78typedef NewTorrent_PeersListViewCtrl::SelectionManager NewTorrent_PeersListViewManager;
79
80#endif // RC_INVOKED
Note: See TracBrowser for help on using the repository browser.