diff options
Diffstat (limited to 'kdejava/koala/org/kde/koala/Plugin.java')
-rw-r--r-- | kdejava/koala/org/kde/koala/Plugin.java | 355 |
1 files changed, 355 insertions, 0 deletions
diff --git a/kdejava/koala/org/kde/koala/Plugin.java b/kdejava/koala/org/kde/koala/Plugin.java new file mode 100644 index 00000000..4a9c7f95 --- /dev/null +++ b/kdejava/koala/org/kde/koala/Plugin.java @@ -0,0 +1,355 @@ +//Auto-generated by kalyptus. DO NOT EDIT. +package org.kde.koala; + +import org.kde.qt.Qt; +import org.kde.qt.QDomDocument; +import org.kde.qt.QMetaObject; +import org.kde.qt.QtSupport; +import org.kde.qt.QObject; +import org.kde.qt.QWidget; +import org.kde.qt.QDomElement; +import org.kde.qt.QObject; + +/** + + A plugin is the way to add actions to an existing KParts application, + or to a Part. + The XML of those plugins looks exactly like of the shell or parts, + with one small difference: The document tag should have an additional + attribute, named "library", and contain the name of the library implementing + the plugin. + If you want this plugin to be used by a part, you need to + install the rc file under the directory + "data" (KDEDIR/share/apps usually)+"/instancename/kpartplugins/" + where instancename is the name of the part's instance. + You should also install a "plugin info" .desktop file with the same name. + \see PluginInfo + @short A plugin is the way to add actions to an existing KParts application, or to a Part. + +*/ +public class Plugin extends QObject implements KXMLGUIClientInterface { + protected Plugin(Class dummy){super((Class) null);} + public native QMetaObject metaObject(); + public native String className(); + /** + Construct a new KParts plugin. + @short Construct a new KParts plugin. + */ + public Plugin(QObject parent, String name) { + super((Class) null); + newPlugin(parent,name); + } + private native void newPlugin(QObject parent, String name); + public Plugin(QObject parent) { + super((Class) null); + newPlugin(parent); + } + private native void newPlugin(QObject parent); + public Plugin() { + super((Class) null); + newPlugin(); + } + private native void newPlugin(); + /** + Reimplemented for internal reasons + @short Reimplemented for internal reasons + */ + public native String xmlFile(); + /** + Reimplemented for internal reasons + @short Reimplemented for internal reasons + */ + public native String localXMLFile(); + /** + Load the plugin libraries from the directories appropriate + to <code>instance</code> and make the Plugin objects children of <code>parent.</code> + It is recommended to use the last loadPlugins method instead, + to support enabling and disabling of plugins. + @short Load the plugin libraries from the directories appropriate to <code>instance</code> and make the Plugin objects children of <code>parent.</code> + */ + public static native void loadPlugins(QObject parent, KInstanceInterface instance); + /** + Load the plugin libraries specified by the list <code>docs</code> and make the + Plugin objects children of <code>parent</code> . + It is recommended to use the last loadPlugins method instead, + to support enabling and disabling of plugins. + @short Load the plugin libraries specified by the list <code>docs</code> and make the Plugin objects children of <code>parent</code> . + */ + // void loadPlugins(QObject* arg1,const QValueList<KParts::Plugin::PluginInfo>& arg2); >>>> NOT CONVERTED + /** + Load the plugin libraries specified by the list <code>pluginInfos</code>, make the + Plugin objects children of <code>parent</code>, and use the given <code>instance.</code> + It is recommended to use the last loadPlugins method instead, + to support enabling and disabling of plugins. + @short Load the plugin libraries specified by the list <code>pluginInfos</code>, make the Plugin objects children of <code>parent</code>, and use the given <code>instance.</code> + */ + // void loadPlugins(QObject* arg1,const QValueList<KParts::Plugin::PluginInfo>& arg2,const KInstance* arg3); >>>> NOT CONVERTED + /** + Load the plugin libraries for the given <code>instance</code>, make the + Plugin objects children of <code>parent</code>, and insert the plugin as a child GUI client + of <code>parentGUIClient.</code> + This method uses the KConfig object of the given instance, to find out which + plugins are enabled and which are disabled. What happens by default (i.e. + for new plugins that are not in that config file) is controlled by + <code>enableNewPluginsByDefault.</code> It can be overridden by the plugin if it + sets the X-KDE-PluginInfo-EnabledByDefault key in the .desktop file + (with the same name as the .rc file) + If a disabled plugin is already loaded it will be removed from the GUI + factory and deleted. + This method is automatically called by KParts.Plugin and by KParts.MainWindow. + If you call this method in an already constructed GUI (like when the user + has changed which plugins are enabled) you need to add the new plugins to + the KXMLGUIFactory: + <pre> + if( factory() ) + { + QPtrList<KParts.Plugin> plugins = KParts.Plugin.pluginObjects( this ); + QPtrListIterator<KParts.Plugin> it( plugins ); + KParts.Plugin plugin; + while( ( plugin = it.current() ) != 0 ) + { + ++it; + factory().addClient( plugin ); + } + } + </pre> + @short Load the plugin libraries for the given <code>instance</code>, make the Plugin objects children of <code>parent</code>, and insert the plugin as a child GUI client of <code>parentGUIClient.</code> + */ + public static native void loadPlugins(QObject parent, KXMLGUIClientInterface parentGUIClient, KInstanceInterface instance, boolean enableNewPluginsByDefault); + public static native void loadPlugins(QObject parent, KXMLGUIClientInterface parentGUIClient, KInstanceInterface instance); + /** + Returns a list of plugin objects loaded for <code>parent.</code> This + functions basically calls the queryList method of + QObject to retrieve the list of child objects inheriting + KParts.Plugin . + @short Returns a list of plugin objects loaded for <code>parent.</code> + */ + // QPtrList<KParts::Plugin> pluginObjects(QObject* arg1); >>>> NOT CONVERTED + protected native void setInstance(KInstanceInterface instance); + /** + Look for plugins in the <code>instance</code>'s "data" directory (+"/kpartplugins") + @return A list of QDomDocument s, containing the parsed xml documents returned by plugins. + + @short Look for plugins in the <code>instance</code>'s "data" directory (+"/kpartplugins") + */ + // QValueList<KParts::Plugin::PluginInfo> pluginInfos(const KInstance* arg1); >>>> NOT CONVERTED + /** + @return The plugin created from the library <code>libname</code> + + @short + */ + protected static native Plugin loadPlugin(QObject parent, String libname); + /** + Retrieves an action of the client by name. If not found, it looks in its child clients. + This method is provided for convenience, as it uses actionCollection() + to get the action object. + @short Retrieves an action of the client by name. + */ + public native KAction action(String name); + /** + Retrieves an action for a given QDomElement. The default + implementation uses the "name" attribute to query the action + object via the other action() method. + @short Retrieves an action for a given QDomElement. + */ + public native KAction action(QDomElement element); + /** + Retrieves the entire action collection for the GUI client. If + you subclass KXMLGUIClient you should call + KActionCollection.setWidget( QWidget ) with this object, or + you will encounter subtle bugs with KAction keyboard shortcuts. + This is not necessary if your KXMLGUIClient is a KMainWindow. + @short Retrieves the entire action collection for the GUI client. + @see KActionCollection#setWidget( + @see #org#kde#qt#QWidget* + */ + public native KActionCollection actionCollection(); + /** + @return The instance ( KInstance ) for this GUI client. + + @short + */ + public native KInstanceInterface instance(); + /** + @return The parsed XML in a QDomDocument, set by + setXMLFile() or setXML(). + This document describes the layout of the GUI. + + @short + */ + public native QDomDocument domDocument(); + /** + @short + */ + public native void setXMLGUIBuildDocument(QDomDocument doc); + /** + @short + */ + public native QDomDocument xmlguiBuildDocument(); + /** + This method is called by the KXMLGUIFactory as soon as the client + is added to the KXMLGUIFactory's GUI. + @short This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GUI. + */ + public native void setFactory(KXMLGUIFactory factory); + /** + Retrieves a pointer to the KXMLGUIFactory this client is + associated with (will return null if the client's GUI has not been built + by a KXMLGUIFactory. + @short Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return 0L if the client's GUI has not been built by a KXMLGUIFactory. + */ + public native KXMLGUIFactory factory(); + /** + KXMLGUIClients can form a simple child/parent object tree. This + method returns a pointer to the parent client or null if it has no + parent client assigned. + @short KXMLGUIClients can form a simple child/parent object tree. + */ + public native KXMLGUIClientInterface parentClient(); + /** + Use this method to make a client a child client of another client. + Usually you don't need to call this method, as it is called + automatically when using the second constructor, which takes a + parent argument. + @short Use this method to make a client a child client of another client. + */ + public native void insertChildClient(KXMLGUIClientInterface child); + /** + Removes the given <code>child</code> from the client's children list. + @short Removes the given <code>child</code> from the client's children list. + */ + public native void removeChildClient(KXMLGUIClientInterface child); + /** + Retrieves a list of all child clients. + @short Retrieves a list of all child clients. + */ + // const QPtrList<KXMLGUIClient>* childClients(); >>>> NOT CONVERTED + /** + A client can have an own KXMLGUIBuilder. + Use this method to assign your builder instance to the client (so that the + KXMLGUIFactory can use it when building the client's GUI) + Client specific guibuilders are useful if you want to create + custom container widgets for your GUI. + @short A client can have an own KXMLGUIBuilder. + */ + public native void setClientBuilder(KXMLGUIBuilderInterface builder); + /** + Retrieves the client's GUI builder or null if no client specific + builder has been assigned via setClientBuilder() + @short Retrieves the client's GUI builder or 0L if no client specific builder has been assigned via setClientBuilder() + */ + public native KXMLGUIBuilderInterface clientBuilder(); + /** + Forces this client to re-read its XML resource file. This is + intended to be used when you know that the resource file has + changed and you will soon be rebuilding the GUI. It has no + useful effect with non-KParts GUIs, so don't bother using it + unless your app is component based. + @short Forces this client to re-read its XML resource file. + */ + public native void reloadXML(); + /** + ActionLists are a way for XMLGUI to support dynamic lists of + actions. E.g. if you are writing a file manager, and there is a + menu file whose contents depend on the mimetype of the file that + is selected, then you can achieve this using ActionLists. It + works as follows: + In your xxxui.rc file ( the one that you set in setXMLFile() + ), you put an <p>\<ActionList name="xxx"\></p> tag. E.g. + <pre> + <kpartgui name="xxx_part" version="1"> + <MenuBar> + <Menu name="file"> + ... <!-- some useful actions-. + <ActionList name="xxx_file_actionlist" /> + ... <!-- even more useful actions-. + </Menu> + ... + </MenuBar> + </kpartgui> + </pre> + This tag will get expanded to a list of actions. In the example + above ( a file manager with a dynamic file menu ), you would call + <pre> + QPtrList<KAction> file_actions; + for( ... ) + if( ... ) + file_actions.append( cool_action ); + unplugActionList( "xxx_file_actionlist" ); + plugActionList( "xxx_file_actionlist", file_actions ); + </pre> + every time a file is selected, unselected or ... + <b>Note:<> You should not call createGUI() after calling this + function. In fact, that would remove the newly added + actionlists again... + <b>Note:<> Forgetting to call unplugActionList() before + plugActionList() would leave the previous actions in the + menu too.. + @short ActionLists are a way for XMLGUI to support dynamic lists of actions. + */ + // void plugActionList(const QString& arg1,const QPtrList<KAction>& arg2); >>>> NOT CONVERTED + /** + The complement of plugActionList() ... + @short The complement of plugActionList() . + */ + public native void unplugActionList(String name); + public native void addStateActionEnabled(String state, String action); + public native void addStateActionDisabled(String state, String action); + // KXMLGUIClient::StateChange getActionsToChangeForState(const QString& arg1); >>>> NOT CONVERTED + public native void beginXMLPlug(QWidget arg1); + public native void endXMLPlug(); + public native void prepareXMLUnplug(QWidget arg1); + public static native String findMostRecentXMLFile(String[] files, StringBuffer doc); + /** + Sets the name of the rc file containing the XML for the part. + Call this in the Part-inherited class constructor. + @param file Either an absolute path for the file, or simply the + filename, which will then be assumed to be installed + in the "data" resource, under a directory named like + the instance. + @param merge Whether to merge with the global document. + @param setXMLDoc Specify whether to call setXML. Default is true. + and the DOM document at once. + @short Sets the name of the rc file containing the XML for the part. + */ + protected native void setXMLFile(String file, boolean merge, boolean setXMLDoc); + protected native void setXMLFile(String file, boolean merge); + protected native void setXMLFile(String file); + protected native void setLocalXMLFile(String file); + /** + Sets the XML for the part. + Call this in the Part-inherited class constructor if you + don't call setXMLFile(). + @short Sets the XML for the part. + */ + protected native void setXML(String document, boolean merge); + protected native void setXML(String document); + /** + Sets the Document for the part, describing the layout of the GUI. + Call this in the Part-inherited class constructor if you don't call + setXMLFile or setXML . + @short Sets the Document for the part, describing the layout of the GUI. + */ + protected native void setDOMDocument(QDomDocument document, boolean merge); + protected native void setDOMDocument(QDomDocument document); + /** + This function will attempt to give up some memory after the GUI + is built. It should never be used in apps where the GUI may be + rebuilt at some later time (components, for instance). + @short This function will attempt to give up some memory after the GUI is built. + */ + protected native void conserveMemory(); + /** + Actions can collectively be assigned a "State". To accomplish this + the respective actions are tagged as \<enable\> or \<disable\> in + a \<State\> \</State\> group of the XMLfile. During program execution the + programmer can call stateChanged() to set actions to a defined state. + @param newstate Name of a State in the XMLfile. + @param reverse If the flag reverse is set to StateReverse, the State is reversed. + (actions to be enabled will be disabled and action to be disabled will be enabled) + Default is reverse=false. + @short Actions can collectively be assigned a "State". + */ + protected native void stateChanged(String newstate, int reverse); + protected native void stateChanged(String newstate); +} |