1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * VBoxCocoaSpecialControls class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2009 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 ___darwin_VBoxCocoaSpecialControls_h__
|
---|
24 | #define ___darwin_VBoxCocoaSpecialControls_h__
|
---|
25 |
|
---|
26 | /* VBox includes */
|
---|
27 | #include "VBoxCocoaHelper.h"
|
---|
28 |
|
---|
29 | /* Qt includes */
|
---|
30 | #include <QMacCocoaViewContainer>
|
---|
31 |
|
---|
32 | /* Add typedefs for Cocoa types */
|
---|
33 | ADD_COCOA_NATIVE_REF (NSButton);
|
---|
34 | ADD_COCOA_NATIVE_REF (NSSegmentedControl);
|
---|
35 | ADD_COCOA_NATIVE_REF (NSSearchField);
|
---|
36 |
|
---|
37 | class VBoxCocoaButton: public QMacCocoaViewContainer
|
---|
38 | {
|
---|
39 | Q_OBJECT;
|
---|
40 |
|
---|
41 | public:
|
---|
42 | enum CocoaButtonType
|
---|
43 | {
|
---|
44 | HelpButton,
|
---|
45 | CancelButton
|
---|
46 | };
|
---|
47 |
|
---|
48 | VBoxCocoaButton (CocoaButtonType aType, QWidget *aParent = 0);
|
---|
49 | QSize sizeHint() const;
|
---|
50 |
|
---|
51 | void setText (const QString& aText);
|
---|
52 | void setToolTip (const QString& aTip);
|
---|
53 |
|
---|
54 | void onClicked();
|
---|
55 |
|
---|
56 | signals:
|
---|
57 | void clicked (bool checked = false);
|
---|
58 |
|
---|
59 | private:
|
---|
60 | /* Private member vars */
|
---|
61 | NativeNSButtonRef mNativeRef;
|
---|
62 | };
|
---|
63 |
|
---|
64 | class VBoxCocoaSegmentedButton: public QMacCocoaViewContainer
|
---|
65 | {
|
---|
66 | Q_OBJECT;
|
---|
67 |
|
---|
68 | public:
|
---|
69 | VBoxCocoaSegmentedButton (int aCount, QWidget *aParent = 0);
|
---|
70 | QSize sizeHint() const;
|
---|
71 |
|
---|
72 | void setTitle (int aSegment, const QString &aTitle);
|
---|
73 |
|
---|
74 | void setToolTip (int aSegment, const QString &aTip);
|
---|
75 |
|
---|
76 | void setEnabled (int aSegment, bool fEnabled);
|
---|
77 |
|
---|
78 | void animateClick (int aSegment);
|
---|
79 |
|
---|
80 | void onClicked (int aSegment);
|
---|
81 |
|
---|
82 | signals:
|
---|
83 | void clicked (int aSegment, bool aChecked = false);
|
---|
84 |
|
---|
85 | private:
|
---|
86 | /* Private member vars */
|
---|
87 | NativeNSSegmentedControlRef mNativeRef;
|
---|
88 | };
|
---|
89 |
|
---|
90 | class VBoxCocoaSearchField: public QMacCocoaViewContainer
|
---|
91 | {
|
---|
92 | Q_OBJECT;
|
---|
93 |
|
---|
94 | public:
|
---|
95 | VBoxCocoaSearchField (QWidget* aParent = 0);
|
---|
96 | QSize sizeHint() const;
|
---|
97 |
|
---|
98 | QString text() const;
|
---|
99 | void insert (const QString &aText);
|
---|
100 | void setToolTip (const QString &aTip);
|
---|
101 | void selectAll();
|
---|
102 |
|
---|
103 | void markError();
|
---|
104 | void unmarkError();
|
---|
105 |
|
---|
106 | void onTextChanged (const QString &aText);
|
---|
107 |
|
---|
108 | signals:
|
---|
109 | void textChanged (const QString& aText);
|
---|
110 |
|
---|
111 | private:
|
---|
112 | /* Private member vars */
|
---|
113 | NativeNSSearchFieldRef mNativeRef;
|
---|
114 | };
|
---|
115 |
|
---|
116 | #endif /* ___darwin_VBoxCocoaSpecialControls_h__ */
|
---|
117 |
|
---|