VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobalSettings.h@ 10887

Last change on this file since 10887 was 10219, checked in by vboxsync, 16 years ago

FE/Qt4-Win64: shutup some more warnings

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxGlobalSettingsData, VBoxGlobalSettings class declarations
5 */
6
7/*
8 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
9 *
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.
17 *
18 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 * Clara, CA 95054 USA or visit http://www.sun.com if you need
20 * additional information or have any questions.
21 */
22
23#ifndef __VBoxGlobalSettings_h__
24#define __VBoxGlobalSettings_h__
25
26#include "CIShared.h"
27
28/* Qt includes */
29#include <QObject>
30
31class CVirtualBox;
32
33class VBoxGlobalSettingsData
34{
35public:
36
37 VBoxGlobalSettingsData();
38 VBoxGlobalSettingsData( const VBoxGlobalSettingsData &that );
39 virtual ~VBoxGlobalSettingsData();
40 bool operator==( const VBoxGlobalSettingsData &that ) const;
41
42private:
43
44 int hostkey;
45 bool autoCapture;
46 QString guiFeatures;
47 QString languageId;
48 QString maxGuestRes;
49
50 friend class VBoxGlobalSettings;
51};
52
53/////////////////////////////////////////////////////////////////////////////
54
55class VBoxGlobalSettings : public QObject, public CIShared <VBoxGlobalSettingsData>
56{
57 Q_OBJECT
58 Q_PROPERTY (int hostKey READ hostKey WRITE setHostKey)
59 Q_PROPERTY (bool autoCapture READ autoCapture WRITE setAutoCapture)
60 Q_PROPERTY (QString guiFeatures READ guiFeatures WRITE setGuiFeatures)
61 Q_PROPERTY (QString languageId READ languageId WRITE setLanguageId)
62 Q_PROPERTY (QString maxGuestRes READ maxGuestRes WRITE setMaxGuestRes)
63
64public:
65
66 VBoxGlobalSettings (bool null = true)
67 : CIShared <VBoxGlobalSettingsData> (null) {}
68 VBoxGlobalSettings (const VBoxGlobalSettings &that)
69 : QObject(), CIShared <VBoxGlobalSettingsData> (that) {}
70 VBoxGlobalSettings &operator= (const VBoxGlobalSettings &that) {
71 CIShared <VBoxGlobalSettingsData>::operator= (that);
72 return *this;
73 }
74
75 // Properties
76
77 int hostKey() const { return data()->hostkey; }
78 void setHostKey (int key);
79
80 bool autoCapture() const { return data()->autoCapture; }
81 void setAutoCapture (bool autoCapture) {
82 mData()->autoCapture = autoCapture;
83 resetError();
84 }
85
86 QString guiFeatures() const { return data()->guiFeatures; }
87 void setGuiFeatures (const QString &aFeatures)
88 {
89 mData()->guiFeatures = aFeatures;
90 }
91 bool isFeatureActive (const char*) const;
92
93 QString languageId() const { return data()->languageId; }
94 void setLanguageId (const QString &aLanguageId)
95 {
96 mData()->languageId = aLanguageId;
97 }
98
99 QString maxGuestRes() const { return data()->maxGuestRes; }
100 void setMaxGuestRes (const QString &aMaxGuestRes)
101 {
102 mData()->maxGuestRes = aMaxGuestRes;
103 }
104
105 //
106
107 void load (CVirtualBox &vbox);
108 void save (CVirtualBox &vbox) const;
109
110 /**
111 * Returns true if the last setter or #load() operation has been failed
112 * and false otherwise.
113 */
114 bool operator !() const { return !last_err.isEmpty(); }
115
116 /**
117 * Returns the description of the error set by the last setter or #load()
118 * operation, or an empty (or null) string if the last operation was
119 * successful.
120 */
121 QString lastError() const { return last_err; }
122
123 QString publicProperty (const QString &publicName) const;
124 bool setPublicProperty (const QString &publicName, const QString &value);
125
126signals:
127
128 /**
129 * This sighal is emitted only when #setPublicProperty() or #load() is called.
130 * Direct modification of properties through individual setters or through
131 * QObject::setProperty() currently cannot be tracked.
132 */
133 void propertyChanged (const char *publicName, const char *name);
134
135private:
136
137 void setPropertyPrivate (size_t index, const QString &value);
138 void resetError() { last_err = QString::null; }
139
140 QString last_err;
141};
142
143#endif // __VBoxGlobalSettings_h__
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette