3
* VBox frontends: Qt4 GUI ("VirtualBox"):
4
* VBoxGLSettingsNetwork class declaration
8
* Copyright (C) 2009 Oracle Corporation
10
* This file is part of VirtualBox Open Source Edition (OSE), as
11
* available from http://www.virtualbox.org. This file is free software;
12
* you can redistribute it and/or modify it under the terms of the GNU
13
* General Public License (GPL) as published by the Free Software
14
* Foundation, in version 2 as it comes in the "COPYING" file of the
15
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
19
#ifndef __VBoxGLSettingsNetwork_h__
20
#define __VBoxGLSettingsNetwork_h__
22
#include "VBoxSettingsPage.h"
23
#include "VBoxGLSettingsNetwork.gen.h"
25
class NetworkItem : public QTreeWidgetItem
31
void getFromInterface (const CHostNetworkInterface &aInterface);
32
void putBackToInterface();
34
bool revalidate (QString &aWarning, QString &aTitle);
39
bool isChanged() const { return mChanged; }
42
void setChanged (bool aChanged) { mChanged = aChanged; }
45
QString name() const { return mName; }
46
bool isDhcpClientEnabled() const { return mDhcpClientEnabled; }
47
QString interfaceAddress() const { return mInterfaceAddress; }
48
QString interfaceMask() const { return mInterfaceMask; }
49
bool isIpv6Supported() const { return mIpv6Supported; }
50
QString interfaceAddress6() const { return mInterfaceAddress6; }
51
QString interfaceMaskLength6() const { return mInterfaceMaskLength6; }
53
bool isDhcpServerEnabled() const { return mDhcpServerEnabled; }
54
QString dhcpServerAddress() const { return mDhcpServerAddress; }
55
QString dhcpServerMask() const { return mDhcpServerMask; }
56
QString dhcpLowerAddress() const { return mDhcpLowerAddress; }
57
QString dhcpUpperAddress() const { return mDhcpUpperAddress; }
60
void setDhcpClientEnabled (bool aEnabled) { mDhcpClientEnabled = aEnabled; }
61
void setInterfaceAddress (const QString &aValue) { mInterfaceAddress = aValue; }
62
void setInterfaceMask (const QString &aValue) { mInterfaceMask = aValue; }
63
void setIp6Supported (bool aSupported) { mIpv6Supported = aSupported; }
64
void setInterfaceAddress6 (const QString &aValue) { mInterfaceAddress6 = aValue; }
65
void setInterfaceMaskLength6 (const QString &aValue) { mInterfaceMaskLength6 = aValue; }
67
void setDhcpServerEnabled (bool aEnabled) { mDhcpServerEnabled = aEnabled; }
68
void setDhcpServerAddress (const QString &aValue) { mDhcpServerAddress = aValue; }
69
void setDhcpServerMask (const QString &aValue) { mDhcpServerMask = aValue; }
70
void setDhcpLowerAddress (const QString &aValue) { mDhcpLowerAddress = aValue; }
71
void setDhcpUpperAddress (const QString &aValue) { mDhcpUpperAddress = aValue; }
76
CHostNetworkInterface mInterface;
79
/* Host-only Interface */
81
bool mDhcpClientEnabled;
82
QString mInterfaceAddress;
83
QString mInterfaceMask;
85
QString mInterfaceAddress6;
86
QString mInterfaceMaskLength6;
89
bool mDhcpServerEnabled;
90
QString mDhcpServerAddress;
91
QString mDhcpServerMask;
92
QString mDhcpLowerAddress;
93
QString mDhcpUpperAddress;
96
class VBoxGLSettingsNetwork : public VBoxSettingsPage,
97
public Ui::VBoxGLSettingsNetwork
103
VBoxGLSettingsNetwork();
107
void getFrom (const CSystemProperties &aProps,
108
const VBoxGlobalSettings &aGs);
109
void putBackTo (CSystemProperties &aProps,
110
VBoxGlobalSettings &aGs);
112
void setValidator (QIWidgetValidator *aVal);
113
bool revalidate (QString &aWarning, QString &aTitle);
115
void setOrderAfter (QWidget *aWidget);
117
void retranslateUi();
123
void editInterface();
124
void updateCurrentItem();
125
void showContextMenu (const QPoint &aPos);
129
QAction *mAddInterface;
130
QAction *mRemInterface;
131
QAction *mEditInterface;
133
QIWidgetValidator *mValidator;
136
#endif // __VBoxGLSettingsNetwork_h__