summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KFontDialog.java
blob: d53456a7eae5d2dd3439d394f9ad8de4c9b8b86a (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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.TQFont;
import org.kde.qt.TQMetaObject;
import org.kde.qt.QtSupport;
import org.kde.qt.TQWidget;

/**

 The KFontDialog provides a dialog for interactive font selection.
 It is basically a thin wrapper around the KFontChooser widget,
 which can also be used standalone. In most cases, the simplest
 use of this class is the static method KFontDialog.getFont(),
 which pops up the dialog, allows the user to select a font, and
 returns when the dialog is closed.
 Example:
 <pre>
      TQFont myFont;
      int result = KFontDialog.getFont( myFont );
      if ( result == KFontDialog.Accepted )
            ...
 </pre>
 \image html kfontdialog.png "KDE Font Dialog"
 See {@link KFontDialogSignals} for signals emitted by KFontDialog
		@author Preston Brown <pbrown@kde.org>, Bernd Wuebben <wuebben@kde.org>

		@version $Id$
 
		@short A font selection dialog.

*/
public class KFontDialog extends KDialogBase  {
	protected KFontDialog(Class dummy){super((Class) null);}
	public native TQMetaObject metaObject();
	public native String className();
	/**	
		 Constructs a font selection dialog.
			@param parent The parent widget of the dialog, if any.
			@param name The name of the dialog.
			@param modal Specifies whether the dialog is modal or not.
			@param onlyFixed only display fonts which have fixed-width
		        character sizes.
			@param fontlist a list of fonts to display, in XLFD format.  If
		        no list is formatted, the internal KDE font list is used.
		        If that has not been created, X is queried, and all fonts
		        available on the system are displayed.
			@param makeFrame Draws a frame with titles around the contents.
			@param diff Display the difference version dialog. See getFontDiff().
			@param sizeIsRelativeState If not zero the widget will show a
		        checkbox where the user may choose whether the font size
		        is to be interpreted as relative size.
		        Initial state of this checkbox will be set according to
		        sizeIsRelativeState, user choice may be retrieved by
		        calling sizeIsRelative().
			   		@short    Constructs a font selection dialog.
	*/
	public KFontDialog(TQWidget parent, String name, boolean onlyFixed, boolean modal, String[] fontlist, boolean makeFrame, boolean diff, int sizeIsRelativeState) {
		super((Class) null);
		newKFontDialog(parent,name,onlyFixed,modal,fontlist,makeFrame,diff,sizeIsRelativeState);
	}
	private native void newKFontDialog(TQWidget parent, String name, boolean onlyFixed, boolean modal, String[] fontlist, boolean makeFrame, boolean diff, int sizeIsRelativeState);
	public KFontDialog(TQWidget parent, String name, boolean onlyFixed, boolean modal, String[] fontlist, boolean makeFrame, boolean diff) {
		super((Class) null);
		newKFontDialog(parent,name,onlyFixed,modal,fontlist,makeFrame,diff);
	}
	private native void newKFontDialog(TQWidget parent, String name, boolean onlyFixed, boolean modal, String[] fontlist, boolean makeFrame, boolean diff);
	public KFontDialog(TQWidget parent, String name, boolean onlyFixed, boolean modal, String[] fontlist, boolean makeFrame) {
		super((Class) null);
		newKFontDialog(parent,name,onlyFixed,modal,fontlist,makeFrame);
	}
	private native void newKFontDialog(TQWidget parent, String name, boolean onlyFixed, boolean modal, String[] fontlist, boolean makeFrame);
	public KFontDialog(TQWidget parent, String name, boolean onlyFixed, boolean modal, String[] fontlist) {
		super((Class) null);
		newKFontDialog(parent,name,onlyFixed,modal,fontlist);
	}
	private native void newKFontDialog(TQWidget parent, String name, boolean onlyFixed, boolean modal, String[] fontlist);
	public KFontDialog(TQWidget parent, String name, boolean onlyFixed, boolean modal) {
		super((Class) null);
		newKFontDialog(parent,name,onlyFixed,modal);
	}
	private native void newKFontDialog(TQWidget parent, String name, boolean onlyFixed, boolean modal);
	public KFontDialog(TQWidget parent, String name, boolean onlyFixed) {
		super((Class) null);
		newKFontDialog(parent,name,onlyFixed);
	}
	private native void newKFontDialog(TQWidget parent, String name, boolean onlyFixed);
	public KFontDialog(TQWidget parent, String name) {
		super((Class) null);
		newKFontDialog(parent,name);
	}
	private native void newKFontDialog(TQWidget parent, String name);
	public KFontDialog(TQWidget parent) {
		super((Class) null);
		newKFontDialog(parent);
	}
	private native void newKFontDialog(TQWidget parent);
	public KFontDialog() {
		super((Class) null);
		newKFontDialog();
	}
	private native void newKFontDialog();
	/**	
		 Sets the currently selected font in the dialog.
			@param font The font to select.
			@param onlyFixed readjust the font list to display only fixed
		        width fonts if true, or vice-versa
		   		@short    Sets the currently selected font in the dialog.
	*/
	public native void setFont(TQFont font, boolean onlyFixed);
	public native void setFont(TQFont font);
	/**	
				@return The currently selected font in the dialog.
   
		@short
	*/
	public native TQFont font();
	/**	
		 Sets the state of the checkbox indicating whether the font size
		 is to be interpreted as relative size.
		 NOTE: If parameter sizeIsRelative was not set in the constructor
		       of the dialog this setting will be ignored.
		   		@short    Sets the state of the checkbox indicating whether the font size  is to be interpreted as relative size.
	*/
	public native void setSizeIsRelative(int relative);
	/**	
				@return Whether the font size is to be interpreted as relative size
         (default: false)
   
		@short
	*/
	public native int sizeIsRelative();
	/**	
		 Creates a modal font dialog, lets the user choose a font,
		 and returns when the dialog is closed.
			@param theFont a reference to the font to write the chosen font
		        into.
			@param onlyFixed if true, only select from fixed-width fonts.
			@param parent Parent widget of the dialog. Specifying a widget different
		        from 0 (Null) improves centering (looks better).
			@param makeFrame Draws a frame with titles around the contents.
			@param sizeIsRelativeState If not zero the widget will show a
		        checkbox where the user may choose whether the font size
		        is to be interpreted as relative size.
		        Initial state of this checkbox will be set according to
		        sizeIsRelativeState and user choice will be returned
		        therein.
				@return TQDialog.result().
   
		@short    Creates a modal font dialog, lets the user choose a font,  and returns when the dialog is closed.
	*/
	public static native int getFont(TQFont theFont, boolean onlyFixed, TQWidget parent, boolean makeFrame, int sizeIsRelativeState);
	public static native int getFont(TQFont theFont, boolean onlyFixed, TQWidget parent, boolean makeFrame);
	public static native int getFont(TQFont theFont, boolean onlyFixed, TQWidget parent);
	public static native int getFont(TQFont theFont, boolean onlyFixed);
	public static native int getFont(TQFont theFont);
	/**	
		 Creates a modal font difference dialog, lets the user choose a selection
		 of changes that should be made to a set of fonts, and returns when the
		 dialog is closed. Useful for choosing slight adjustments to the font set
		 when the user would otherwise have to manually edit a number of fonts.
			@param theFont a reference to the font to write the chosen font
		        into.
			@param diffFlags a reference to the int into which the chosen
		        difference selection bitmask should be written.
		        Check the returned bitmask like:
		        <pre>
		        if ( diffFlags & KFontChooser.FontDiffFamily )
		            [...]
		        if ( diffFlags & KFontChooser.FontDiffStyle )
		            [...]
		        if ( diffFlags & KFontChooser.FontDiffSize )
		            [...]
		        </pre>
			@param onlyFixed if true, only select from fixed-width fonts.
			@param parent Parent widget of the dialog. Specifying a widget different
		        from 0 (Null) improves centering (looks better).
			@param makeFrame Draws a frame with titles around the contents.
			@param sizeIsRelativeState If not zero the widget will show a
		        checkbox where the user may choose whether the font size
		        is to be interpreted as relative size.
		        Initial state of this checkbox will be set according to
		        sizeIsRelativeState and user choice will be returned
		        therein.
				@return TQDialog.result().
   
		@short    Creates a modal font difference dialog, lets the user choose a selection  of changes that should be made to a set of fonts, and returns when the  dialog is closed.
	*/
	public static native int getFontDiff(TQFont theFont, int[] diffFlags, boolean onlyFixed, TQWidget parent, boolean makeFrame, int sizeIsRelativeState);
	public static native int getFontDiff(TQFont theFont, int[] diffFlags, boolean onlyFixed, TQWidget parent, boolean makeFrame);
	public static native int getFontDiff(TQFont theFont, int[] diffFlags, boolean onlyFixed, TQWidget parent);
	public static native int getFontDiff(TQFont theFont, int[] diffFlags, boolean onlyFixed);
	public static native int getFontDiff(TQFont theFont, int[] diffFlags);
	/**	
		 When you are not only interested in the font selected, but also
		 in the example string typed in, you can call this method.
			@param theFont a reference to the font to write the chosen font
		        into.
			@param theString a reference to the example text that was typed.
			@param onlyFixed if true, only select from fixed-width fonts.
			@param parent Parent widget of the dialog. Specifying a widget different
		        from 0 (Null) improves centering (looks better).
			@param makeFrame Draws a frame with titles around the contents.
			@param sizeIsRelativeState If not zero the widget will show a
		        checkbox where the user may choose whether the font size
		        is to be interpreted as relative size.
		        Initial state of this checkbox will be set according to
		        sizeIsRelativeState and user choice will be returned
		        therein.
				@return The result of the dialog.
   
		@short    When you are not only interested in the font selected, but also  in the example string typed in, you can call this method.
	*/
	public static native int getFontAndText(TQFont theFont, StringBuffer theString, boolean onlyFixed, TQWidget parent, boolean makeFrame, int sizeIsRelativeState);
	public static native int getFontAndText(TQFont theFont, StringBuffer theString, boolean onlyFixed, TQWidget parent, boolean makeFrame);
	public static native int getFontAndText(TQFont theFont, StringBuffer theString, boolean onlyFixed, TQWidget parent);
	public static native int getFontAndText(TQFont theFont, StringBuffer theString, boolean onlyFixed);
	public static native int getFontAndText(TQFont theFont, StringBuffer theString);
	/** 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();
}