VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxCocoaSpecialControls.h@ 24108

Last change on this file since 24108 was 24107, checked in by vboxsync, 16 years ago

FE/Qt4-OSX: initial set of native Cocoa controls

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
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 */
33ADD_COCOA_NATIVE_REF (NSButton);
34ADD_COCOA_NATIVE_REF (NSSegmentedControl);
35ADD_COCOA_NATIVE_REF (NSSearchField);
36
37class VBoxCocoaButton: public QMacCocoaViewContainer
38{
39 Q_OBJECT;
40
41public:
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
55signals:
56 void clicked (bool checked = false);
57
58private:
59 /* Private member vars */
60 NativeNSButtonRef mNativeRef;
61};
62
63class VBoxCocoaSegmentedButton: public QMacCocoaViewContainer
64{
65 Q_OBJECT;
66
67public:
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
81signals:
82 void clicked (int aSegment, bool aChecked = false);
83
84private:
85 /* Private member vars */
86 NativeNSSegmentedControlRef mNativeRef;
87};
88
89class VBoxCocoaSearchField: public QMacCocoaViewContainer
90{
91 Q_OBJECT;
92
93public:
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
107signals:
108 void textChanged (const QString& aText);
109
110private:
111 /* Private member vars */
112 NativeNSSearchFieldRef mNativeRef;
113};
114
115#endif /* ___darwin_VBoxCocoaSpecialControls_h__ */
116
Note: See TracBrowser for help on using the repository browser.

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