From 3a8473ba2620b85b165b5a2fa1a6b153f5945800 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 11:16:51 -0600 Subject: Fix prior commit --- kdejava/koala/kdejava/KTrader.cpp | 150 ---------------------------- kdejava/koala/kdejava/KTrader.h | 29 ------ kdejava/koala/kdejava/TDETrader.cpp | 150 ++++++++++++++++++++++++++++ kdejava/koala/kdejava/TDETrader.h | 29 ++++++ kdejava/koala/org/kde/koala/KTrader.java | 155 ----------------------------- kdejava/koala/org/kde/koala/TDETrader.java | 155 +++++++++++++++++++++++++++++ 6 files changed, 334 insertions(+), 334 deletions(-) delete mode 100644 kdejava/koala/kdejava/KTrader.cpp delete mode 100644 kdejava/koala/kdejava/KTrader.h create mode 100644 kdejava/koala/kdejava/TDETrader.cpp create mode 100644 kdejava/koala/kdejava/TDETrader.h delete mode 100644 kdejava/koala/org/kde/koala/KTrader.java create mode 100644 kdejava/koala/org/kde/koala/TDETrader.java (limited to 'kdejava/koala') diff --git a/kdejava/koala/kdejava/KTrader.cpp b/kdejava/koala/kdejava/KTrader.cpp deleted file mode 100644 index ed985963..00000000 --- a/kdejava/koala/kdejava/KTrader.cpp +++ /dev/null @@ -1,150 +0,0 @@ -//Auto-generated by kalyptus. DO NOT EDIT. -#include -#include - -#include -#include -#include - -class TDETraderJBridge : public TDETrader -{ -public: - TDETraderJBridge() : TDETrader() {}; - ~TDETraderJBridge() {QtSupport::qtKeyDeleted(this);} - void removeChild(TQObject* arg1) { - if (!QtSupport::eventDelegate(this,"removeChild",(void*)arg1,"org.kde.qt.TQObject")) { - TQObject::removeChild(arg1); - } - return; - } - void customEvent(TQCustomEvent* arg1) { - if (!QtSupport::eventDelegate(this,"customEvent",(void*)arg1,"org.kde.qt.TQCustomEvent")) { - TQObject::customEvent(arg1); - } - return; - } - void timerEvent(TQTimerEvent* arg1) { - if (!QtSupport::eventDelegate(this,"timerEvent",(void*)arg1,"org.kde.qt.TQTimerEvent")) { - TQObject::timerEvent(arg1); - } - return; - } - void childEvent(TQChildEvent* arg1) { - if (!QtSupport::eventDelegate(this,"childEvent",(void*)arg1,"org.kde.qt.TQChildEvent")) { - TQObject::childEvent(arg1); - } - return; - } - void insertChild(TQObject* arg1) { - if (!QtSupport::eventDelegate(this,"insertChild",(void*)arg1,"org.kde.qt.TQObject")) { - TQObject::insertChild(arg1); - } - return; - } - bool eventFilter(TQObject* object,TQEvent* event) { - if (!QtSupport::eventFilterDelegate(this,"org.kde.koala.TDETrader",object,event)) { - return TQObject::eventFilter(object,event); - } else { - return TRUE; - } - } -}; - -JNIEXPORT jstring JNICALL -Java_org_kde_koala_TDETrader_className(JNIEnv* env, jobject obj) -{ - const char* _qstring; - _qstring = ((TDETrader*) QtSupport::getQt(env, obj))->className(); - return QtSupport::fromCharString(env, (char *) _qstring); -} - -JNIEXPORT void JNICALL -Java_org_kde_koala_TDETrader_dispose(JNIEnv* env, jobject obj) -{ - Java_org_kde_koala_TDETrader_finalize(env, obj); - return; -} - -JNIEXPORT void JNICALL -Java_org_kde_koala_TDETrader_finalize(JNIEnv* env, jobject obj) -{ - if (QtSupport::allocatedInJavaWorld(env, obj) && ((TDETrader*)QtSupport::getQt(env, obj))->parent() == 0) { - delete (TDETrader*)QtSupport::getQt(env, obj); - QtSupport::setQt(env, obj, 0); - } - return; -} - -JNIEXPORT jboolean JNICALL -Java_org_kde_koala_TDETrader_isDisposed(JNIEnv* env, jobject obj) -{ - return (QtSupport::getQt(env, obj) == 0); -} - -JNIEXPORT jobject JNICALL -Java_org_kde_koala_TDETrader_metaObject(JNIEnv* env, jobject obj) -{ - jobject xret = QtSupport::objectForQtKey(env, (void*)((TDETrader*) QtSupport::getQt(env, obj))->metaObject(), "org.kde.qt.TQMetaObject"); - return xret; -} - -JNIEXPORT void JNICALL -Java_org_kde_koala_TDETrader_newTDETrader(JNIEnv* env, jobject obj) -{ - if (QtSupport::getQt(env, obj) == 0) { - QtSupport::setQt(env, obj, new TDETraderJBridge()); - QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj)); - } - return; -} - -JNIEXPORT jobject JNICALL -Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring servicetype) -{ - TDETrader::OfferList _qlist; -static TQString* _qstring_servicetype = 0; - _qlist = ((TDETrader*) QtSupport::getQt(env, obj))->query((const TQString&)*(TQString*) QtSupport::toTQString(env, servicetype, &_qstring_servicetype)); - return (jobject) KDESupport::arrayWithOfferList(env, (TDETrader::OfferList*) &_qlist); -} - -JNIEXPORT jobject JNICALL -Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring servicetype, jstring constraint) -{ - TDETrader::OfferList _qlist; -static TQString* _qstring_servicetype = 0; -static TQString* _qstring_constraint = 0; - _qlist = ((TDETrader*) QtSupport::getQt(env, obj))->query((const TQString&)*(TQString*) QtSupport::toTQString(env, servicetype, &_qstring_servicetype), (const TQString&)*(TQString*) QtSupport::toTQString(env, constraint, &_qstring_constraint)); - return (jobject) KDESupport::arrayWithOfferList(env, (TDETrader::OfferList*) &_qlist); -} - -JNIEXPORT jobject JNICALL -Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring servicetype, jstring constraint, jstring preferences) -{ - TDETrader::OfferList _qlist; -static TQString* _qstring_servicetype = 0; -static TQString* _qstring_constraint = 0; -static TQString* _qstring_preferences = 0; - _qlist = ((TDETrader*) QtSupport::getQt(env, obj))->query((const TQString&)*(TQString*) QtSupport::toTQString(env, servicetype, &_qstring_servicetype), (const TQString&)*(TQString*) QtSupport::toTQString(env, constraint, &_qstring_constraint), (const TQString&)*(TQString*) QtSupport::toTQString(env, preferences, &_qstring_preferences)); - return (jobject) KDESupport::arrayWithOfferList(env, (TDETrader::OfferList*) &_qlist); -} - -JNIEXPORT jobject JNICALL -Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring servicetype, jstring genericServiceType, jstring constraint, jstring preferences) -{ - TDETrader::OfferList _qlist; -static TQString* _qstring_servicetype = 0; -static TQString* _qstring_genericServiceType = 0; -static TQString* _qstring_constraint = 0; -static TQString* _qstring_preferences = 0; - _qlist = ((TDETrader*) QtSupport::getQt(env, obj))->query((const TQString&)*(TQString*) QtSupport::toTQString(env, servicetype, &_qstring_servicetype), (const TQString&)*(TQString*) QtSupport::toTQString(env, genericServiceType, &_qstring_genericServiceType), (const TQString&)*(TQString*) QtSupport::toTQString(env, constraint, &_qstring_constraint), (const TQString&)*(TQString*) QtSupport::toTQString(env, preferences, &_qstring_preferences)); - return (jobject) KDESupport::arrayWithOfferList(env, (TDETrader::OfferList*) &_qlist); -} - -JNIEXPORT jobject JNICALL -Java_org_kde_koala_TDETrader_self(JNIEnv* env, jclass cls) -{ - (void) cls; - jobject xret = QtSupport::objectForQtKey(env, (void*)TDETraderJBridge::self(), "org.kde.koala.TDETrader"); - return xret; -} - diff --git a/kdejava/koala/kdejava/KTrader.h b/kdejava/koala/kdejava/KTrader.h deleted file mode 100644 index cbe91bc2..00000000 --- a/kdejava/koala/kdejava/KTrader.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ - -#ifndef __org_kde_koala_TDETrader__ -#define __org_kde_koala_TDETrader__ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_metaObject (JNIEnv *env, jobject); -extern JNIEXPORT jstring JNICALL Java_org_kde_koala_TDETrader_className (JNIEnv *env, jobject); -extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jstring, jstring, jstring); -extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jstring, jstring); -extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2 (JNIEnv *env, jobject, jstring); -extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jstring, jstring, jstring, jstring); -extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_self (JNIEnv *env, jclass); -extern JNIEXPORT void JNICALL Java_org_kde_koala_TDETrader_newTDETrader (JNIEnv *env, jobject); -extern JNIEXPORT void JNICALL Java_org_kde_koala_TDETrader_finalize (JNIEnv *env, jobject); -extern JNIEXPORT void JNICALL Java_org_kde_koala_TDETrader_dispose (JNIEnv *env, jobject); -extern JNIEXPORT jboolean JNICALL Java_org_kde_koala_TDETrader_isDisposed (JNIEnv *env, jobject); - -#ifdef __cplusplus -} -#endif - -#endif /* __org_kde_koala_TDETrader__ */ diff --git a/kdejava/koala/kdejava/TDETrader.cpp b/kdejava/koala/kdejava/TDETrader.cpp new file mode 100644 index 00000000..ed985963 --- /dev/null +++ b/kdejava/koala/kdejava/TDETrader.cpp @@ -0,0 +1,150 @@ +//Auto-generated by kalyptus. DO NOT EDIT. +#include +#include + +#include +#include +#include + +class TDETraderJBridge : public TDETrader +{ +public: + TDETraderJBridge() : TDETrader() {}; + ~TDETraderJBridge() {QtSupport::qtKeyDeleted(this);} + void removeChild(TQObject* arg1) { + if (!QtSupport::eventDelegate(this,"removeChild",(void*)arg1,"org.kde.qt.TQObject")) { + TQObject::removeChild(arg1); + } + return; + } + void customEvent(TQCustomEvent* arg1) { + if (!QtSupport::eventDelegate(this,"customEvent",(void*)arg1,"org.kde.qt.TQCustomEvent")) { + TQObject::customEvent(arg1); + } + return; + } + void timerEvent(TQTimerEvent* arg1) { + if (!QtSupport::eventDelegate(this,"timerEvent",(void*)arg1,"org.kde.qt.TQTimerEvent")) { + TQObject::timerEvent(arg1); + } + return; + } + void childEvent(TQChildEvent* arg1) { + if (!QtSupport::eventDelegate(this,"childEvent",(void*)arg1,"org.kde.qt.TQChildEvent")) { + TQObject::childEvent(arg1); + } + return; + } + void insertChild(TQObject* arg1) { + if (!QtSupport::eventDelegate(this,"insertChild",(void*)arg1,"org.kde.qt.TQObject")) { + TQObject::insertChild(arg1); + } + return; + } + bool eventFilter(TQObject* object,TQEvent* event) { + if (!QtSupport::eventFilterDelegate(this,"org.kde.koala.TDETrader",object,event)) { + return TQObject::eventFilter(object,event); + } else { + return TRUE; + } + } +}; + +JNIEXPORT jstring JNICALL +Java_org_kde_koala_TDETrader_className(JNIEnv* env, jobject obj) +{ + const char* _qstring; + _qstring = ((TDETrader*) QtSupport::getQt(env, obj))->className(); + return QtSupport::fromCharString(env, (char *) _qstring); +} + +JNIEXPORT void JNICALL +Java_org_kde_koala_TDETrader_dispose(JNIEnv* env, jobject obj) +{ + Java_org_kde_koala_TDETrader_finalize(env, obj); + return; +} + +JNIEXPORT void JNICALL +Java_org_kde_koala_TDETrader_finalize(JNIEnv* env, jobject obj) +{ + if (QtSupport::allocatedInJavaWorld(env, obj) && ((TDETrader*)QtSupport::getQt(env, obj))->parent() == 0) { + delete (TDETrader*)QtSupport::getQt(env, obj); + QtSupport::setQt(env, obj, 0); + } + return; +} + +JNIEXPORT jboolean JNICALL +Java_org_kde_koala_TDETrader_isDisposed(JNIEnv* env, jobject obj) +{ + return (QtSupport::getQt(env, obj) == 0); +} + +JNIEXPORT jobject JNICALL +Java_org_kde_koala_TDETrader_metaObject(JNIEnv* env, jobject obj) +{ + jobject xret = QtSupport::objectForQtKey(env, (void*)((TDETrader*) QtSupport::getQt(env, obj))->metaObject(), "org.kde.qt.TQMetaObject"); + return xret; +} + +JNIEXPORT void JNICALL +Java_org_kde_koala_TDETrader_newTDETrader(JNIEnv* env, jobject obj) +{ + if (QtSupport::getQt(env, obj) == 0) { + QtSupport::setQt(env, obj, new TDETraderJBridge()); + QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj)); + } + return; +} + +JNIEXPORT jobject JNICALL +Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring servicetype) +{ + TDETrader::OfferList _qlist; +static TQString* _qstring_servicetype = 0; + _qlist = ((TDETrader*) QtSupport::getQt(env, obj))->query((const TQString&)*(TQString*) QtSupport::toTQString(env, servicetype, &_qstring_servicetype)); + return (jobject) KDESupport::arrayWithOfferList(env, (TDETrader::OfferList*) &_qlist); +} + +JNIEXPORT jobject JNICALL +Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring servicetype, jstring constraint) +{ + TDETrader::OfferList _qlist; +static TQString* _qstring_servicetype = 0; +static TQString* _qstring_constraint = 0; + _qlist = ((TDETrader*) QtSupport::getQt(env, obj))->query((const TQString&)*(TQString*) QtSupport::toTQString(env, servicetype, &_qstring_servicetype), (const TQString&)*(TQString*) QtSupport::toTQString(env, constraint, &_qstring_constraint)); + return (jobject) KDESupport::arrayWithOfferList(env, (TDETrader::OfferList*) &_qlist); +} + +JNIEXPORT jobject JNICALL +Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring servicetype, jstring constraint, jstring preferences) +{ + TDETrader::OfferList _qlist; +static TQString* _qstring_servicetype = 0; +static TQString* _qstring_constraint = 0; +static TQString* _qstring_preferences = 0; + _qlist = ((TDETrader*) QtSupport::getQt(env, obj))->query((const TQString&)*(TQString*) QtSupport::toTQString(env, servicetype, &_qstring_servicetype), (const TQString&)*(TQString*) QtSupport::toTQString(env, constraint, &_qstring_constraint), (const TQString&)*(TQString*) QtSupport::toTQString(env, preferences, &_qstring_preferences)); + return (jobject) KDESupport::arrayWithOfferList(env, (TDETrader::OfferList*) &_qlist); +} + +JNIEXPORT jobject JNICALL +Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2(JNIEnv* env, jobject obj, jstring servicetype, jstring genericServiceType, jstring constraint, jstring preferences) +{ + TDETrader::OfferList _qlist; +static TQString* _qstring_servicetype = 0; +static TQString* _qstring_genericServiceType = 0; +static TQString* _qstring_constraint = 0; +static TQString* _qstring_preferences = 0; + _qlist = ((TDETrader*) QtSupport::getQt(env, obj))->query((const TQString&)*(TQString*) QtSupport::toTQString(env, servicetype, &_qstring_servicetype), (const TQString&)*(TQString*) QtSupport::toTQString(env, genericServiceType, &_qstring_genericServiceType), (const TQString&)*(TQString*) QtSupport::toTQString(env, constraint, &_qstring_constraint), (const TQString&)*(TQString*) QtSupport::toTQString(env, preferences, &_qstring_preferences)); + return (jobject) KDESupport::arrayWithOfferList(env, (TDETrader::OfferList*) &_qlist); +} + +JNIEXPORT jobject JNICALL +Java_org_kde_koala_TDETrader_self(JNIEnv* env, jclass cls) +{ + (void) cls; + jobject xret = QtSupport::objectForQtKey(env, (void*)TDETraderJBridge::self(), "org.kde.koala.TDETrader"); + return xret; +} + diff --git a/kdejava/koala/kdejava/TDETrader.h b/kdejava/koala/kdejava/TDETrader.h new file mode 100644 index 00000000..cbe91bc2 --- /dev/null +++ b/kdejava/koala/kdejava/TDETrader.h @@ -0,0 +1,29 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ + +#ifndef __org_kde_koala_TDETrader__ +#define __org_kde_koala_TDETrader__ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_metaObject (JNIEnv *env, jobject); +extern JNIEXPORT jstring JNICALL Java_org_kde_koala_TDETrader_className (JNIEnv *env, jobject); +extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jstring, jstring, jstring); +extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jstring, jstring); +extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2 (JNIEnv *env, jobject, jstring); +extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_query__Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2 (JNIEnv *env, jobject, jstring, jstring, jstring, jstring); +extern JNIEXPORT jobject JNICALL Java_org_kde_koala_TDETrader_self (JNIEnv *env, jclass); +extern JNIEXPORT void JNICALL Java_org_kde_koala_TDETrader_newTDETrader (JNIEnv *env, jobject); +extern JNIEXPORT void JNICALL Java_org_kde_koala_TDETrader_finalize (JNIEnv *env, jobject); +extern JNIEXPORT void JNICALL Java_org_kde_koala_TDETrader_dispose (JNIEnv *env, jobject); +extern JNIEXPORT jboolean JNICALL Java_org_kde_koala_TDETrader_isDisposed (JNIEnv *env, jobject); + +#ifdef __cplusplus +} +#endif + +#endif /* __org_kde_koala_TDETrader__ */ diff --git a/kdejava/koala/org/kde/koala/KTrader.java b/kdejava/koala/org/kde/koala/KTrader.java deleted file mode 100644 index 1a93eec0..00000000 --- a/kdejava/koala/org/kde/koala/KTrader.java +++ /dev/null @@ -1,155 +0,0 @@ -//Auto-generated by kalyptus. DO NOT EDIT. -package org.kde.koala; - -import org.kde.qt.Qt; -import org.kde.qt.TQMetaObject; -import org.kde.qt.QtSupport; -import java.util.ArrayList; -import org.kde.qt.TQObject; - -/** - - A Trader interface, similar to the CORBA Trader. - Basically, it provides a way for an application to query - all KDE services (that is, applications and components) that match - a specific set of requirements. This allows you to find an - application in real-time without you having to hard-code the name - and/or path of the application. It is mostly used when you want to - do complex queries that KServiceTypeProfile can't handle. - \par Examples - A few examples will make this a lot more clear. - Say you have an application that will display HTML. In this - example, you don't want to link to tdehtml... and furthermore, you - really don't care if the HTML browser is ours or not, as long as - it works. The way that you formulate your query as well as the way - that you execute the browser depends on whether or not you want the - browser to run stand-alone or embedded. - If you want the browser to run standalone, then you will limit the - query to search for all services that handle 'text/html' and, - furthermore, they must be applications (Type=Application). You - then will use KRun.run() to invoke the application. In "trader-speak", - this looks like so: -
- ArrayList offers = TDETrader.self().query("text/html", "Type == 'Application'");
- KService.Ptr ptr = offers.first();
- KURL.List lst;
- lst.append("http://www.kde.org/index.html");
- KRun.run(ptr, lst);
- 
- It should be noted that in the above example, using - KServiceTypeProfile would be the better choice since you would - probably want the preferred service and the trader doesn't take - this into account. The trader does allow you to do more complex - things, though. Say, for instance, you want to only choose - Netscape. You can do it with the constraint: "(Type == - 'Application') and (Name == 'Netscape')" - More the likely, though, you will only use the trader for such - things as finding components. In our continuing example, we say - that we want to load any KParts component that can handle HTML. We - will need to use the KLibFactory and KLibLoader to - actually do something with our query, then. Our code would look - like so: -
- ArrayList offers = TDETrader.self().query("text/html", "'KParts/ReadOnlyPart' in ServiceTypes");
- KService.Ptr ptr = offers.first();
- KLibFactory factory = KLibLoader.self().factory( ptr.library() );
- if (factory)
-   part = static_cast(factory.create(this, ptr.name(), "KParts.ReadOnlyPart"));
- 
- Please note that when including property names containing arithmetic operators like - or +, then you have - to put brackets around the property name, in order to correctly separate arithmetic operations from - the name. So for example a constraint expression like - X-TDE-Blah < 4 - needs to be written as - [X-TDE-Blah] < 4 - otherwise it could also be interpreted as - Substract the numeric value of the property "KDE" and "Blah" from the property "X" and make sure it - is less than 4. - Instead of the other meaning, make sure that the numeric value of "X-TDE-Blah" is less than 4. - See also the formal syntax defined in {@link #tradersyntax} . - @author Torben Weis - - @short Provides a way to query the KDE infrastructure for specific applications or components. - -*/ -public class TDETrader extends TQObject { - protected TDETrader(Class dummy){super((Class) null);} - public native TQMetaObject metaObject(); - public native String className(); - /** - The main function in the TDETrader class. - It will return a list of services that match your - specifications. The only required parameter is the service - type. This is something like 'text/plain' or 'text/html'. The - constraint parameter is used to limit the possible choices - returned based on the constraints you give it. - The constraint language is rather full. The most common - keywords are AND, OR, NOT, IN, and EXIST, all used in an - almost spoken-word form. An example is: -
-		 (Type == 'Service') and (('KParts/ReadOnlyPart' in ServiceTypes) or (exist Exec))
-		 
- The keys used in the query (Type, ServiceType, Exec) are all - fields found in the .desktop files. - @param servicetype A service type like 'text/plain', 'text/html', or 'KOfficePlugin'. - @param constraint A constraint to limit the choices returned, null to - get all services of the given servicetype - @param preferences Indicates a particular preference to return, null to ignore. - Uses an expression in the constraint language that must return - a number - @return A list of services that satisfy the query - - @short The main function in the TDETrader class. - @see #http://developer#kde#org/documentation/library/kdeqt/tradersyntax#html - */ - public native ArrayList query(String servicetype, String constraint, String preferences); - public native ArrayList query(String servicetype, String constraint); - public native ArrayList query(String servicetype); - /** - A variant of query(), that takes two service types as an input. - It is not exactly the same as adding the second service type - in the constraints of the other query call, because this one - takes into account user preferences for this combination of service types. - Example usage: - To get list of applications that can handle a given mimetype, - set servicetype to the mimetype and genericServiceType is "Application". - To get list of embeddable components that can handle a given mimetype, - set servicetype to the mimetype and genericServiceType is "KParts/ReadOnlyPart". - @param servicetype A service type like 'text/plain', 'text/html', or 'KOfficePlugin'. - @param genericServiceType a basic service type, like 'KParts/ReadOnlyPart' or 'Application' - @param constraint A constraint to limit the choices returned, null to - get all services of the given servicetype - @param preferences Indicates a particular preference to return, null to ignore. - Uses an expression in the constraint language that must return - a number - @return A list of services that satisfy the query - - @short A variant of query(), that takes two service types as an input. - @see #http://developer#kde#org/documentation/library/kdeqt/tradersyntax#html - */ - public native ArrayList query(String servicetype, String genericServiceType, String constraint, String preferences); - /** - This is a static pointer to a TDETrader instance. - You will need - to use this to access the TDETrader functionality since the - constuctors are protected. - @return Static TDETrader instance - - @short This is a static pointer to a TDETrader instance. - */ - public static native TDETrader self(); - /** - @short - */ - public TDETrader() { - super((Class) null); - newTDETrader(); - } - private native void newTDETrader(); - /** 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(); -} diff --git a/kdejava/koala/org/kde/koala/TDETrader.java b/kdejava/koala/org/kde/koala/TDETrader.java new file mode 100644 index 00000000..1a93eec0 --- /dev/null +++ b/kdejava/koala/org/kde/koala/TDETrader.java @@ -0,0 +1,155 @@ +//Auto-generated by kalyptus. DO NOT EDIT. +package org.kde.koala; + +import org.kde.qt.Qt; +import org.kde.qt.TQMetaObject; +import org.kde.qt.QtSupport; +import java.util.ArrayList; +import org.kde.qt.TQObject; + +/** + + A Trader interface, similar to the CORBA Trader. + Basically, it provides a way for an application to query + all KDE services (that is, applications and components) that match + a specific set of requirements. This allows you to find an + application in real-time without you having to hard-code the name + and/or path of the application. It is mostly used when you want to + do complex queries that KServiceTypeProfile can't handle. + \par Examples + A few examples will make this a lot more clear. + Say you have an application that will display HTML. In this + example, you don't want to link to tdehtml... and furthermore, you + really don't care if the HTML browser is ours or not, as long as + it works. The way that you formulate your query as well as the way + that you execute the browser depends on whether or not you want the + browser to run stand-alone or embedded. + If you want the browser to run standalone, then you will limit the + query to search for all services that handle 'text/html' and, + furthermore, they must be applications (Type=Application). You + then will use KRun.run() to invoke the application. In "trader-speak", + this looks like so: +
+ ArrayList offers = TDETrader.self().query("text/html", "Type == 'Application'");
+ KService.Ptr ptr = offers.first();
+ KURL.List lst;
+ lst.append("http://www.kde.org/index.html");
+ KRun.run(ptr, lst);
+ 
+ It should be noted that in the above example, using + KServiceTypeProfile would be the better choice since you would + probably want the preferred service and the trader doesn't take + this into account. The trader does allow you to do more complex + things, though. Say, for instance, you want to only choose + Netscape. You can do it with the constraint: "(Type == + 'Application') and (Name == 'Netscape')" + More the likely, though, you will only use the trader for such + things as finding components. In our continuing example, we say + that we want to load any KParts component that can handle HTML. We + will need to use the KLibFactory and KLibLoader to + actually do something with our query, then. Our code would look + like so: +
+ ArrayList offers = TDETrader.self().query("text/html", "'KParts/ReadOnlyPart' in ServiceTypes");
+ KService.Ptr ptr = offers.first();
+ KLibFactory factory = KLibLoader.self().factory( ptr.library() );
+ if (factory)
+   part = static_cast(factory.create(this, ptr.name(), "KParts.ReadOnlyPart"));
+ 
+ Please note that when including property names containing arithmetic operators like - or +, then you have + to put brackets around the property name, in order to correctly separate arithmetic operations from + the name. So for example a constraint expression like + X-TDE-Blah < 4 + needs to be written as + [X-TDE-Blah] < 4 + otherwise it could also be interpreted as + Substract the numeric value of the property "KDE" and "Blah" from the property "X" and make sure it + is less than 4. + Instead of the other meaning, make sure that the numeric value of "X-TDE-Blah" is less than 4. + See also the formal syntax defined in {@link #tradersyntax} . + @author Torben Weis + + @short Provides a way to query the KDE infrastructure for specific applications or components. + +*/ +public class TDETrader extends TQObject { + protected TDETrader(Class dummy){super((Class) null);} + public native TQMetaObject metaObject(); + public native String className(); + /** + The main function in the TDETrader class. + It will return a list of services that match your + specifications. The only required parameter is the service + type. This is something like 'text/plain' or 'text/html'. The + constraint parameter is used to limit the possible choices + returned based on the constraints you give it. + The constraint language is rather full. The most common + keywords are AND, OR, NOT, IN, and EXIST, all used in an + almost spoken-word form. An example is: +
+		 (Type == 'Service') and (('KParts/ReadOnlyPart' in ServiceTypes) or (exist Exec))
+		 
+ The keys used in the query (Type, ServiceType, Exec) are all + fields found in the .desktop files. + @param servicetype A service type like 'text/plain', 'text/html', or 'KOfficePlugin'. + @param constraint A constraint to limit the choices returned, null to + get all services of the given servicetype + @param preferences Indicates a particular preference to return, null to ignore. + Uses an expression in the constraint language that must return + a number + @return A list of services that satisfy the query + + @short The main function in the TDETrader class. + @see #http://developer#kde#org/documentation/library/kdeqt/tradersyntax#html + */ + public native ArrayList query(String servicetype, String constraint, String preferences); + public native ArrayList query(String servicetype, String constraint); + public native ArrayList query(String servicetype); + /** + A variant of query(), that takes two service types as an input. + It is not exactly the same as adding the second service type + in the constraints of the other query call, because this one + takes into account user preferences for this combination of service types. + Example usage: + To get list of applications that can handle a given mimetype, + set servicetype to the mimetype and genericServiceType is "Application". + To get list of embeddable components that can handle a given mimetype, + set servicetype to the mimetype and genericServiceType is "KParts/ReadOnlyPart". + @param servicetype A service type like 'text/plain', 'text/html', or 'KOfficePlugin'. + @param genericServiceType a basic service type, like 'KParts/ReadOnlyPart' or 'Application' + @param constraint A constraint to limit the choices returned, null to + get all services of the given servicetype + @param preferences Indicates a particular preference to return, null to ignore. + Uses an expression in the constraint language that must return + a number + @return A list of services that satisfy the query + + @short A variant of query(), that takes two service types as an input. + @see #http://developer#kde#org/documentation/library/kdeqt/tradersyntax#html + */ + public native ArrayList query(String servicetype, String genericServiceType, String constraint, String preferences); + /** + This is a static pointer to a TDETrader instance. + You will need + to use this to access the TDETrader functionality since the + constuctors are protected. + @return Static TDETrader instance + + @short This is a static pointer to a TDETrader instance. + */ + public static native TDETrader self(); + /** + @short + */ + public TDETrader() { + super((Class) null); + newTDETrader(); + } + private native void newTDETrader(); + /** 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(); +} -- cgit v1.2.1