summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KColorDialog.java
blob: 3bcda11ced81ec5036ff7119abf13e91592a33c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.QColor;
import org.kde.qt.QMetaObject;
import org.kde.qt.QtSupport;
import org.kde.qt.QObject;
import org.kde.qt.QPoint;
import org.kde.qt.QKeyEvent;
import org.kde.qt.QMouseEvent;
import org.kde.qt.QEvent;
import org.kde.qt.QWidget;

/**

 <li><b>Features:</b></li>

	<li>
	Color selection from a wide range of palettes.
	</li>
	
	<li>
	Color selection from a palette of H vs S and V selectors.
	</li>
	
	<li>
	Direct input of HSV or RGB values.
	</li>
	
	<li>
	Saving of custom colors
	</li>
	 In most cases, you will want to use the static method KColorDialog.getColor().
 This pops up the dialog (with an initial selection provided by you), lets the
 user choose a color, and returns.
 Example:
 <pre>
 	QColor myColor;
 	int result = KColorDialog.getColor( myColor );
         if ( result == KColorDialog.Accepted )
            ...
 </pre>
 The color dialog is really a collection of several widgets which can
 you can also use separately: the quadratic plane in the top left of
 the dialog is a KXYSelector. Right next to it is a KHSSelector
 for choosing hue/saturation.
 On the right side of the dialog you see a KPaletteTable showing
 up to 40 colors with a combo box which offers several predefined
 palettes or a palette configured by the user. The small field showing
 the currently selected color is a KColorPatch.
 See {@link KColorDialogSignals} for signals emitted by KColorDialog
		@short A color selection dialog.

*/
public class KColorDialog extends KDialogBase  {
	protected KColorDialog(Class dummy){super((Class) null);}
	public native QMetaObject metaObject();
	public native String className();
	/**	
		 Constructs a color selection dialog.
		     		@short    Constructs a color selection dialog.
	*/
	public KColorDialog(QWidget parent, String name, boolean modal) {
		super((Class) null);
		newKColorDialog(parent,name,modal);
	}
	private native void newKColorDialog(QWidget parent, String name, boolean modal);
	public KColorDialog(QWidget parent, String name) {
		super((Class) null);
		newKColorDialog(parent,name);
	}
	private native void newKColorDialog(QWidget parent, String name);
	public KColorDialog(QWidget parent) {
		super((Class) null);
		newKColorDialog(parent);
	}
	private native void newKColorDialog(QWidget parent);
	public KColorDialog() {
		super((Class) null);
		newKColorDialog();
	}
	private native void newKColorDialog();
	/**	
		 Returns the currently selected color.
				@short    Returns the currently selected color.
	*/
	public native QColor color();
	/**	
		 Call this to make the dialog show a "Default Color" checkbox.
		 If this checkbox is selected, the dialog will return an "invalid" color (QColor()).
		 This can be used to mean "the default text color", for instance,
		 the one with the KDE text color on screen, but black when printing.
		     		@short    Call this to make the dialog show a "Default Color" checkbox.
	*/
	public native void setDefaultColor(QColor defaultCol);
	/**	
				@return the value passed to setDefaultColor
     
		@short
	*/
	public native QColor defaultColor();
	/**	
		 Preselects a color.
		     		@short    Preselects a color.
	*/
	public native void setColor(QColor col);
	/**	
		 Creates a modal color dialog, let the user choose a
		 color, and returns when the dialog is closed.
			 The selected color is returned in the argument <code>theColor.</code>
				@return QDialog.result().
     
		@short    Creates a modal color dialog, let the user choose a  color, and returns when the dialog is closed.
	*/
	public static native int getColor(QColor theColor, QWidget parent);
	public static native int getColor(QColor theColor);
	/**	
		 Creates a modal color dialog, lets the user choose a
		 color, and returns when the dialog is closed.
			 The selected color is returned in the argument <code>theColor.</code>
			 This version takes a <code>defaultColor</code> argument, which sets the color
		 selected by the "default color" checkbox. When this checkbox is checked,
		 the invalid color (QColor()) is returned into <code>theColor.</code>
				@return QDialog.result().
     
		@short    Creates a modal color dialog, lets the user choose a  color, and returns when the dialog is closed.
	*/
	public static native int getColor(QColor theColor, QColor defaultColor, QWidget parent);
	public static native int getColor(QColor theColor, QColor defaultColor);
	/**	
		 Gets the color from the pixel at point p on the screen.
		     		@short    Gets the color from the pixel at point p on the screen.
	*/
	public static native QColor grabColor(QPoint p);
	protected native void mouseReleaseEvent(QMouseEvent arg1);
	protected native void keyPressEvent(QKeyEvent arg1);
	public native boolean eventFilter(QObject arg1, QEvent ev);
	/** Deletes the wrapped C++ instance */
	protected native void finalize() throws InternalError;
	/** Delete the wrapped C++ instance ahead of finalize() */
	public native void dispose();
	/** Has the wrapped C++ instance been deleted? */
	public native boolean isDisposed();
}