Git commit ca26344c8d2b650417c72baedfb3957032f517ee by Simon Edwards. Committed on 22/03/2014 at 15:02. Pushed by sedwards into branch 'master'. Added kcodeaddons support. M +12 -3 CMakeLists.txt A +154 -0 sip/kcoreaddons/kaboutdata.sip A +36 -0 sip/kcoreaddons/kautosavefile.sip A +30 -0 sip/kcoreaddons/kbackup.sip A +38 -0 sip/kcoreaddons/kcompositejob.sip A +49 -0 sip/kcoreaddons/kcoreaddonsmod.sip A +67 -0 sip/kcoreaddons/kdirwatch.sip A +36 -0 sip/kcoreaddons/kfilesystemtype_p.sip A +67 -0 sip/kcoreaddons/kformat.sip A +103 -0 sip/kcoreaddons/kjob.sip A +43 -0 sip/kcoreaddons/kjobtrackerinterface.sip A +40 -0 sip/kcoreaddons/kjobuidelegate.sip A +87 -0 sip/kcoreaddons/kmacroexpander.sip A +42 -0 sip/kcoreaddons/kmessage.sip A +60 -0 sip/kcoreaddons/kprocess.sip A +28 -0 sip/kcoreaddons/krandom.sip A +36 -0 sip/kcoreaddons/krandomsequence.sip A +47 -0 sip/kcoreaddons/kshareddatacache.sip A +43 -0 sip/kcoreaddons/kshell.sip A +38 -0 sip/kcoreaddons/kstringhandler.sip A +35 -0 sip/kcoreaddons/kurlmimedata.sip A +89 -0 sip/kcoreaddons/kuser.sip http://commits.kde.org/pykde5/ca26344c8d2b650417c72baedfb3957032f517ee diff --git a/CMakeLists.txt b/CMakeLists.txt index 4be8899..c0f8802 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ include(PythonMacros) include(FeatureSummary) include(ECMSetupVersion) = -find_package(KF5 CONFIG REQUIRED Auth ItemModels ItemViews Archive Plottin= g Solid) +find_package(KF5 CONFIG REQUIRED Auth ItemModels ItemViews Archive Plottin= g Solid CoreAddons Sonnet) = #option(PYKDEUIC4_ALTINSTALL "Enable parallel-installation of the PyKDE4 t= ools" FALSE) = @@ -130,11 +130,20 @@ add_sip_python_module(PyKDE5.kplotting sip/kplotting/= kplottingmod.sip KF5::Plott # solid file(GLOB solid_files_sip sip/solid/*.sip) set(SIP_EXTRA_FILES_DEPEND ${solid_files_sip}) +add_sip_python_module(PyKDE5.solid sip/solid/solidmod.sip KF5::Solid) = +## kcoreaddons +file(GLOB kcoreaddons_files_sip sip/kcoreaddons/*.sip) +set(SIP_EXTRA_FILES_DEPEND ${kcoreaddons_files_sip}) +add_sip_python_module(PyKDE5.kcoreaddons sip/kcoreaddons/kcoreaddonsmod.si= p KF5::CoreAddons) + +# sonnet +#file(GLOB sonnet_files_sip sip/sonnet/*.sip) +#set(SIP_EXTRA_FILES_DEPEND ${sonnet_files_sip}) +#add_sip_python_module(PyKDE5.sonnet sip/sonnet/sonnetmod.sip KF5::SonnetC= ore KF5::SonnetUi) = -add_sip_python_module(PyKDE5.solid sip/solid/solidmod.sip KF5::Solid) = -set(PYKDE_MODULES "kitemmodels kitemviews karchive kplotting solid") +set(PYKDE_MODULES "kitemmodels kitemviews karchive kplotting solid kcoread= dons") = ##########################################################################= ##### = diff --git a/sip/kcoreaddons/kaboutdata.sip b/sip/kcoreaddons/kaboutdata.sip new file mode 100644 index 0000000..38485a7 --- /dev/null +++ b/sip/kcoreaddons/kaboutdata.sip @@ -0,0 +1,154 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +//namespace KCrash +//{ +//ig void defaultCrashHandler (int sig); +//}; + +class KAboutPerson +{ +%TypeHeaderCode +#include +%End + +public: + explicit KAboutPerson (const QString& name, const QStri= ng& task =3D QString(), const QString& emailAddress =3D QString(), const QS= tring& webAddress =3D QString(), const QString& ocsUsername =3D QString()); + KAboutPerson (const KAboutPerson& other); + ~KAboutPerson (); + QString name () const; + QString task () const; + QString emailAddress () const; + QString webAddress () const; + QString ocsUsername () const; +private: + explicit KAboutPerson (const QString& name, const QStri= ng& email, bool disambiguation); +public: +//ig KAboutPerson& operator=3D (const KAboutPerson& other); +}; +class KAboutData +{ +%TypeHeaderCode +#include +%End + +public: + static KAboutData applicationData (); + static void setApplicationData (const KAboutData& aboutDat= a); + static void registerPluginData (const KAboutData& aboutDat= a); + static KAboutData* pluginData (const QString& componentName); + enum LicenseKey + { + License_Custom, + License_File, + License_Unknown, + License_GPL, + License_GPL_V2, + License_LGPL, + License_LGPL_V2, + License_BSD, + License_Artistic, + License_QPL, + License_QPL_V1_0, + License_GPL_V3, + License_LGPL_V3 + }; + enum NameFormat + { + ShortName, + FullName + }; + KAboutData (const QString& componentName, cons= t QString& catalogName, const QString& displayName, const QString& version,= const QString& shortDescription =3D QString(), KAboutData::LicenseKey lice= nseType =3D KAboutData::LicenseKey::License_Unknown, const QString& copyrig= htStatement =3D QString(), const QString& otherText =3D QString(), const QS= tring& homePageAddress =3D QString(), const QString& bugsEmailAddress =3D Q= Latin1String("submit@bugs.kde.org")); + KAboutData (const KAboutData& other); + ~KAboutData (); + KAboutData& addAuthor (const QString& name, const QString&= task =3D QString(), const QString& emailAddress =3D QString(), const QStri= ng& webAddress =3D QString(), const QString& ocsUsername =3D QString()); + KAboutData& addCredit (const QString& name, const QString&= task =3D QString(), const QString& emailAddress =3D QString(), const QStri= ng& webAddress =3D QString(), const QString& ocsUserName =3D QString()); + KAboutData& setTranslator (const QString& name, const QStr= ing& emailAddress); + KAboutData& setLicenseText (const QString& license); + KAboutData& addLicenseText (const QString& license); + KAboutData& setLicenseTextFile (const QString& file); + KAboutData& addLicenseTextFile (const QString& file); + KAboutData& setComponentName (const QString& componentName= ); + KAboutData& setDisplayName (const QString& displayName); + KAboutData& setProgramIconName (const QString& iconName); + KAboutData& setProgramLogo (const QVariant& image); + KAboutData& setOcsProvider (const QString& providerUrl); + KAboutData& setVersion (const QByteArray& version); + KAboutData& setShortDescription (const QString& shortDescr= iption); + KAboutData& setCatalogName (const QString& catalogName); + KAboutData& setLicense (KAboutData::LicenseKey licenseKey); + KAboutData& addLicense (KAboutData::LicenseKey licenseKey); + KAboutData& setCopyrightStatement (const QString& copyrigh= tStatement); + KAboutData& setOtherText (const QString& otherText); + KAboutData& setHomepage (const QString& homepage); + KAboutData& setBugAddress (const QByteArray& bugAddress); + KAboutData& setOrganizationDomain (const QByteArray& domai= n); + KAboutData& setProductName (const QByteArray& name); + QString componentName () const; + QString productName () const; + QString displayName () const; + QString organizationDomain () const; + const char* internalProgramName () const; + QString programIconName () const; + QVariant programLogo () const; + QString ocsProviderUrl () const; + QString version () const; + const char* internalVersion () const; + QString shortDescription () const; + QString catalogName () const; + QString homepage () const; + QString bugAddress () const; + const char* internalBugAddress () const; + QList authors () const; + QList credits () const; + QList translators () const; + static QString aboutTranslationTeam (); + QString otherText () const; + QString license () const; + QString licenseName (KAboutData::NameFormat formatName= ) const; + QList licenses () const; + QString copyrightStatement () const; + QString customAuthorPlainText () const; + QString customAuthorRichText () const; + bool customAuthorTextEnabled () const; + KAboutData& setCustomAuthorText (const QString& plainText,= const QString& richText); + KAboutData& unsetCustomAuthorText (); +//ig bool setupCommandLine (QCommandLineParser* pars= er); +//ig void processCommandLine (QCommandLineParser* pa= rser); +//ig KAboutData& operator=3D (const KAboutData& other); +}; +class KAboutLicense +{ +%TypeHeaderCode +#include +%End + +public: + KAboutLicense (const KAboutLicense& other); + ~KAboutLicense (); + QString text () const; + QString name (KAboutData::NameFormat formatName) const; + KAboutData::LicenseKey key () const; + static KAboutLicense byKeyword (const QString& keyword); +private: + explicit KAboutLicense (KAboutData::LicenseKey licenseT= ype, const KAboutData* aboutData); + explicit KAboutLicense (const KAboutData* aboutData); +public: +//ig KAboutLicense& operator=3D (const KAboutLicense& other); +}; diff --git a/sip/kcoreaddons/kautosavefile.sip b/sip/kcoreaddons/kautosavef= ile.sip new file mode 100644 index 0000000..a451d65 --- /dev/null +++ b/sip/kcoreaddons/kautosavefile.sip @@ -0,0 +1,36 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class KAutoSaveFile : QFile +{ +%TypeHeaderCode +#include +%End + +public: + explicit KAutoSaveFile (const QUrl& filename, QObject* = parent =3D 0); + explicit KAutoSaveFile (QObject* parent =3D 0); + ~KAutoSaveFile (); + QUrl managedFile () const; + void setManagedFile (const QUrl& filename); + virtual void releaseLock (); + virtual bool open (QIODevice::OpenMode openmode); + static QList staleFiles (const QUrl& url, const QStri= ng& applicationName =3D QString()); + static QList allStaleFiles (const QString& applicatio= nName =3D QString()); +}; diff --git a/sip/kcoreaddons/kbackup.sip b/sip/kcoreaddons/kbackup.sip new file mode 100644 index 0000000..9a57d65 --- /dev/null +++ b/sip/kcoreaddons/kbackup.sip @@ -0,0 +1,30 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +%ModuleHeaderCode +#include +%End + +namespace KBackup +{ +bool backupFile (const QString& filename, const QString= & backupDir =3D QString()); +bool simpleBackupFile (const QString& filename, const Q= String& backupDir =3D QString(), const QString& backupExtension =3D QLatin1= String("~")); +bool numberedBackupFile (const QString& filename, const= QString& backupDir =3D QString(), const QString& backupExtension =3D QStri= ng::fromLatin1("~"), const uint maxBackups =3D 10); +bool rcsBackupFile (const QString& filename, const QStr= ing& backupDir =3D QString(), const QString& backupMessage =3D QString()); +}; diff --git a/sip/kcoreaddons/kcompositejob.sip b/sip/kcoreaddons/kcomposite= job.sip new file mode 100644 index 0000000..3ce6ed5 --- /dev/null +++ b/sip/kcoreaddons/kcompositejob.sip @@ -0,0 +1,38 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class KCompositeJob : KJob +{ +%TypeHeaderCode +#include +%End + +public: + explicit KCompositeJob (QObject* parent =3D 0); + virtual ~KCompositeJob (); +protected: + virtual bool addSubjob (KJob* job); + virtual bool removeSubjob (KJob* job); + bool hasSubjobs () const; + const QList& subjobs () const; + void clearSubjobs (); + virtual void slotResult (KJob* job); + virtual void slotInfoMessage (KJob* job, const QString& pla= in, const QString& rich); +//ig KCompositeJob (KCompositeJobPrivate& dd, Q= Object* parent); +}; diff --git a/sip/kcoreaddons/kcoreaddonsmod.sip b/sip/kcoreaddons/kcoreaddo= nsmod.sip new file mode 100644 index 0000000..753c345 --- /dev/null +++ b/sip/kcoreaddons/kcoreaddonsmod.sip @@ -0,0 +1,49 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +%Module PyKDE5.kcoreaddons + +%ModuleHeaderCode +#pragma GCC visibility push(default) +%End + +%Import typedefs.sip +%Import QtCore/QtCoremod.sip + +%Include kfilesystemtype_p.sip +%Include kaboutdata.sip +%Include kautosavefile.sip +%Include kbackup.sip +%Include kcompositejob.sip +%Include kdirwatch.sip +// FIXME doesn't compile, problem in the .h file. +// %Include kformat.sip +%Include kjob.sip +%Include kjobtrackerinterface.sip +%Include kjobuidelegate.sip +%Include kmacroexpander.sip +%Include kmessage.sip +%Include kprocess.sip +%Include krandom.sip +%Include krandomsequence.sip +%Include kshareddatacache.sip +%Include kshell.sip +%Include kstringhandler.sip +%Include kurlmimedata.sip +%Include kuser.sip diff --git a/sip/kcoreaddons/kdirwatch.sip b/sip/kcoreaddons/kdirwatch.sip new file mode 100644 index 0000000..a261890 --- /dev/null +++ b/sip/kcoreaddons/kdirwatch.sip @@ -0,0 +1,67 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class KDirWatch : QObject +{ +%TypeHeaderCode +#include +%End + +public: + enum WatchMode + { + WatchDirOnly, + WatchFiles, + WatchSubDirs + }; + typedef QFlags WatchModes; + KDirWatch (QObject* parent =3D 0); + ~KDirWatch (); + void addDir (const QString& path, KDirWatch::WatchM= odes watchModes =3D KDirWatch::WatchMode::WatchDirOnly); + void addFile (const QString& file); + QDateTime ctime (const QString& path) const; + void removeDir (const QString& path); + void removeFile (const QString& file); + bool stopDirScan (const QString& path); + bool restartDirScan (const QString& path); + void startScan (bool notify =3D 0, bool skippedToo = =3D 0); + void stopScan (); + bool isStopped (); + bool contains (const QString& path) const; + void deleteQFSWatcher (); + static void statistics (); + enum Method + { + FAM, + INotify, + DNotify, + Stat, + QFSWatch + }; + KDirWatch::Method internalMethod () const; + static KDirWatch* self (); + static bool exists (); + void setCreated (const QString& path); + void setDirty (const QString& path); + void setDeleted (const QString& path); +signals: + void dirty (const QString& path); + void created (const QString& path); + void deleted (const QString& path); +}; diff --git a/sip/kcoreaddons/kfilesystemtype_p.sip b/sip/kcoreaddons/kfiles= ystemtype_p.sip new file mode 100644 index 0000000..fa655a8 --- /dev/null +++ b/sip/kcoreaddons/kfilesystemtype_p.sip @@ -0,0 +1,36 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +%ModuleHeaderCode +#include +%End + +namespace KFileSystemType +{ +enum Type +{ + Unknown, + Nfs, + Smb, + Fat, + Ramfs, + Other +}; +KFileSystemType::Type fileSystemType (const QString& path); +}; diff --git a/sip/kcoreaddons/kformat.sip b/sip/kcoreaddons/kformat.sip new file mode 100644 index 0000000..9d8e713 --- /dev/null +++ b/sip/kcoreaddons/kformat.sip @@ -0,0 +1,67 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class KFormat /NoDefaultCtors/ +{ +%TypeHeaderCode +#include +%End + +public: + enum BinarySizeUnits + { + DefaultBinaryUnits, + UnitByte, + UnitKiloByte, + UnitMegaByte, + UnitGigaByte, + UnitTeraByte, + UnitPetaByte, + UnitExaByte, + UnitZettaByte, + UnitYottaByte, + UnitLastUnit + }; + enum BinaryUnitDialect + { + DefaultBinaryDialect, + IECBinaryDialect, + JEDECBinaryDialect, + MetricBinaryDialect, + LastBinaryDialect + }; + enum DurationFormatOption + { + DefaultDuration, + InitialDuration, + ShowMilliseconds, + HideSeconds, + FoldHours + }; + typedef QFlags DurationFormatOptions; + explicit KFormat (const QLocale& locale =3D QLocale()); + KFormat (const KFormat& other); + ~KFormat (); + QString formatByteSize (double size, int precision =3D= 1, KFormat::BinaryUnitDialect dialect =3D KFormat::DefaultBinaryDialect, K= Format::BinarySizeUnits units =3D KFormat::DefaultBinaryUnits) const; + QString formatDuration (quint64 msecs, KFormat::Durati= onFormatOptions options =3D KFormat::DefaultDuration) const; + QString formatDecimalDuration (quint64 msecs, int deci= malPlaces =3D 2) const; + QString formatSpelloutDuration (quint64 msecs) const; + QString formatRelativeDate (const QDate& date, QLocale= ::FormatType format) const; + QString formatRelativeDateTime (const QDateTime& dateT= ime, QLocale::FormatType format) const; +}; diff --git a/sip/kcoreaddons/kjob.sip b/sip/kcoreaddons/kjob.sip new file mode 100644 index 0000000..c8c3c31 --- /dev/null +++ b/sip/kcoreaddons/kjob.sip @@ -0,0 +1,103 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class KJob : QObject +{ +%TypeHeaderCode +#include +%End + +public: + enum Unit + { + Bytes, + Files, + Directories + }; + enum Capability + { + NoCapabilities, + Killable, + Suspendable + }; + typedef QFlags Capabilities; + explicit KJob (QObject* parent =3D 0); + virtual ~KJob (); + void setUiDelegate (KJobUiDelegate* delegate); + KJobUiDelegate* uiDelegate () const; + KJob::Capabilities capabilities () const; + bool isSuspended () const; + virtual void start ()=3D0; + enum KillVerbosity + { + Quietly, + EmitResult + }; + bool kill (KJob::KillVerbosity verbosity =3D KJob::= KillVerbosity::Quietly); + bool suspend (); + bool resume (); +protected: + virtual bool doKill (); + virtual bool doSuspend (); + virtual bool doResume (); + void setCapabilities (KJob::Capabilities capabiliti= es); +public: + bool exec (); + enum + { + NoError, + KilledJobError, + UserDefinedError + }; + int error () const; + QString errorText () const; + virtual QString errorString () const; + qulonglong processedAmount (KJob::Unit unit) const; + qulonglong totalAmount (KJob::Unit unit) const; + unsigned long percent () const; + void setAutoDelete (bool autodelete); + bool isAutoDelete () const; +signals: +//ig void finished (KJob* job, QPrivateSignal); +//ig void suspended (KJob* job, QPrivateSignal); +//ig void resumed (KJob* job, QPrivateSignal); +//ig void result (KJob* job, QPrivateSignal); + +//force + void finished (KJob* job); + void suspended (KJob* job); + void resumed (KJob* job); + void result (KJob* job); +//end + +// FIXME +//ig void description (KJob* job, const QString& tit= le, const QPair& field1 =3D qMakePair(QString(),QString())= , const QPair& field2 =3D qMakePair(QString(),QString())); + void infoMessage (KJob* job, const QString& plain, = const QString& rich =3D QString()); + void warning (KJob* job, const QString& plain, cons= t QString& rich =3D QString()); +protected: + void setError (int errorCode); + void setErrorText (const QString& errorText); + void setProcessedAmount (KJob::Unit unit, qulonglon= g amount); + void setTotalAmount (KJob::Unit unit, qulonglong am= ount); + void setPercent (unsigned long percentage); + void emitResult (); + void emitPercent (qulonglong processedAmount, qulon= glong totalAmount); + void emitSpeed (unsigned long speed); +//ig KJob (KJobPrivate& dd, QObject* parent); +}; diff --git a/sip/kcoreaddons/kjobtrackerinterface.sip b/sip/kcoreaddons/kjo= btrackerinterface.sip new file mode 100644 index 0000000..07284ef --- /dev/null +++ b/sip/kcoreaddons/kjobtrackerinterface.sip @@ -0,0 +1,43 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class KJobTrackerInterface : QObject +{ +%TypeHeaderCode +#include +%End + +public: + KJobTrackerInterface (QObject* parent =3D 0); + virtual ~KJobTrackerInterface (); + virtual void registerJob (KJob* job); + virtual void unregisterJob (KJob* job); +protected: + virtual void finished (KJob* job); + virtual void suspended (KJob* job); + virtual void resumed (KJob* job); +// FIXME +//ig virtual void description (KJob* job, const QString& tit= le, const QPair& field1, const QPair& fie= ld2); + virtual void infoMessage (KJob* job, const QString& plain, = const QString& rich); + virtual void warning (KJob* job, const QString& plain, cons= t QString& rich); + virtual void totalAmount (KJob* job, KJob::Unit unit, qulon= glong amount); + virtual void processedAmount (KJob* job, KJob::Unit unit, q= ulonglong amount); + virtual void percent (KJob* job, unsigned long percent); + virtual void speed (KJob* job, unsigned long value); +}; diff --git a/sip/kcoreaddons/kjobuidelegate.sip b/sip/kcoreaddons/kjobuidel= egate.sip new file mode 100644 index 0000000..82107ba --- /dev/null +++ b/sip/kcoreaddons/kjobuidelegate.sip @@ -0,0 +1,40 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class KJobUiDelegate : QObject +{ +%TypeHeaderCode +#include +%End + +public: + KJobUiDelegate (); + virtual ~KJobUiDelegate (); +protected: + virtual bool setJob (KJob* job); + KJob* job () const; +public: + virtual void showErrorMessage (); + void setAutoErrorHandlingEnabled (bool enable); + bool isAutoErrorHandlingEnabled () const; + void setAutoWarningHandlingEnabled (bool enable); + bool isAutoWarningHandlingEnabled () const; +protected: + virtual void slotWarning (KJob* job, const QString& plain, = const QString& rich); +}; diff --git a/sip/kcoreaddons/kmacroexpander.sip b/sip/kcoreaddons/kmacroexp= ander.sip new file mode 100644 index 0000000..a27f9d5 --- /dev/null +++ b/sip/kcoreaddons/kmacroexpander.sip @@ -0,0 +1,87 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class KMacroExpanderBase /NoDefaultCtors/ +{ +%TypeHeaderCode +#include +%End + +public: + explicit KMacroExpanderBase (QChar c =3D QLatin1Char('%= ')); + virtual ~KMacroExpanderBase (); + void expandMacros (QString& str); + bool expandMacrosShellQuote (QString& str, int& pos= ); +//ig bool expandMacrosShellQuote (QString& str); + void setEscapeChar (QChar c); + QChar escapeChar () const; +protected: + virtual int expandPlainMacro (const QString& str, int pos,= QStringList& ret); + virtual int expandEscapedMacro (const QString& str, int po= s, QStringList& ret); +%ConvertToSubClassCode + // CTSCC for subclasses of 'KMacroExpanderBase' + sipType =3D NULL; + + if (dynamic_cast(sipCpp)) + sipType =3D sipType_KCharMacroExpander; + else if (dynamic_cast(sipCpp)) + sipType =3D sipType_KWordMacroExpander; +%End +}; +class KWordMacroExpander : KMacroExpanderBase +{ +%TypeHeaderCode +#include +%End + +public: + explicit KWordMacroExpander (QChar c =3D QLatin1Char('%= ')); +protected: + virtual int expandPlainMacro (const QString& str, int pos,= QStringList& ret); + virtual int expandEscapedMacro (const QString& str, int po= s, QStringList& ret); + virtual bool expandMacro (const QString& str, QStringList& = ret)=3D0; +}; +class KCharMacroExpander : KMacroExpanderBase +{ +%TypeHeaderCode +#include +%End + +public: + explicit KCharMacroExpander (QChar c =3D QLatin1Char('%= ')); +protected: + virtual int expandPlainMacro (const QString& str, int pos,= QStringList& ret); + virtual int expandEscapedMacro (const QString& str, int po= s, QStringList& ret); + virtual bool expandMacro (QChar chr, QStringList& ret)=3D0; +}; +namespace KMacroExpander +{ +QString expandMacros (const QString& str, const QHash& map, QChar c =3D QLatin1Char('%')); +//ig QString expandMacrosShellQuote (const QString& str, c= onst QHash& map, QChar c =3D QLatin1Char('%')); +QString expandMacros (const QString& str, const QHash& map, QChar c =3D QLatin1Char('%')); +//ig QString expandMacrosShellQuote (const QString& str, c= onst QHash& map, QChar c =3D QLatin1Char('%')); +QString expandMacros (const QString& str, const QHash& map, QChar c =3D QLatin1Char('%')); +QString expandMacros (const QString& str, const QHash& map, QChar c =3D QLatin1Char('%')); +//ig QString expandMacrosShellQuote (const QString& str, c= onst QHash& map, QChar c =3D QLatin1Char('%')); +QString expandMacrosShellQuote (const QString& str, const = QHash& map, QChar c =3D QLatin1Char('%')); +}; +%ModuleHeaderCode +//ctscc +#include +%End diff --git a/sip/kcoreaddons/kmessage.sip b/sip/kcoreaddons/kmessage.sip new file mode 100644 index 0000000..5ccfafb --- /dev/null +++ b/sip/kcoreaddons/kmessage.sip @@ -0,0 +1,42 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +%ModuleHeaderCode +#include +%End +namespace KMessage +{ +enum MessageType +{ + Error, + Information, + Warning, + Sorry, + Fatal +}; +void message (KMessage::MessageType messageType, const = QString& text, const QString& caption =3D QString()); +void setMessageHandler (KMessageHandler* handler); +}; +class KMessageHandler +{ + +public: + virtual ~KMessageHandler (); + virtual void message (KMessage::MessageType type, const QSt= ring& text, const QString& caption)=3D0; +}; diff --git a/sip/kcoreaddons/kprocess.sip b/sip/kcoreaddons/kprocess.sip new file mode 100644 index 0000000..d9ec15d --- /dev/null +++ b/sip/kcoreaddons/kprocess.sip @@ -0,0 +1,60 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class KProcess : QProcess +{ +%TypeHeaderCode +#include +%End + +public: + enum OutputChannelMode + { + SeparateChannels, + MergedChannels, + ForwardedChannels, + OnlyStdoutChannel, + OnlyStderrChannel + }; + explicit KProcess (QObject* parent =3D 0); + virtual ~KProcess (); + void setOutputChannelMode (KProcess::OutputChannelM= ode mode); + KProcess::OutputChannelMode outputChannelMode () const; + void setNextOpenMode (QIODevice::OpenMode mode); + void setEnv (const QString& name, const QString& va= lue, bool overwrite =3D 1); + void unsetEnv (const QString& name); + void clearEnvironment (); + void setProgram (const QString& exe, const QStringL= ist& args =3D QStringList()); + void setProgram (const QStringList& argv); + KProcess& operator<< (const QString& arg); + KProcess& operator<< (const QStringList& args); + void clearProgram (); + void setShellCommand (const QString& cmd); + QStringList program () const; + void start (); + int execute (int msecs =3D -1); + static int execute (const QString& exe, const QStringList= & args =3D QStringList(), int msecs =3D -1); + static int execute (const QStringList& argv, int msecs = =3D -1); + int startDetached (); + static int startDetached (const QString& exe, const QStri= ngList& args =3D QStringList()); + static int startDetached (const QStringList& argv); + int pid () const; +protected: +//ig KProcess (KProcessPrivate* d, QObject* par= ent); +}; diff --git a/sip/kcoreaddons/krandom.sip b/sip/kcoreaddons/krandom.sip new file mode 100644 index 0000000..7fafdc4 --- /dev/null +++ b/sip/kcoreaddons/krandom.sip @@ -0,0 +1,28 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +%ModuleHeaderCode +#include +%End + +namespace KRandom +{ +int random (); +QString randomString (int length); +}; diff --git a/sip/kcoreaddons/krandomsequence.sip b/sip/kcoreaddons/krandoms= equence.sip new file mode 100644 index 0000000..37209a1 --- /dev/null +++ b/sip/kcoreaddons/krandomsequence.sip @@ -0,0 +1,36 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class KRandomSequence +{ +%TypeHeaderCode +#include +%End + +public: + explicit KRandomSequence (long lngSeed =3D 0); + virtual ~KRandomSequence (); + KRandomSequence (const KRandomSequence& a); +//ig KRandomSequence& operator=3D (const KRandomSequence& a); + void setSeed (long lngSeed =3D 0); + double getDouble (); + unsigned long getLong (unsigned long max); + bool getBool (); + void modulate (int i); +}; diff --git a/sip/kcoreaddons/kshareddatacache.sip b/sip/kcoreaddons/kshared= datacache.sip new file mode 100644 index 0000000..201f215 --- /dev/null +++ b/sip/kcoreaddons/kshareddatacache.sip @@ -0,0 +1,47 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class KSharedDataCache +{ +%TypeHeaderCode +#include +%End + +public: + KSharedDataCache (const QString& cacheName, un= signed defaultCacheSize, unsigned expectedItemSize =3D 0); + ~KSharedDataCache (); + enum EvictionPolicy + { + NoEvictionPreference, + EvictLeastRecentlyUsed, + EvictLeastOftenUsed, + EvictOldest + }; + KSharedDataCache::EvictionPolicy evictionPolicy () const; + void setEvictionPolicy (KSharedDataCache::EvictionP= olicy newPolicy); + bool insert (const QString& key, const QByteArray& = data); + bool find (const QString& key, QByteArray* destinat= ion) const; + void clear (); + static void deleteCache (const QString& cacheName); + bool contains (const QString& key) const; + unsigned totalSize () const; + unsigned freeSize () const; + unsigned timestamp () const; + void setTimestamp (unsigned newTimestamp); +}; diff --git a/sip/kcoreaddons/kshell.sip b/sip/kcoreaddons/kshell.sip new file mode 100644 index 0000000..eb447b6 --- /dev/null +++ b/sip/kcoreaddons/kshell.sip @@ -0,0 +1,43 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +%ModuleHeaderCode +#include +%End + +namespace KShell +{ +enum Option +{ + NoOptions, + TildeExpand, + AbortOnMeta +}; +typedef QFlags Options; +enum Errors +{ + NoError, + BadQuoting, + FoundMeta +}; +QStringList splitArgs (const QString& cmd, KShell::Options fla= gs =3D KShell::Option::NoOptions, KShell::Errors* err =3D 0); +QString joinArgs (const QStringList& args); +QString quoteArg (const QString& arg); +QString tildeExpand (const QString& path); +}; diff --git a/sip/kcoreaddons/kstringhandler.sip b/sip/kcoreaddons/kstringha= ndler.sip new file mode 100644 index 0000000..a991478 --- /dev/null +++ b/sip/kcoreaddons/kstringhandler.sip @@ -0,0 +1,38 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +%ModuleHeaderCode +#include +%End +namespace KStringHandler +{ +QString capwords (const QString& text); +QStringList capwords (const QStringList& list); +QString lsqueeze (const QString& str, int maxlen =3D 40); +QString csqueeze (const QString& str, int maxlen =3D 40); +QString rsqueeze (const QString& str, int maxlen =3D 40); +QStringList perlSplit (const QString& sep, const QString& s, i= nt max =3D 0); +QStringList perlSplit (const QChar& sep, const QString& s, int= max =3D 0); +QStringList perlSplit (const QRegExp& sep, const QString& s, i= nt max =3D 0); +QString tagUrls (const QString& text); +QString obscure (const QString& str); +bool isUtf8 (const char* str); +QString from8Bit (const char* str); +QString preProcessWrap (const QString& text); +}; diff --git a/sip/kcoreaddons/kurlmimedata.sip b/sip/kcoreaddons/kurlmimedat= a.sip new file mode 100644 index 0000000..47ca787 --- /dev/null +++ b/sip/kcoreaddons/kurlmimedata.sip @@ -0,0 +1,35 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +%ModuleHeaderCode +#include +%End +namespace KUrlMimeData +{ +typedef QMap MetaDataMap; +void setUrls (const QList& urls, const QList& mostLocalUrls, QMimeData* mimeData); +void setMetaData (const KUrlMimeData::MetaDataMap& meta= Data, QMimeData* mimeData); +QStringList mimeDataTypes (); +enum DecodeOptions +{ + PreferLocalUrls, + PreferKdeUrls +}; +QList urlsFromMimeData (const QMimeData* mimeData, KUrlM= imeData::DecodeOptions decodeOptions =3D KUrlMimeData::DecodeOptions::Prefe= rKdeUrls, KUrlMimeData::MetaDataMap* metaData =3D 0); +}; diff --git a/sip/kcoreaddons/kuser.sip b/sip/kcoreaddons/kuser.sip new file mode 100644 index 0000000..430343b --- /dev/null +++ b/sip/kcoreaddons/kuser.sip @@ -0,0 +1,89 @@ +// Copyright 2014 Simon Edwards + +// Generated by twine2 + +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License as +// published by the Free Software Foundation; either version 2, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details + +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +typedef uid_t K_UID; +typedef gid_t K_GID; +class KUser +{ +%TypeHeaderCode +#include +%End + +public: + enum UIDMode + { + UseEffectiveUID, + UseRealUserID + }; + explicit KUser (KUser::UIDMode mode =3D KUser::UIDMode:= :UseEffectiveUID); + explicit KUser (K_UID uid); + explicit KUser (const QString& name); + explicit KUser (const char* name); +//ig explicit KUser (const passwd* p); + KUser (const KUser& user); +//ig KUser& operator=3D (const KUser& user); + bool operator=3D=3D (const KUser& user) const; + bool operator!=3D (const KUser& user) const; + bool isValid () const; + K_UID uid () const; + K_GID gid () const; + bool isSuperUser () const; + QString loginName () const; + QString homeDir () const; + QString faceIconPath () const; + QString shell () const; + QList groups () const; + QStringList groupNames () const; + enum UserProperty + { + FullName, + RoomNumber, + WorkPhone, + HomePhone + }; + QVariant property (KUser::UserProperty which) const; + ~KUser (); + static QList allUsers (); + static QStringList allUserNames (); +}; +class KUserGroup +{ +%TypeHeaderCode +#include +%End + +public: + explicit KUserGroup (const QString& name); + explicit KUserGroup (const char* name); + explicit KUserGroup (KUser::UIDMode mode =3D KUser::Use= EffectiveUID); + explicit KUserGroup (K_GID gid); +//ig explicit KUserGroup (const group* g); + KUserGroup (const KUserGroup& group); +//ig KUserGroup& operator=3D (const KUserGroup& group); + bool operator=3D=3D (const KUserGroup& group) const; + bool operator!=3D (const KUserGroup& group) const; + bool isValid () const; + K_GID gid () const; + QString name () const; + QList users () const; + QStringList userNames () const; + ~KUserGroup (); + static QList allGroups (); + static QStringList allGroupNames (); +};