KDELibs4Support

k4aboutdata.h
1 /*
2  * This file is part of the KDE Libraries
3  * Copyright (C) 2000 Espen Sand ([email protected])
4  * Copyright (C) 2008 Friedrich W. H. Kossebau <[email protected]>
5  * Copyright (C) 2010 Teo Mrnjavac <[email protected]>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  */
23 
24 #ifndef K4ABOUTDATA_H
25 #define K4ABOUTDATA_H
26 
27 #include <kdelibs4support_export.h>
28 
29 #ifdef KDELIBS4SUPPORT_NO_DEPRECATED_NOISE
30 #warning "This file is deprecated."
31 #endif
32 
33 #include <klocalizedstring.h>
34 // Qt
35 #include <QString>
36 #include <QSharedDataPointer>
37 
38 template <class T> class QList;
39 class QVariant;
40 class KAboutData;
41 class K4AboutData;
42 
76 class KDELIBS4SUPPORT_DEPRECATED_EXPORT_NOISE K4AboutPerson
77 {
78  friend class K4AboutData;
79 public:
91  KDELIBS4SUPPORT_DEPRECATED explicit K4AboutPerson(const KLocalizedString &name,
92  const KLocalizedString &task = KLocalizedString(),
93  const QByteArray &emailAddress = QByteArray(),
94  const QByteArray &webAddress = QByteArray());
95 
109  KDELIBS4SUPPORT_DEPRECATED explicit K4AboutPerson(const KLocalizedString &name,
110  const KLocalizedString &task,
111  const QByteArray &emailAddress,
112  const QByteArray &webAddress,
113  const QByteArray &ocsUsername); //KDE5: merge into main ctor
114 
119  K4AboutPerson(const K4AboutPerson &other);
120 
121  ~K4AboutPerson();
122 
127  K4AboutPerson &operator=(const K4AboutPerson &other);
128 
134  QString name() const;
135 
141  QString task() const;
142 
148  QString emailAddress() const;
149 
155  QString webAddress() const;
156 
162  QString ocsUsername() const;
163 
164 private:
168  KDELIBS4SUPPORT_DEPRECATED explicit K4AboutPerson(const QString &name, const QString &email);
169 
170  class Private;
171  Private *const d;
172 };
173 
174 class K4AboutLicense;
175 
176 // KDE5: refactor together with KComponentData.
177 // Like changing all property names which contain Program or App.
178 
199 class KDELIBS4SUPPORT_DEPRECATED_EXPORT_NOISE K4AboutData
200 {
201 public:
205  enum LicenseKey { // KDE5: move to K4AboutLicense, cut License_ prefix
206  License_Custom = -2,
207  License_File = -1,
208  License_Unknown = 0,
209  License_GPL = 1,
210  License_GPL_V2 = 1,
211  License_LGPL = 2,
212  License_LGPL_V2 = 2,
213  License_BSD = 3,
214  License_Artistic = 4,
215  License_QPL = 5,
216  License_QPL_V1_0 = 5,
217  License_GPL_V3 = 6,
218  License_LGPL_V3 = 7
219  };
220 
224  enum NameFormat { // KDE5: move to K4AboutLicense
225  ShortName,
226  FullName
227  };
228 
229 public:
272  const QByteArray &catalogName,
273  const KLocalizedString &programName,
274  const QByteArray &version,
275  const KLocalizedString &shortDescription = KLocalizedString(),
276  enum LicenseKey licenseType = License_Unknown,
277  const KLocalizedString &copyrightStatement = KLocalizedString(),
278  const KLocalizedString &otherText = KLocalizedString(),
279  const QByteArray &homePageAddress = QByteArray(),
280  const QByteArray &bugsEmailAddress = "[email protected]"
281  );
282 
287  K4AboutData(const K4AboutData &other);
288 
293  K4AboutData &operator=(const K4AboutData &other);
294 
295  ~K4AboutData();
296 
297  operator KAboutData() const;
298 
321  K4AboutData &addAuthor(const KLocalizedString &name,
322  const KLocalizedString &task = KLocalizedString(),
323  const QByteArray &emailAddress = QByteArray(),
324  const QByteArray &webAddress = QByteArray());
325 
351  K4AboutData &addAuthor(const KLocalizedString &name,
352  const KLocalizedString &task,
353  const QByteArray &emailAddress,
354  const QByteArray &webAddress,
355  const QByteArray &ocsUsername); //KDE5: merge with addAuthor
356 
379  K4AboutData &addCredit(const KLocalizedString &name,
380  const KLocalizedString &task = KLocalizedString(),
381  const QByteArray &emailAddress = QByteArray(),
382  const QByteArray &webAddress = QByteArray());
383 
409  K4AboutData &addCredit(const KLocalizedString &name,
410  const KLocalizedString &task,
411  const QByteArray &emailAddress,
412  const QByteArray &webAddress,
413  const QByteArray &ocsUsername); //KDE5: merge with addCredit
414 
437  K4AboutData &setTranslator(const KLocalizedString &name,
438  const KLocalizedString &emailAddress);
439 
450  K4AboutData &setLicenseText(const KLocalizedString &license);
451 
467  K4AboutData &addLicenseText(const KLocalizedString &license);
468 
475  K4AboutData &setLicenseTextFile(const QString &file);
476 
488  K4AboutData &addLicenseTextFile(const QString &file);
489 
495  K4AboutData &setAppName(const QByteArray &appName);
496 
504  K4AboutData &setProgramName(const KLocalizedString &programName);
505 
516  K4AboutData &setProgramIconName(const QString &iconName);
517 
530  K4AboutData &setProgramLogo(const QVariant &image);
531 
544  K4AboutData &setOcsProvider(const QByteArray &providerUrl);
545 
551  K4AboutData &setVersion(const QByteArray &version);
552 
560  K4AboutData &setShortDescription(const KLocalizedString &shortDescription);
561 
567  K4AboutData &setCatalogName(const QByteArray &catalogName);
568 
575  K4AboutData &setLicense(LicenseKey licenseKey);
576 
587  K4AboutData &addLicense(LicenseKey licenseKey);
588 
596  K4AboutData &setCopyrightStatement(const KLocalizedString &copyrightStatement);
597 
605  K4AboutData &setOtherText(const KLocalizedString &otherText);
606 
614  K4AboutData &setHomepage(const QByteArray &homepage);
615 
622  K4AboutData &setBugAddress(const QByteArray &bugAddress);
623 
641  K4AboutData &setOrganizationDomain(const QByteArray &domain);
642 
651  K4AboutData &setProductName(const QByteArray &name);
652 
657  QString appName() const;
658 
666  QString productName() const;
667 
672  QString programName() const;
673 
679  QString organizationDomain() const;
680 
685  const char *internalProgramName() const;
686 
691  void translateInternalProgramName() const;
692 
704  QString programIconName() const;
705 
715  QVariant programLogo() const;
716 
721  QString ocsProviderUrl() const;
722 
727  QString version() const;
728 
733  const char *internalVersion() const;
734 
740  QString shortDescription() const;
741 
746  QString catalogName() const;
747 
753  QString homepage() const;
754 
759  QString bugAddress() const;
760 
765  const char *internalBugAddress() const;
766 
771  QList<K4AboutPerson> authors() const;
772 
777  QList<K4AboutPerson> credits() const;
778 
783  QList<K4AboutPerson> translators() const;
784 
789  static QString aboutTranslationTeam();
790 
795  QString otherText() const;
796 
806  QString license() const;
807 
815  QString licenseName(NameFormat formatName) const;
816 
823  QList<K4AboutLicense> licenses() const;
824 
829  QString copyrightStatement() const;
830 
838  QString customAuthorPlainText() const;
839 
847  QString customAuthorRichText() const;
848 
856  bool customAuthorTextEnabled() const;
857 
869  K4AboutData &setCustomAuthorText(const KLocalizedString &plainText,
870  const KLocalizedString &richText);
871 
877  K4AboutData &unsetCustomAuthorText();
878 
879 private:
880 
881  class Private;
882  Private *const d;
883 };
884 
900 class KDELIBS4SUPPORT_DEPRECATED_EXPORT_NOISE K4AboutLicense
901 {
902  friend class K4AboutData;
903 public:
908  K4AboutLicense(const K4AboutLicense &other);
909 
910  ~K4AboutLicense();
911 
916  K4AboutLicense &operator=(const K4AboutLicense &other);
917 
925  QString text() const;
926 
932  QString name(K4AboutData::NameFormat formatName) const;
933 
940  K4AboutData::LicenseKey key() const;
941 
964  static K4AboutLicense byKeyword(const QString &keyword);
965 
966 private:
970  KDELIBS4SUPPORT_DEPRECATED explicit K4AboutLicense(enum K4AboutData::LicenseKey licenseType, const K4AboutData *aboutData);
974  KDELIBS4SUPPORT_DEPRECATED explicit K4AboutLicense(const QString &pathToFile, const K4AboutData *aboutData);
978  KDELIBS4SUPPORT_DEPRECATED explicit K4AboutLicense(const KLocalizedString &licenseText, const K4AboutData *aboutData);
979 
980  class Private;
982 };
983 
984 #endif
985 
K4AboutData & operator=(const K4AboutData &other)
Assignment operator.
LicenseKey
Describes the license of the software.
Definition: k4aboutdata.h:205
This class is used to store information about a license.
Definition: k4aboutdata.h:900
QCA_EXPORT void setAppName(const QString &name)
This class is used to store information about a program.
Definition: k4aboutdata.h:199
This class is used to store information about a person or developer.
Definition: k4aboutdata.h:76
unsigned int version()
Returns the encoded number of KDE&#39;s version, see the KDE_VERSION macro.
Definition: kdeversion.cpp:24
NameFormat
Format of the license name.
Definition: k4aboutdata.h:224
QCA_EXPORT QString appName()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jul 10 2020 22:56:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.