BPicture: Fix archive constructor.
[haiku.git] / src / apps / devices / DevicesView.h
blob167c763708e268e714648b4303385d9581b276b6
1 /*
2 * Copyright 2008-2009 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
5 * Authors:
6 * Pieter Panman
7 */
8 #ifndef DEVICESVIEW_H
9 #define DEVICESVIEW_H
12 #include <MenuField.h>
13 #include <MenuItem.h>
14 #include <OutlineListView.h>
15 #include <PopUpMenu.h>
16 #include <TabView.h>
17 #include <View.h>
19 #include <map>
21 #include "Device.h"
22 #include "DevicePCI.h"
23 #include "DeviceACPI.h"
24 #include "DeviceSCSI.h"
25 #include "PropertyList.h"
26 #include "PropertyListPlain.h"
28 static const uint32 kMsgRefresh = 'refr';
29 static const uint32 kMsgReportCompatibility = 'repo';
30 static const uint32 kMsgGenerateSysInfo = 'sysi';
31 static const uint32 kMsgSelectionChanged = 'selc';
32 static const uint32 kMsgOrderCategory = 'ocat';
33 static const uint32 kMsgOrderConnection = 'ocon';
35 typedef enum {
36 ORDER_BY_CONNECTION,
37 ORDER_BY_CATEGORY
38 } OrderByType;
40 typedef std::map<Category, Device*> CategoryMap;
41 typedef std::map<Category, Device*>::const_iterator CategoryMapIterator;
43 typedef std::vector<Device*> Devices;
46 class DevicesView : public BView {
47 public:
48 DevicesView();
49 ~DevicesView();
51 virtual void CreateLayout();
53 virtual void MessageReceived(BMessage* msg);
54 virtual void RescanDevices();
55 virtual void CreateCategoryMap();
56 virtual void DeleteCategoryMap();
58 virtual void DeleteDevices();
59 virtual void RebuildDevicesOutline();
60 virtual void AddChildrenToOutlineByConnection(Device* parent);
61 virtual void AddDeviceAndChildren(device_node_cookie* node,
62 Device* parent);
63 static int SortItemsCompare(const BListItem*, const BListItem*);
65 private:
66 BOutlineListView* fDevicesOutline;
67 PropertyListPlain* fBasicView;
68 PropertyListPlain* fBusView;
69 PropertyList* fAttributesView;
70 BMenuField* fOrderByMenu;
71 BTabView* fTabView;
72 Devices fDevices;
73 OrderByType fOrderBy;
74 CategoryMap fCategoryMap;
75 BTab* fBasicTab;
76 BTab* fDeviceTypeTab;
77 BTab* fDetailedTab;
81 #endif /* DEVICESVIEW_H */