BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / networkstatus / NetworkStatusView.h
blobde165331f9d148ca49e20d1b68b858c513594b7b
1 /*
2 * Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Axel Dörfler, axeld@pinc-software.de
7 * Dario Casalinuovo
8 */
9 #ifndef NETWORK_STATUS_VIEW_H
10 #define NETWORK_STATUS_VIEW_H
13 #include <Notification.h>
14 #include <ObjectList.h>
15 #include <View.h>
17 #include <map>
20 class BMessageRunner;
21 class BNetworkInterface;
24 enum {
25 kStatusUnknown = 0,
26 kStatusNoLink,
27 kStatusLinkNoConfig,
28 kStatusConnecting,
29 kStatusReady,
31 kStatusCount
35 class NetworkStatusView : public BView {
36 public:
37 NetworkStatusView(BRect frame, int32 resizingMode,
38 bool inDeskbar = false);
39 NetworkStatusView(BMessage* archive);
40 virtual ~NetworkStatusView();
42 static NetworkStatusView* Instantiate(BMessage* archive);
43 virtual status_t Archive(BMessage* archive, bool deep = true) const;
45 virtual void AttachedToWindow();
46 virtual void DetachedFromWindow();
48 virtual void MessageReceived(BMessage* message);
49 virtual void FrameResized(float width, float height);
50 virtual void MouseDown(BPoint where);
51 virtual void Draw(BRect updateRect);
53 private:
54 void _AboutRequested();
55 void _Quit();
56 void _Init();
57 void _UpdateBitmaps();
58 void _ShowConfiguration(BMessage* message);
59 int32 _DetermineInterfaceStatus(
60 const BNetworkInterface& interface);
61 void _Update(bool force = false);
62 void _OpenNetworksPreferences();
64 std::map<BString, int32>
65 fInterfaceStatuses;
66 bool fInDeskbar;
67 BBitmap* fTrayIcons[kStatusCount];
68 BBitmap* fNotifyIcons[kStatusCount];
71 #endif // NETWORK_STATUS_VIEW_H