//Auto-generated by kalyptus. DO NOT EDIT.
namespace Kimono {
    using System;
    using Qyoto;
    using System.Collections.Generic;
    /// <remarks>
    ///  KDE's trader interface (similar to the CORBA Trader), which provides a way
    ///  to query the KDE infrastructure for specific applications or components.
    ///  Basically, KServiceTypeTrader provides a way for an application to query
    ///  all KDE services (that is, applications, components, plugins) that match
    ///  a specific set of requirements. This allows to find specific services
    ///  at run-time without having to hard-code their names and/or paths.
    ///  For anything relating to mimetypes (type of files), ignore KServiceTypeTrader
    ///  and use KMimeTypeTrader instead.
    ///  \par Example
    ///  If you want to find all plugins for your application,
    ///  you would define a KMyApp/Plugin servicetype, and then you can query
    ///  the trader for it:
    ///  <pre>
    ///  KService.List offers =
    ///      KServiceTypeTrader.Self().Query("KMyApp/Plugin");
    ///  </pre>
    ///  You can add a constraint in the "trader query language". For instance:
    ///  <pre>
    ///  KServiceTypeTrader.Self().Query("KMyApp/Plugin",
    ///                                    "[X-KMyApp-InterfaceVersion] > 15");
    ///  </pre>
    ///  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
    ///  <pre>
    ///  X-KMyApp-InterfaceVersion > 4 // wrong!
    ///  </pre>
    ///  needs to be written as
    ///  <pre>
    ///  [X-KMyApp-InterfaceVersion] > 4
    ///  </pre>
    ///  otherwise it could also be interpreted as
    ///  Substract the numeric value of the property "KMyApp" and "InterfaceVersion" from the
    ///  property "X" and make sure it is greater than 4.\n
    ///  Instead of the other meaning, make sure that the numeric value of "X-KMyApp-InterfaceVersion" is
    ///  greater than 4.
    /// </remarks>        <short>    KDE's trader interface (similar to the CORBA Trader), which provides a way  to query the KDE infrastructure for specific applications or components.</short>
    ///         <see> KMimeTypeTrader</see>
    ///         <see> KService</see>
    [SmokeClass("KServiceTypeTrader")]
    public class KServiceTypeTrader : Object {
        protected SmokeInvocation interceptor = null;
        private IntPtr smokeObject;
        protected KServiceTypeTrader(Type dummy) {}
        protected void CreateProxy() {
            interceptor = new SmokeInvocation(typeof(KServiceTypeTrader), this);
        }
        private static SmokeInvocation staticInterceptor = null;
        static KServiceTypeTrader() {
            staticInterceptor = new SmokeInvocation(typeof(KServiceTypeTrader), null);
        }
        /// <remarks>
        ///  The main function in the KServiceTypeTrader 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 <code>constraint</code> 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:
        ///  <pre>
        ///  (Type == 'Service') and (('KParts/ReadOnlyPart' in ServiceTypes) or (exist Exec))
        ///  </pre>
        ///  The keys used in the query (Type, ServiceType, Exec) are all
        ///  fields found in the .desktop files.
        /// <param> name="servicetype" A service type like 'KMyApp/Plugin' or 'KFilePlugin'.
        /// </param><param> name="constraint" A constraint to limit the choices returned, string() to
        ///                     get all services of the given <code>servicetype</code>
        /// </param></remarks>        <return> A list of services that satisfy the query
        /// </return>
        ///         <short>    The main function in the KServiceTypeTrader class.</short>
        ///         <see> http://techbase.kde.org/Development/Tutorials/Services/Traders#The_KTrader_Query_Language</see>
        public List<KService> Query(string servicetype, string constraint) {
            return (List<KService>) interceptor.Invoke("query$$", "query(const QString&, const QString&) const", typeof(List<KService>), typeof(string), servicetype, typeof(string), constraint);
        }
        public List<KService> Query(string servicetype) {
            return (List<KService>) interceptor.Invoke("query$", "query(const QString&) const", typeof(List<KService>), typeof(string), servicetype);
        }
        /// <remarks>
        ///  Returns all offers associated with a given servicetype, IGNORING the
        ///  user preference. The sorting will be the one coming from the InitialPreference
        ///  in the .desktop files, and services disabled by the user will still be listed here.
        ///  This is used for "Revert to defaults" buttons in GUIs.
        ///      </remarks>        <short>    Returns all offers associated with a given servicetype, IGNORING the  user preference.</short>
        public List<KService> DefaultOffers(string serviceType, string constraint) {
            return (List<KService>) interceptor.Invoke("defaultOffers$$", "defaultOffers(const QString&, const QString&) const", typeof(List<KService>), typeof(string), serviceType, typeof(string), constraint);
        }
        public List<KService> DefaultOffers(string serviceType) {
            return (List<KService>) interceptor.Invoke("defaultOffers$", "defaultOffers(const QString&) const", typeof(List<KService>), typeof(string), serviceType);
        }
        /// <remarks>
        ///  Returns the preferred service for <code>serviceType.</code>
        /// <param> name="serviceType" the service type (e.g. "KMyApp/Plugin")
        /// </param></remarks>        <return> the preferred service, or 0 if no service is available
        ///      </return>
        ///         <short>    Returns the preferred service for <code>serviceType.</code></short>
        public KService PreferredService(string serviceType) {
            return (KService) interceptor.Invoke("preferredService$", "preferredService(const QString&) const", typeof(KService), typeof(string), serviceType);
        }
        /// <remarks>
        ///  This is a static pointer to the KServiceTypeTrader singleton.
        ///  You will need to use this to access the KServiceTypeTrader functionality since the
        ///  constructors are protected.
        /// </remarks>        <return> Static KServiceTypeTrader instance
        ///      </return>
        ///         <short>    This is a static pointer to the KServiceTypeTrader singleton.</short>
        public static KServiceTypeTrader Self() {
            return (KServiceTypeTrader) staticInterceptor.Invoke("self", "self()", typeof(KServiceTypeTrader));
        }
        /// <remarks>
        ///      </remarks>        <short>   </short>
        public static void ApplyConstraints(List<KService> lst, string constraint) {
            staticInterceptor.Invoke("applyConstraints?$", "applyConstraints(QList<KSharedPtr<KService> >&, const QString&)", typeof(void), typeof(List<KService>), lst, typeof(string), constraint);
        }
    }
}
