1/*
2 * Copyright 2003-2005, Waldemar Kornewald <wkornew@gmx.net>
3 * Distributed under the terms of the MIT License.
4 */
5
6#ifndef _DIAL_UP_VIEW__H
7#define _DIAL_UP_VIEW__H
8
9#include <Message.h>
10#include <View.h>
11
12#include <PPPInterfaceListener.h>
13#include <PTPSettings.h>
14
15
16class DialUpView : public BView {
17	public:
18		DialUpView(BRect frame);
19		virtual ~DialUpView();
20
21		virtual void AttachedToWindow();
22		virtual void MessageReceived(BMessage *message);
23
24	private:
25		void BringUpOrDown();
26
27		void HandleReportMessage(BMessage *message);
28		void CreateTabs();
29
30		void UpdateStatus(int32 code);
31		void WatchInterface(ppp_interface_id ID);
32
33		void LoadInterfaces();
34
35		void AddInterface(const char *name, bool isNew = false);
36		void SelectInterface(int32 index, bool isNew = false);
37		int32 CountInterfaces() const;
38		BMenuItem *FindInterface(BString name);
39
40		void UpdateControls();
41		void UpdateDefaultInterface();
42
43	private:
44		PPPInterfaceListener fListener;
45		PTPSettings fSettings;
46
47		thread_id fUpDownThread;
48
49		BMenuItem *fCurrentItem, *fDeleterItem;
50
51		bool fKeepLabel;
52		BStringView *fStatusView;
53		BButton *fConnectButton, *fCreateNewButton;
54		BPopUpMenu *fInterfaceMenu;
55		BMenuField *fMenuField;
56		BCheckBox *fDefaultInterface;
57		BStringView *fStringView;
58			// shows "No interfaces found..." notice
59		BTabView *fTabView;
60};
61
62
63#endif
64