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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
|
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;
import org.kde.qt.Qt;
import org.kde.qt.QtSupport;
import org.kde.qt.TQObject;
import java.util.ArrayList;
import org.kde.qt.TQWidget;
/**
Convenience methods to access all standard KDE actions.
These actions should be used instead of hardcoding menubar and
toolbar items. Using these actions helps your application easily
conform to the KDE UI Style Guide
All of the documentation for KAction holds for KStdAction
also. When in doubt on how things work, check the KAction
documention first.
<li><b>Simple Example:</b></li>
In general, using standard actions should be a drop in replacement
for regular actions. For example, if you previously had:
<pre>
KAction newAct = new KAction(i18n("&New"), TQIconSet(BarIcon("filenew")),
KStdAccel.shortcut(KStdAccel.New), this,
SLOT("fileNew()"), actionCollection());
</pre>
You could drop that and replace it with:
<pre>
KAction newAct = KStdAction.openNew(this, SLOT("fileNew()"),
actionCollection());
</pre>
<li><b>Non-standard Usages</b></li>
It is possible to use the standard actions in various
non-recommended ways. Say, for instance, you wanted to have a
standard action (with the associated correct text and icon and
accelerator, etc) but you didn't want it to go in the standard
place (this is not recommended, by the way). One way to do this is
to simply not use the XML UI framework and plug it into wherever
you want. If you do want to use the XML UI framework (good!), then
it is still possible.
Basically, the XML building code matches names in the XML code with
the internal names of the actions. You can find out the internal
names of each of the standard actions by using the stdName
action like so: KStdAction.stdName(KStdAction.Cut) would return
'edit_cut'. The XML building code will match 'edit_cut' to the
attribute in the global XML file and place your action there.
However, you can change the internal name. In this example, just
do something like:
<pre>
KStdAction.cut(this, SLOT("editCut()"), actionCollection(), "my_cut");
</pre>
Now, in your local XML resource file (e.g., yourappui.rc), simply
put 'my_cut' where you want it to go.
Another non-standard usage concerns getting a pointer to an
existing action if, say, you want to enable or disable the action.
You could do it the recommended way and just grab a pointer when
you instantiate it as in the the 'openNew' example above... or you
could do it the hard way:
<pre>
KAction cut = actionCollection().action(KStdAction.stdName(KStdAction.Cut));
</pre>
Another non-standard usage concerns instantiating the action in the
first place. Usually, you would use the member functions as
shown above (e.g., KStdAction.cut(this, SLOT, parent)). You
may, however, do this using the enums provided. This author can't
think of a reason why you would want to, but, hey, if you do,
here's how:
<pre>
KStdAction.action(KStdAction.New, this, SLOT("fileNew()"), actionCollection());
KStdAction.action(KStdAction.Cut, this, SLOT("editCut()"), actionCollection());
</pre>
@author Kurt Granroth <granroth@kde.org>
@short Convenience methods to access all standard KDE actions.
@see #http://developer#kde#org/documentation/standards/kde/style/basics/index#html
*/
public class KStdAction {
/**
The standard menubar and toolbar actions.
@short The standard menubar and toolbar actions.
*/
public static final int ActionNone = 0;
public static final int New = 1;
public static final int Open = 2;
public static final int OpenRecent = 3;
public static final int Save = 4;
public static final int SaveAs = 5;
public static final int Revert = 6;
public static final int Close = 7;
public static final int Print = 8;
public static final int PrintPreview = 9;
public static final int Mail = 10;
public static final int Quit = 11;
public static final int Undo = 12;
public static final int Redo = 13;
public static final int Cut = 14;
public static final int Copy = 15;
public static final int Paste = 16;
public static final int SelectAll = 17;
public static final int Deselect = 18;
public static final int Find = 19;
public static final int FindNext = 20;
public static final int FindPrev = 21;
public static final int Replace = 22;
public static final int ActualSize = 23;
public static final int FitToPage = 24;
public static final int FitToWidth = 25;
public static final int FitToHeight = 26;
public static final int ZoomIn = 27;
public static final int ZoomOut = 28;
public static final int Zoom = 29;
public static final int Redisplay = 30;
public static final int Up = 31;
public static final int Back = 32;
public static final int Forward = 33;
public static final int Home = 34;
public static final int Prior = 35;
public static final int Next = 36;
public static final int Goto = 37;
public static final int GotoPage = 38;
public static final int GotoLine = 39;
public static final int FirstPage = 40;
public static final int LastPage = 41;
public static final int AddBookmark = 42;
public static final int EditBookmarks = 43;
public static final int Spelling = 44;
public static final int ShowMenubar = 45;
public static final int ShowToolbar = 46;
public static final int ShowStatusbar = 47;
public static final int SaveOptions = 48;
public static final int KeyBindings = 49;
public static final int Preferences = 50;
public static final int ConfigureToolbars = 51;
public static final int Help = 52;
public static final int HelpContents = 53;
public static final int WhatsThis = 54;
public static final int ReportBug = 55;
public static final int AboutApp = 56;
public static final int AboutKDE = 57;
public static final int TipofDay = 58;
public static final int ConfigureNotifications = 59;
public static final int FullScreen = 60;
public static final int Clear = 61;
public static final int PasteText = 62;
/**
Creates an action corresponding to the
KStdAction.StdAction enum.
@short Creates an action corresponding to the KStdAction.StdAction enum.
*/
public static native KAction create(int id, String name, TQObject recvr, String slot, KActionCollection parent);
public static native KAction create(int id, TQObject recvr, String slot, KActionCollection parent);
/**
This will return the internal name of a given standard action.
@short This will return the internal name of a given standard action.
*/
public static native String name(int id);
public static native String stdName(int act_enum);
/**
Returns a list of all standard names. Used by KAccelManager
to give those heigher weight.
@short Returns a list of all standard names.
*/
public static native ArrayList stdNames();
/**
Create a new document or window.
@short Create a new document or window.
*/
public static native KAction openNew(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction openNew(TQObject recvr, String slot, KActionCollection parent);
/**
Open an existing file.
@short Open an existing file.
*/
public static native KAction open(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction open(TQObject recvr, String slot, KActionCollection parent);
/**
Open a recently used document. The signature of the slot being called
is of the form slotURLSelected( KURL ).
@param recvr object to receive slot
@param slot The SLOT to invoke when a URL is selected. The slot's
signature is slotURLSelected( KURL ).
@param parent parent widget
@param name name of widget
@short Open a recently used document.
*/
public static native KRecentFilesAction openRecent(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KRecentFilesAction openRecent(TQObject recvr, String slot, KActionCollection parent);
/**
Save the current document.
@short Save the current document.
*/
public static native KAction save(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction save(TQObject recvr, String slot, KActionCollection parent);
/**
Save the current document under a different name.
@short Save the current document under a different name.
*/
public static native KAction saveAs(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction saveAs(TQObject recvr, String slot, KActionCollection parent);
/**
Revert the current document to the last saved version
(essentially will undo all changes).
@short Revert the current document to the last saved version (essentially will undo all changes).
*/
public static native KAction revert(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction revert(TQObject recvr, String slot, KActionCollection parent);
/**
Close the current document.
@short Close the current document.
*/
public static native KAction close(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction close(TQObject recvr, String slot, KActionCollection parent);
/**
Print the current document.
@short Print the current document.
*/
public static native KAction print(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction print(TQObject recvr, String slot, KActionCollection parent);
/**
Show a print preview of the current document.
@short Show a print preview of the current document.
*/
public static native KAction printPreview(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction printPreview(TQObject recvr, String slot, KActionCollection parent);
/**
Mail this document.
@short Mail this document.
*/
public static native KAction mail(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction mail(TQObject recvr, String slot, KActionCollection parent);
/**
Quit the program.
@short Quit the program.
*/
public static native KAction quit(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction quit(TQObject recvr, String slot, KActionCollection parent);
/**
Undo the last operation.
@short Undo the last operation.
*/
public static native KAction undo(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction undo(TQObject recvr, String slot, KActionCollection parent);
/**
Redo the last operation.
@short Redo the last operation.
*/
public static native KAction redo(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction redo(TQObject recvr, String slot, KActionCollection parent);
/**
Cut selected area and store it in the clipboard.
@short Cut selected area and store it in the clipboard.
*/
public static native KAction cut(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction cut(TQObject recvr, String slot, KActionCollection parent);
/**
Copy the selected area into the clipboard.
@short Copy the selected area into the clipboard.
*/
public static native KAction copy(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction copy(TQObject recvr, String slot, KActionCollection parent);
/**
Paste the contents of clipboard at the current mouse or cursor
position.
@short Paste the contents of clipboard at the current mouse or cursor position.
*/
public static native KAction paste(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction paste(TQObject recvr, String slot, KActionCollection parent);
/**
Paste the contents of clipboard at the current mouse or cursor
position. Provide a button on the toolbar with the clipboard history
menu if Klipper is running.
@short Paste the contents of clipboard at the current mouse or cursor position.
*/
public static native KAction pasteText(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction pasteText(TQObject recvr, String slot, KActionCollection parent);
/**
Clear the content of the focus widget
@short Clear the content of the focus widget
*/
public static native KAction clear(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction clear(TQObject recvr, String slot, KActionCollection parent);
/**
Select all elements in the current document.
@short Select all elements in the current document.
*/
public static native KAction selectAll(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction selectAll(TQObject recvr, String slot, KActionCollection parent);
/**
Deselect any selected elements in the current document.
@short Deselect any selected elements in the current document.
*/
public static native KAction deselect(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction deselect(TQObject recvr, String slot, KActionCollection parent);
/**
Initiate a 'find' request in the current document.
@short Initiate a 'find' request in the current document.
*/
public static native KAction find(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction find(TQObject recvr, String slot, KActionCollection parent);
/**
Find the next instance of a stored 'find'.
@short Find the next instance of a stored 'find'.
*/
public static native KAction findNext(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction findNext(TQObject recvr, String slot, KActionCollection parent);
/**
Find a previous instance of a stored 'find'.
@short Find a previous instance of a stored 'find'.
*/
public static native KAction findPrev(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction findPrev(TQObject recvr, String slot, KActionCollection parent);
/**
Find and replace matches.
@short Find and replace matches.
*/
public static native KAction replace(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction replace(TQObject recvr, String slot, KActionCollection parent);
/**
View the document at its actual size.
@short View the document at its actual size.
*/
public static native KAction actualSize(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction actualSize(TQObject recvr, String slot, KActionCollection parent);
/**
Fit the document view to the size of the current window.
@short Fit the document view to the size of the current window.
*/
public static native KAction fitToPage(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction fitToPage(TQObject recvr, String slot, KActionCollection parent);
/**
Fit the document view to the width of the current window.
@short Fit the document view to the width of the current window.
*/
public static native KAction fitToWidth(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction fitToWidth(TQObject recvr, String slot, KActionCollection parent);
/**
Fit the document view to the height of the current window.
@short Fit the document view to the height of the current window.
*/
public static native KAction fitToHeight(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction fitToHeight(TQObject recvr, String slot, KActionCollection parent);
/**
Zoom in.
@short Zoom in.
*/
public static native KAction zoomIn(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction zoomIn(TQObject recvr, String slot, KActionCollection parent);
/**
Zoom out.
@short Zoom out.
*/
public static native KAction zoomOut(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction zoomOut(TQObject recvr, String slot, KActionCollection parent);
/**
Popup a zoom dialog.
@short Popup a zoom dialog.
*/
public static native KAction zoom(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction zoom(TQObject recvr, String slot, KActionCollection parent);
/**
Redisplay or redraw the document.
@short Redisplay or redraw the document.
*/
public static native KAction redisplay(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction redisplay(TQObject recvr, String slot, KActionCollection parent);
/**
Move up (web style menu).
@short Move up (web style menu).
*/
public static native KAction up(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction up(TQObject recvr, String slot, KActionCollection parent);
/**
Move back (web style menu).
@short Move back (web style menu).
*/
public static native KAction back(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction back(TQObject recvr, String slot, KActionCollection parent);
/**
Move forward (web style menu).
@short Move forward (web style menu).
*/
public static native KAction forward(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction forward(TQObject recvr, String slot, KActionCollection parent);
/**
Go to the "Home" position or document.
@short Go to the "Home" position or document.
*/
public static native KAction home(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction home(TQObject recvr, String slot, KActionCollection parent);
/**
Scroll up one page.
@short Scroll up one page.
*/
public static native KAction prior(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction prior(TQObject recvr, String slot, KActionCollection parent);
/**
Scroll down one page.
@short Scroll down one page.
*/
public static native KAction next(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction next(TQObject recvr, String slot, KActionCollection parent);
/**
Go to somewhere in general.
@short Go to somewhere in general.
*/
public static native KAction goTo(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction goTo(TQObject recvr, String slot, KActionCollection parent);
/**
Go to a specific page (dialog).
@short Go to a specific page (dialog).
*/
public static native KAction gotoPage(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction gotoPage(TQObject recvr, String slot, KActionCollection parent);
/**
Go to a specific line (dialog).
@short Go to a specific line (dialog).
*/
public static native KAction gotoLine(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction gotoLine(TQObject recvr, String slot, KActionCollection parent);
/**
Jump to the first page.
@short Jump to the first page.
*/
public static native KAction firstPage(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction firstPage(TQObject recvr, String slot, KActionCollection parent);
/**
Jump to the last page.
@short Jump to the last page.
*/
public static native KAction lastPage(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction lastPage(TQObject recvr, String slot, KActionCollection parent);
/**
Add the current page to the bookmarks tree.
@short Add the current page to the bookmarks tree.
*/
public static native KAction addBookmark(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction addBookmark(TQObject recvr, String slot, KActionCollection parent);
/**
Edit the application bookmarks.
@short Edit the application bookmarks.
*/
public static native KAction editBookmarks(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction editBookmarks(TQObject recvr, String slot, KActionCollection parent);
/**
Pop up the spell checker.
@short Pop up the spell checker.
*/
public static native KAction spelling(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction spelling(TQObject recvr, String slot, KActionCollection parent);
/**
Show/Hide the menubar.
@short Show/Hide the menubar.
*/
public static native KToggleAction showMenubar(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KToggleAction showMenubar(TQObject recvr, String slot, KActionCollection parent);
/**
Show/Hide the statusbar.
@short Show/Hide the statusbar.
*/
public static native KToggleAction showStatusbar(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KToggleAction showStatusbar(TQObject recvr, String slot, KActionCollection parent);
/**
Switch to/from full screen mode
@short Switch to/from full screen mode
*/
public static native KToggleFullScreenAction fullScreen(TQObject recvr, String slot, KActionCollection parent, TQWidget window, String name);
public static native KToggleFullScreenAction fullScreen(TQObject recvr, String slot, KActionCollection parent, TQWidget window);
/**
Display the save options dialog.
@short Display the save options dialog.
*/
public static native KAction saveOptions(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction saveOptions(TQObject recvr, String slot, KActionCollection parent);
/**
Display the configure key bindings dialog.
Note that you might be able to use the pre-built KXMLGUIFactory's fuction:
KStdAction.keyBindings(guiFactory(), SLOT("configureShortcuts()"), actionCollection());
@short Display the configure key bindings dialog.
*/
public static native KAction keyBindings(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction keyBindings(TQObject recvr, String slot, KActionCollection parent);
/**
Display the preferences/options dialog.
@short Display the preferences/options dialog.
*/
public static native KAction preferences(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction preferences(TQObject recvr, String slot, KActionCollection parent);
/**
The Customize Toolbar dialog.
@short The Customize Toolbar dialog.
*/
public static native KAction configureToolbars(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction configureToolbars(TQObject recvr, String slot, KActionCollection parent);
/**
The Configure Notifications dialog.
@short The Configure Notifications dialog.
*/
public static native KAction configureNotifications(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction configureNotifications(TQObject recvr, String slot, KActionCollection parent);
/**
Display the help.
@short Display the help.
*/
public static native KAction help(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction help(TQObject recvr, String slot, KActionCollection parent);
/**
Display the help contents.
@short Display the help contents.
*/
public static native KAction helpContents(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction helpContents(TQObject recvr, String slot, KActionCollection parent);
/**
Trigger the What's This cursor.
@short Trigger the What's This cursor.
*/
public static native KAction whatsThis(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction whatsThis(TQObject recvr, String slot, KActionCollection parent);
/**
Display "Tip of the Day"
@short Display "Tip of the Day"
*/
public static native KAction tipOfDay(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction tipOfDay(TQObject recvr, String slot, KActionCollection parent);
/**
Open up the Report Bug dialog.
@short Open up the Report Bug dialog.
*/
public static native KAction reportBug(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction reportBug(TQObject recvr, String slot, KActionCollection parent);
/**
Display the application's About box.
@short Display the application's About box.
*/
public static native KAction aboutApp(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction aboutApp(TQObject recvr, String slot, KActionCollection parent);
/**
Display the About KDE dialog.
@short Display the About KDE dialog.
*/
public static native KAction aboutKDE(TQObject recvr, String slot, KActionCollection parent, String name);
public static native KAction aboutKDE(TQObject recvr, String slot, KActionCollection parent);
}
|