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

import org.trinitydesktop.qt.Qt;
import org.trinitydesktop.qt.TQDomDocument;
import org.trinitydesktop.qt.TQMetaObject;
import org.trinitydesktop.qt.QtSupport;
import org.trinitydesktop.qt.TQObject;
import org.trinitydesktop.qt.TQDomNode;
import org.trinitydesktop.qt.TQWidget;
import org.trinitydesktop.qt.TQDomElement;
import org.trinitydesktop.qt.TQObject;

/**

 KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create
 a GUI of container widgets (like menus, toolbars, etc.) and container items
 (menu items, toolbar buttons, etc.) from an XML document and action objects.
 Each KXMLGUIClient represents a part of the GUI, composed from containers and
 actions. KXMLGUIFactory takes care of building (with the help of a KXMLGUIBuilder)
 and merging the GUI from an unlimited number of clients.
 Each client provides XML through a TQDomDocument and actions through a
 TDEActionCollection . The XML document contains the rules for how to merge the
 GUI.
 KXMLGUIFactory processes the DOM tree provided by a client and plugs in the client's actions,
 according to the XML and the merging rules of previously inserted clients. Container widgets
 are built via a KXMLGUIBuilder , which has to be provided with the KXMLGUIFactory constructor.
  See {@link KXMLGUIFactorySignals} for signals emitted by KXMLGUIFactory
		@short    KXMLGUIFactory, together with KXMLGUIClient objects, can be used to create  a GUI of container widgets (like menus, toolbars, etc.

*/
public class KXMLGUIFactory extends TQObject  {
	protected KXMLGUIFactory(Class dummy){super((Class) null);}
	public native TQMetaObject metaObject();
	public native String className();
	/**
		 Constructs a KXMLGUIFactory. The provided <code>builder</code> KXMLGUIBuilder will be called
		 for creating and removing container widgets, when clients are added/removed from the GUI.
			 Note that the ownership of the given KXMLGUIBuilder object won't be transferred to this
		 KXMLGUIFactory, so you have to take care of deleting it properly.
		   		@short    Constructs a KXMLGUIFactory.
	*/
	public KXMLGUIFactory(KXMLGUIBuilderInterface builder, TQObject parent, String name) {
		super((Class) null);
		newKXMLGUIFactory(builder,parent,name);
	}
	private native void newKXMLGUIFactory(KXMLGUIBuilderInterface builder, TQObject parent, String name);
	public KXMLGUIFactory(KXMLGUIBuilderInterface builder, TQObject parent) {
		super((Class) null);
		newKXMLGUIFactory(builder,parent);
	}
	private native void newKXMLGUIFactory(KXMLGUIBuilderInterface builder, TQObject parent);
	public KXMLGUIFactory(KXMLGUIBuilderInterface builder) {
		super((Class) null);
		newKXMLGUIFactory(builder);
	}
	private native void newKXMLGUIFactory(KXMLGUIBuilderInterface builder);
	/**
		 Creates the GUI described by the TQDomDocument of the client,
		 using the client's actions, and merges it with the previously
		 created GUI.
		 This also means that the order in which clients are added to the factory
		 is relevant; assuming that your application supports plugins, you should
		 first add your application to the factory and then the plugin, so that the
		 plugin's UI is merged into the UI of your application, and not the other
		 way round.
		   		@short    Creates the GUI described by the TQDomDocument of the client,  using the client's actions, and merges it with the previously  created GUI.
	*/
	public native void addClient(KXMLGUIClientInterface client);
	/**
		 Removes the GUI described by the client, by unplugging all
		 provided actions and removing all owned containers (and storing
		 container state information in the given client)
		   		@short    Removes the GUI described by the client, by unplugging all  provided actions and removing all owned containers (and storing  container state information in the given client)
	*/
	public native void removeClient(KXMLGUIClientInterface client);
	// void plugActionList(KXMLGUIClient* arg1,const TQString& arg2,const TQPtrList<TDEAction>& arg3); >>>> NOT CONVERTED
	public native void unplugActionList(KXMLGUIClientInterface client, String name);
	/**
		 Returns a list of all clients currently added to this factory
		   		@short    Returns a list of all clients currently added to this factory
	*/
	// TQPtrList<KXMLGUIClient> clients(); >>>> NOT CONVERTED
	/**
		 Use this method to get access to a container widget with the name specified with <code>containerName</code>
		 and which is owned by the <code>client.</code> The container name is specified with a "name" attribute in the
		 XML document.
			 This function is particularly useful for getting hold of a popupmenu defined in an XMLUI file.
		 For instance:
		 <pre>
		 TQPopupMenu popup = (TQPopupMenu)(factory().container("my_popup",this));
		 </pre>
		 where <code></code>"my_popup" is the name of the menu in the XMLUI file, and
		 <code></code>"this" is XMLGUIClient which owns the popupmenu (e.g. the mainwindow, or the part, or the plugin...)
			@param containerName Name of the container widget
			@param client Owner of the container widget
			@param useTagName Specifies whether to compare the specified name with the name attribute or
		        the tag name.
			 This method may return null if no container with the given name exists or is not owned by the client.
		   		@short    Use this method to get access to a container widget with the name specified with <code>containerName</code>  and which is owned by the <code>client.</code>
	*/
	public native TQWidget container(String containerName, KXMLGUIClientInterface client, boolean useTagName);
	public native TQWidget container(String containerName, KXMLGUIClientInterface client);
	// TQPtrList<TQWidget> containers(const TQString& arg1); >>>> NOT CONVERTED
	/**
		 Use this method to free all memory allocated by the KXMLGUIFactory. This deletes the internal node
		 tree and therefore resets the internal state of the class. Please note that the actual GUI is
		 NOT touched at all, meaning no containers are deleted nor any actions unplugged. That is
		 something you have to do on your own. So use this method only if you know what you are doing :-)
			 (also note that this will call KXMLGUIClient.setFactory( null ) for all inserted clients)
		   		@short    Use this method to free all memory allocated by the KXMLGUIFactory.
	*/
	public native void reset();
	/**
		 Use this method to free all memory allocated by the KXMLGUIFactory for a specific container,
		 including all child containers and actions. This deletes the internal node subtree for the
		 specified container. The actual GUI is not touched, no containers are deleted or any actions
		 unplugged. Use this method only if you know what you are doing :-)
			 (also note that this will call KXMLGUIClient.setFactory( null ) for all clients of the
		 container)
		   		@short    Use this method to free all memory allocated by the KXMLGUIFactory for a specific container,  including all child containers and actions.
	*/
	public native void resetContainer(String containerName, boolean useTagName);
	public native void resetContainer(String containerName);
	/**
		 Show a standard configure shortcut for every action in this factory.
			 This slot can be connected dirrectly to the action to configure shortcuts. This is very simple to
		 do that by adding a single line
		 <pre>
		 KStdAction.keyBindings( guiFactory(), TQ_SLOT("configureShortcuts()"), actionCollection() );
		 </pre>
			@param bAllowLetterShortcuts Set to false if unmodified alphanumeric
		      keys ('A', '1', etc.) are not permissible shortcuts.
			@param bSaveSettings if true, the settings will also be saved back to
		      the uirc file which they were intially read from.
				@short    Show a standard configure shortcut for every action in this factory.
	*/
	public native int configureShortcuts(boolean bAllowLetterShortcuts, boolean bSaveSettings);
	public native int configureShortcuts(boolean bAllowLetterShortcuts);
	public native int configureShortcuts();
	public static native String readConfigFile(String filename, boolean never_null, TDEInstanceInterface instance);
	public static native String readConfigFile(String filename, boolean never_null);
	public static native String readConfigFile(String filename, TDEInstanceInterface instance);
	public static native String readConfigFile(String filename);
	public static native boolean saveConfigFile(TQDomDocument doc, String filename, TDEInstanceInterface instance);
	public static native boolean saveConfigFile(TQDomDocument doc, String filename);
	public static native String documentToXML(TQDomDocument doc);
	public static native String elementToXML(TQDomElement elem);
	/**
		 Removes all TQDomComment objects from the specified node and all its children.
		   		@short    Removes all TQDomComment objects from the specified node and all its children.
	*/
	public static native void removeDOMComments(TQDomNode node);
	/**
			 Find or create the ActionProperties element, used when saving custom action properties
		   		@short
	*/
	public static native TQDomElement actionPropertiesElement(TQDomDocument doc);
	/**
			 Find or create the element for a given action, by name.
		 Used when saving custom action properties
		   		@short
	*/
	public static native TQDomElement findActionByName(TQDomElement elem, String sName, boolean create);
	/** 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();
}