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 setToolTip (const QString& aTip);
|
---|
52 |
|
---|
53 | void onClicked();
|
---|
54 |
|
---|
55 | signals:
|
---|
56 | void clicked (bool checked = false);
|
---|
57 |
|
---|
58 | private:
|
---|
59 | /* Private member vars */
|
---|
60 | NativeNSButtonRef mNativeRef;
|
---|
61 | };
|
---|
62 |
|
---|
63 | class VBoxCocoaSegmentedButton: public QMacCocoaViewContainer
|
---|
64 | {
|
---|
65 | Q_OBJECT;
|
---|
66 |
|
---|
67 | public:
|
---|
68 | VBoxCocoaSegmentedButton (int aCount, QWidget *aParent = 0);
|
---|
69 | QSize sizeHint() const;
|
---|
70 |
|
---|
71 | void setTitle (int aSegment, const QString &aTitle);
|
---|
72 |
|
---|
73 | void setToolTip (int aSegment, const QString &aTip);
|
---|
74 |
|
---|
75 | void setEnabled (int aSegment, bool fEnabled);
|
---|
76 |
|
---|
77 | void animateClick (int aSegment);
|
---|
78 |
|
---|
79 | void onClicked (int aSegment);
|
---|
80 |
|
---|
81 | signals:
|
---|
82 | void clicked (int aSegment, bool aChecked = false);
|
---|
83 |
|
---|
84 | private:
|
---|
85 | /* Private member vars */
|
---|
86 | NativeNSSegmentedControlRef mNativeRef;
|
---|
87 | };
|
---|
88 |
|
---|
89 | class VBoxCocoaSearchField: public QMacCocoaViewContainer
|
---|
90 | {
|
---|
91 | Q_OBJECT;
|
---|
92 |
|
---|
93 | public:
|
---|
94 | VBoxCocoaSearchField (QWidget* aParent = 0);
|
---|
95 | QSize sizeHint() const;
|
---|
96 |
|
---|
97 | QString text() const;
|
---|
98 | void insert (const QString &aText);
|
---|
99 | void setToolTip (const QString &aTip);
|
---|
100 | void selectAll();
|
---|
101 |
|
---|
102 | void markError();
|
---|
103 | void unmarkError();
|
---|
104 |
|
---|
105 | void onTextChanged (const QString &aText);
|
---|
106 |
|
---|
107 | signals:
|
---|
108 | void textChanged (const QString& aText);
|
---|
109 |
|
---|
110 | private:
|
---|
111 | /* Private member vars */
|
---|
112 | NativeNSSearchFieldRef mNativeRef;
|
---|
113 | };
|
---|
114 |
|
---|
115 | #endif /* ___darwin_VBoxCocoaSpecialControls_h__ */
|
---|
116 |
|
---|