diff --git a/src/config/bibtexentries.h b/src/config/bibtexentries.h index 48988f18..b15851c6 100644 --- a/src/config/bibtexentries.h +++ b/src/config/bibtexentries.h @@ -1,82 +1,84 @@ /*************************************************************************** - * Copyright (C) 2004-2018 by Thomas Fischer * + * Copyright (C) 2004-2019 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 General Public License * * along with this program; if not, see . * ***************************************************************************/ #ifndef KBIBTEX_CONFIG_BIBTEXENTRIES_H #define KBIBTEX_CONFIG_BIBTEXENTRIES_H #include #include #include #ifdef HAVE_KF5 #include "kbibtexconfig_export.h" #endif // HAVE_KF5 typedef struct { QString upperCamelCase; QString upperCamelCaseAlt; QString label; QStringList requiredItems; QStringList optionalItems; } EntryDescription; bool operator==(const EntryDescription &a, const EntryDescription &b); uint qHash(const EntryDescription &a); /** @author Thomas Fischer */ class KBIBTEXCONFIG_EXPORT BibTeXEntries : public QVector { public: virtual ~BibTeXEntries(); /** * Only one instance of this class has to be used * @return the class's singleton */ static const BibTeXEntries &instance(); /** * Change the casing of a given entry name to one of the predefine formats. * */ /** * Change the casing of a given entry name to one of the predefine formats. * @param name entry name to format * @param casing can be any of the predefined formats such as lower camel case or upper case * @return returns the formatted entry name if possible or the "name" parameter's value as fall-back */ QString format(const QString &name, KBibTeX::Casing casing) const; /** * Returns the given entry name's i18n'ized, human-readable label, * for example "Journal Article" for entry name "article". * @param name entry name to look up the label for * @return the label for the entry if available, else an empty string */ QString label(const QString &name) const; private: + Q_DISABLE_COPY(BibTeXEntries) + explicit BibTeXEntries(const QVector &other); class BibTeXEntriesPrivate; BibTeXEntriesPrivate *d; }; #endif // KBIBTEX_CONFIG_BIBTEXENTRIES_H diff --git a/src/config/bibtexfields.h b/src/config/bibtexfields.h index 336ae0e9..2567ac35 100644 --- a/src/config/bibtexfields.h +++ b/src/config/bibtexfields.h @@ -1,104 +1,104 @@ /*************************************************************************** * Copyright (C) 2004-2019 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 General Public License * * along with this program; if not, see . * ***************************************************************************/ #ifndef KBIBTEX_CONFIG_BIBTEXFIELDS_H #define KBIBTEX_CONFIG_BIBTEXFIELDS_H #include #include #include #ifdef HAVE_KF5 #include "kbibtexconfig_export.h" #endif // HAVE_KF5 typedef struct { /** * Name of this field in 'upper camel case', e.g. 'BookTitle', but not * 'booktitle', 'BOOKTITLE', or 'BoOkTiTlE'. */ QString upperCamelCase; /** * The 'alternative' field name is used to create 'meta fields', such as * 'author' or 'editor' combined. It shall not be used to define aliases * such as 'pdf' to be an alias for 'file'. */ QString upperCamelCaseAlt; /** * List of aliases for a field. Empty for most fields. Alias for BibLaTeX * must be explictly mentioned in BibLaTeX's official documentation, see * section 'Field Aliases'. * Field aliases shall not be used as alternative field names. */ QStringList upperCamelCaseAliases; /** * Localized (translated) name of this field. */ QString label; KBibTeX::TypeFlag preferredTypeFlag; KBibTeX::TypeFlags typeFlags; int defaultWidth; QMap visible; bool defaultVisible; bool typeIndependent; } FieldDescription; bool operator==(const FieldDescription &a, const FieldDescription &b); uint qHash(const FieldDescription &a); /** @author Thomas Fischer */ class KBIBTEXCONFIG_EXPORT BibTeXFields : public QVector { public: - BibTeXFields(const BibTeXFields &other) = delete; - BibTeXFields &operator= (const BibTeXFields &other) = delete; ~BibTeXFields(); /** * Only one instance of this class has to be used * @return the class's singleton */ static BibTeXFields &instance(); #ifdef HAVE_KF5 void save(); void resetToDefaults(const QString &treeViewName); #endif // HAVE_KF5 /** * Change the casing of a given field name to one of the predefine formats. */ QString format(const QString &name, KBibTeX::Casing casing) const; static KBibTeX::TypeFlag typeFlagFromString(const QString &typeFlagString); static KBibTeX::TypeFlags typeFlagsFromString(const QString &typeFlagsString); static QString typeFlagToString(KBibTeX::TypeFlag typeFlag); static QString typeFlagsToString(KBibTeX::TypeFlags typeFlags); const FieldDescription find(const QString &name) const; private: + Q_DISABLE_COPY(BibTeXFields) + explicit BibTeXFields(const QString &style, const QVector &other); class BibTeXFieldsPrivate; BibTeXFieldsPrivate *d; }; #endif // KBIBTEX_CONFIG_BIBTEXFIELDS_H diff --git a/src/config/notificationhub.h b/src/config/notificationhub.h index 6e837baa..5328f921 100644 --- a/src/config/notificationhub.h +++ b/src/config/notificationhub.h @@ -1,62 +1,64 @@ /***************************************************************************** - * Copyright (C) 2004-2018 by Thomas Fischer * + * Copyright (C) 2004-2019 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 General Public License * * along with this program; if not, see . * *****************************************************************************/ #ifndef KBIBTEX_CONFIG_NOTIFICATIONHUB_H #define KBIBTEX_CONFIG_NOTIFICATIONHUB_H #include "kbibtexconfig_export.h" +#include + /** * @author Thomas Fischer */ class KBIBTEXCONFIG_EXPORT NotificationListener { public: virtual void notificationEvent(int eventId) = 0; virtual ~NotificationListener(); }; /** * @author Thomas Fischer */ class KBIBTEXCONFIG_EXPORT NotificationHub { public: - NotificationHub(const NotificationHub &other) = delete; - NotificationHub &operator= (const NotificationHub &other) = delete; ~NotificationHub(); static const int EventAny; static const int EventConfigurationChanged; static const int EventBibliographySystemChanged; static const int EventUserDefined; static void registerNotificationListener(NotificationListener *listener, int eventId = NotificationHub::EventAny); static void unregisterNotificationListener(NotificationListener *listener, int eventId = NotificationHub::EventAny); static void publishEvent(int eventId); private: + Q_DISABLE_COPY(NotificationHub) + class NotificationHubPrivate; NotificationHubPrivate *const d; static NotificationHub &instance(); NotificationHub(); }; #endif // KBIBTEX_CONFIG_NOTIFICATIONHUB_H diff --git a/src/gui/config/entrylayout.h b/src/gui/config/entrylayout.h index 7c7d78f6..a4300080 100644 --- a/src/gui/config/entrylayout.h +++ b/src/gui/config/entrylayout.h @@ -1,60 +1,62 @@ /*************************************************************************** * Copyright (C) 2004-2019 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 General Public License * * along with this program; if not, see . * ***************************************************************************/ #ifndef KBIBTEX_GUI_ENTRYLAYOUT_H #define KBIBTEX_GUI_ENTRYLAYOUT_H #include #include #include #include typedef struct { QString uiLabel; QString bibtexLabel; KBibTeX::FieldInputType fieldInputLayout; } SingleFieldLayout; typedef struct { QString identifier; QString uiCaption; QString iconName; int columns; QList singleFieldLayouts; QStringList infoMessages; } EntryTabLayout; /** @author Thomas Fischer */ class EntryLayout : public QVector > { public: virtual ~EntryLayout(); static const EntryLayout &instance(); protected: explicit EntryLayout(const QString &style); private: + Q_DISABLE_COPY(EntryLayout) + class EntryLayoutPrivate; EntryLayoutPrivate *d; }; #endif // KBIBTEX_GUI_ENTRYLAYOUT_H diff --git a/src/io/bibutils.h b/src/io/bibutils.h index 2ad6ade5..9a421749 100644 --- a/src/io/bibutils.h +++ b/src/io/bibutils.h @@ -1,71 +1,71 @@ /*************************************************************************** * Copyright (C) 2004-2019 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 General Public License * * along with this program; if not, see . * ***************************************************************************/ #ifndef KBIBTEX_IO_BIBUTILS_H #define KBIBTEX_IO_BIBUTILS_H #include #ifdef HAVE_KF5 #include "kbibtexio_export.h" #endif // HAVE_KF5 /** * This class encapsulates calling the various binary programs of the BibUtils program set. * BibUtils is available at http://sourceforge.net/projects/bibutils/ * * This class is inherited by @see FileImporterBibUtils and @see FileExporterBibUtils, * which make use of its protected functions. * Using this class directly should only happen to call its public static functions. * * @author Thomas Fischer */ class KBIBTEXIO_EXPORT BibUtils { public: - BibUtils(const BibUtils &other) = delete; - BibUtils &operator= (const BibUtils &other) = delete; ~BibUtils(); enum class Format { MODS = 0, BibTeX = 1, BibLaTeX = 2, ISI = 5, RIS = 6, EndNote = 10, EndNoteXML = 11, ADS = 15, WordBib = 16, Copac = 17, Med = 18 }; BibUtils::Format format() const; void setFormat(const BibUtils::Format format); /** * Test if BibUtils is installed. This test checks if a number of known * BibUtils binaries are available (i.e. found in PATH). If any binary * is missing, it is assumed that BibUtils is not available. The test is * performed only once and the result cached for future calls to this function. * @return true if BibUtils is correctly installed, false otherwise */ static bool available(); protected: explicit BibUtils(); // TODO migrate to KJob or KCompositeJob bool convert(QIODevice &source, const BibUtils::Format sourceFormat, QIODevice &destination, const BibUtils::Format destinationFormat) const; private: + Q_DISABLE_COPY(BibUtils) + class Private; Private *const d; }; KBIBTEXIO_EXPORT QDebug operator<<(QDebug dbg, const BibUtils::Format &format); #endif // KBIBTEX_IO_BIBUTILS_H diff --git a/src/io/encoder.h b/src/io/encoder.h index 21e5256b..44ce2d70 100644 --- a/src/io/encoder.h +++ b/src/io/encoder.h @@ -1,71 +1,73 @@ /*************************************************************************** * Copyright (C) 2004-2019 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 General Public License * * along with this program; if not, see . * ***************************************************************************/ #ifndef KBIBTEX_IO_ENCODER_H #define KBIBTEX_IO_ENCODER_H #include #ifdef HAVE_KF5 #include "kbibtexio_export.h" #endif // HAVE_KF5 /** * Base class for that convert between different textual representations * for non-ASCII characters. Examples for external textual representations * are \"a in LaTeX and ä in XML. * @author Thomas Fischer */ class KBIBTEXIO_EXPORT Encoder { public: enum class TargetEncoding {ASCII, UTF8}; static const Encoder &instance(); virtual ~Encoder(); /** * Decode from external textual representation to internal (UTF-8) representation. * @param text text in external textual representation * @return text in internal (UTF-8) representation */ virtual QString decode(const QString &text) const; /** * Encode from internal (UTF-8) representation to external textual representation. * Output may be restricted to ASCII (non-ASCII characters will be rewritten depending * on concrete Encoder class, for example as 'ä' as XML or '\"a' for LaTeX) * or UTF-8 (all characters allowed, only 'special ones' rewritten, for example * '&' for XML and '\&' for LaTeX). * @param text in internal (UTF-8) representation * @param targetEncoding allow either only ASCII output or UTF-8 output. * @return text text in external textual representation */ virtual QString encode(const QString &text, const TargetEncoding targetEncoding) const; QString convertToPlainAscii(const QString &input) const; static bool containsOnlyAscii(const QString &text); protected: Encoder(); private: + Q_DISABLE_COPY(Encoder) + class Private; Private *const d; }; #endif // KBIBTEX_IO_ENCODER_H diff --git a/src/io/xsltransform.h b/src/io/xsltransform.h index 7bcb48e1..6630d91b 100644 --- a/src/io/xsltransform.h +++ b/src/io/xsltransform.h @@ -1,62 +1,61 @@ /*************************************************************************** - * Copyright (C) 2004-2018 by Thomas Fischer * + * Copyright (C) 2004-2019 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 General Public License * * along with this program; if not, see . * ***************************************************************************/ #ifndef KBIBTEX_IO_XSLTRANSFORM_H #define KBIBTEX_IO_XSLTRANSFORM_H #include #ifdef HAVE_KF5 #include "kbibtexio_export.h" #endif // HAVE_KF5 class QXmlQuery; class QByteArray; /** * @author Thomas Fischer */ class KBIBTEXIO_EXPORT XSLTransform { public: /** * Create a new instance of a transformer. * @param xsltFilename file name of the XSL file */ explicit XSLTransform(const QString &xsltFilename); ~XSLTransform(); - XSLTransform(const XSLTransform &other) = delete; - XSLTransform &operator= (const XSLTransform &other) = delete; - bool isValid() const; /** * Transform a given XML document using the tranformer's * XSL file. * @param xmlText XML document to transform * @return transformed document */ QString transform(const QString &xmlText) const; static QString locateXSLTfile(const QString &stem); private: + Q_DISABLE_COPY(XSLTransform) + QByteArray *xsltData; }; #endif // KBIBTEX_IO_XSLTRANSFORM_H diff --git a/src/processing/journalabbreviations.h b/src/processing/journalabbreviations.h index 3a6cc627..28a9f0d8 100644 --- a/src/processing/journalabbreviations.h +++ b/src/processing/journalabbreviations.h @@ -1,47 +1,49 @@ /*************************************************************************** * Copyright (C) 2004-2018 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, 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 General Public License * * along with this program; if not, see . * ***************************************************************************/ #ifndef KBIBTEX_PROCESSING_JOURNALABBREVIATIONS_H #define KBIBTEX_PROCESSING_JOURNALABBREVIATIONS_H #include #ifdef HAVE_KF5 #include "kbibtexprocessing_export.h" #endif // HAVE_KF5 /** * @author Thomas Fischer */ class KBIBTEXPROCESSING_EXPORT JournalAbbreviations { public: static const JournalAbbreviations &instance(); QString toShortName(const QString &longName) const; QString toLongName(const QString &shortName) const; protected: explicit JournalAbbreviations(); ~JournalAbbreviations(); private: + Q_DISABLE_COPY(JournalAbbreviations) + class Private; Private *const d; }; #endif // KBIBTEX_PROCESSING_JOURNALABBREVIATIONS_H