summaryrefslogtreecommitdiffstats
path: root/tdejava/koala/org/trinitydesktop/koala/KHelpMenu.java
blob: fea442f826a43b76a5326a74b5e13a9e790d53b5 (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
//Auto-generated by kalyptus. DO NOT EDIT.
package org.trinitydesktop.koala;

import org.trinitydesktop.qt.Qt;
import org.trinitydesktop.qt.TQMetaObject;
import org.trinitydesktop.qt.QtSupport;
import org.trinitydesktop.qt.TQWidget;
import org.trinitydesktop.qt.TQObject;

/**

 This class provides the standard %KDE help menu with the default "about"
 dialog boxes and help entry.
 This class is used in TDEMainWindow so
 normally you don't need to use this class yourself. However, if you
 need the help menu or any of its dialog boxes in your code that is
 not subclassed from TDEMainWindow you should use this class.
 The usage is simple:
 <pre>
 mHelpMenu = new KHelpMenu( this, <someText> );
 tdemenubar.insertItem(i18n("&Help"), mHelpMenu.menu() );
 </pre>
 or if you just want to open a dialog box:
 <pre>
 mHelpMenu = new KHelpMenu( this, <someText> );
 connect( this, TQ_SIGNAL("someSignal()"), mHelpMenu,TQ_SLOT("mHelpMenu.aboutKDE()"));
 </pre>
 IMPORTANT:
 The first time you use KHelpMenu.menu(), a TDEPopupMenu object is
 allocated. Only one object is created by the class so if you call
 KHelpMenu.menu() twice or more, the same pointer is returned. The class
 will destroy the popupmenu in the destructor so do not delete this
 pointer yourself.
 The KHelpMenu object will be deleted when its parent is destroyed but you
 can delete it yourself if you want. The code below will always work.
 <pre>
 MyClass.~MyClass()
 {
   delete mHelpMenu;
 }
 </pre>
 Using your own "about application" dialog box:
 The standard "about application" dialog box is quite simple. If you
 need a dialog box with more functionality you must design that one
 yourself. When you want to display the dialog you can choose one of
 two methods. Common for both is that you must make a help menu object
 with no text argument If the text is missing the default dialog box
 will not be displayed:
 Example 1 Using showAboutApplication signal (preferred)
 <pre>
 void MyClass.myFunc()
 {
   ..
   KHelpMenu helpMenu = new KHelpMenu( this );
   connect( helpMenu, TQ_SIGNAL("showAboutApplication()"),
          this, TQ_SLOT("myDialogSlot()"));
   ..
 }
 void MyClass.myDialogSlot()
 {
   <activate your custom dialog>
 }
 </pre>
 Example 2 Old style - connecting directly to the menu entry.
 <pre>
 void MyClass.myFunc()
 {
   KHelpMenu helpMenu = new KHelpMenu( this );
   TDEPopupMenu help = mHelpMenu.menu();
   help.connectItem( KHelpMenu.menuAboutApp, this, TQ_SLOT("myDialogSlot()") );
 }
 void MyClass.myDialogSlot()
 {
   <activate your custom dialog>
 }
 </pre>
 See {@link KHelpMenuSignals} for signals emitted by KHelpMenu
		@author Espen Sand (espen@kde.org)

		@short Standard %KDE help menu with dialog boxes.

*/
public class KHelpMenu extends TQObject  {
	protected KHelpMenu(Class dummy){super((Class) null);}
	public static final int menuHelpContents = 0;
	public static final int menuWhatsThis = 1;
	public static final int menuAboutApp = 2;
	public static final int menuAboutKDE = 3;
	public static final int menuReportBug = 4;

	public native TQMetaObject metaObject();
	public native String className();
	/**
		 Constructor.
			@param parent The parent of the dialog boxes. The boxes are modeless
		        and will be centered with respect to the parent.
			@param aboutAppText User definable string that is used in the
		        application specific dialog box. Note: The help menu will
		        not open this dialog box if you don't define a string. See
		        showAboutApplication() for more information.
			@param showWhatsThis Decides whether a "Whats this" entry will be
		        added to the dialog.
			     		@short    Constructor.
	*/
	public KHelpMenu(TQWidget parent, String aboutAppText, boolean showWhatsThis) {
		super((Class) null);
		newKHelpMenu(parent,aboutAppText,showWhatsThis);
	}
	private native void newKHelpMenu(TQWidget parent, String aboutAppText, boolean showWhatsThis);
	public KHelpMenu(TQWidget parent, String aboutAppText) {
		super((Class) null);
		newKHelpMenu(parent,aboutAppText);
	}
	private native void newKHelpMenu(TQWidget parent, String aboutAppText);
	public KHelpMenu(TQWidget parent) {
		super((Class) null);
		newKHelpMenu(parent);
	}
	private native void newKHelpMenu(TQWidget parent);
	public KHelpMenu() {
		super((Class) null);
		newKHelpMenu();
	}
	private native void newKHelpMenu();
	/**
		 Constructor.
			 This alternative constructor is mainly useful if you want to
		 overide the standard actions (aboutApplication(), aboutKDE(),
		 helpContents(), reportBug, and optionally whatsThis).
			@param parent The parent of the dialog boxes. The boxes are modeless
		        and will be centered with respect to the parent.
			@param aboutData User and app data used in the About app dialog
			@param showWhatsThis Decides whether a "Whats this" entry will be
		        added to the dialog.
			@param actions TDEActionCollection that is used instead of the
		        standard actions.
			     		@short    Constructor.
	*/
	public KHelpMenu(TQWidget parent, TDEAboutData aboutData, boolean showWhatsThis, TDEActionCollection actions) {
		super((Class) null);
		newKHelpMenu(parent,aboutData,showWhatsThis,actions);
	}
	private native void newKHelpMenu(TQWidget parent, TDEAboutData aboutData, boolean showWhatsThis, TDEActionCollection actions);
	public KHelpMenu(TQWidget parent, TDEAboutData aboutData, boolean showWhatsThis) {
		super((Class) null);
		newKHelpMenu(parent,aboutData,showWhatsThis);
	}
	private native void newKHelpMenu(TQWidget parent, TDEAboutData aboutData, boolean showWhatsThis);
	public KHelpMenu(TQWidget parent, TDEAboutData aboutData) {
		super((Class) null);
		newKHelpMenu(parent,aboutData);
	}
	private native void newKHelpMenu(TQWidget parent, TDEAboutData aboutData);
	/**
		 Returns a popup menu you can use in the menu bar or where you
		 need it.
			 Note: This method will only create one instance of the menu. If
		 you call this method twice or more the same pointer is returned
		     		@short    Returns a popup menu you can use in the menu bar or where you  need it.
	*/
	public native TDEPopupMenu menu();
	/**
		 Opens the help page for the application. The application name is
		 used as a key to determine what to display and the system will attempt
		 to open \<appName\>/index.html.
		     		@short    Opens the help page for the application.
	*/
	public native void appHelpActivated();
	/**
		 Activates What's This help for the application.
		     		@short    Activates What's This help for the application.
	*/
	public native void contextHelpActivated();
	/**
		 Opens an application specific dialog box. The dialog box will display
		 the string that was defined in the constructor. If that string was
		 empty the showAboutApplication() is emitted instead.
		     		@short    Opens an application specific dialog box.
	*/
	public native void aboutApplication();
	/**
		 Opens the standard "About KDE" dialog box.
		     		@short    Opens the standard "About KDE" dialog box.
	*/
	public native void aboutKDE();
	/**
		 Opens the standard "Report Bugs" dialog box.
		     		@short    Opens the standard "Report Bugs" dialog box.
	*/
	public native void reportBug();
	/** 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();
}