Changeset View
Changeset View
Standalone View
Standalone View
find-modules/module_generation/PyKF5/MessageComposer.py
- This file was added.
1 | # | ||||
---|---|---|---|---|---|
2 | # Copyright 2017 by Shaheed Haque (srhaque@theiet.org) | ||||
3 | # | ||||
4 | # This program is free software; you can redistribute it and/or modify | ||||
5 | # it under the terms of the GNU General Public License as published by | ||||
6 | # the Free Software Foundation; either version 2 of the License, or | ||||
7 | # (at your option) any later version. | ||||
8 | # | ||||
9 | # This program is distributed in the hope that it will be useful, | ||||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | # GNU General Public License for more details. | ||||
13 | # | ||||
14 | # You should have received a copy of the GNU General Public License | ||||
15 | # along with this program; if not, write to the Free Software | ||||
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||||
17 | # 02110-1301 USA. | ||||
18 | # | ||||
19 | """ | ||||
20 | SIP binding customisation for PyKF5.MessageComposer. This modules describes: | ||||
21 | | ||||
22 | * Supplementary SIP file generator rules. | ||||
23 | """ | ||||
24 | import rule_helpers | ||||
25 | | ||||
26 | | ||||
27 | def container_not_abstract(container, sip, rule): | ||||
28 | sip["annotations"].remove("Abstract") | ||||
29 | | ||||
30 | | ||||
31 | def module_fix_mapped_types(filename, sip, rule): | ||||
32 | # | ||||
33 | # SIP cannot handle duplicate %MappedTypes. | ||||
34 | # | ||||
35 | rule_helpers.modulecode_delete(filename, sip, rule, "QExplicitlySharedDataPointer<KService>", "QList<QByteArray>", | ||||
36 | "QList<QModelIndex>", "QList<QSharedPointer<KPIMTextEdit::EmbeddedImage> >", | ||||
37 | "QList<QSharedPointer<MessageCore::AttachmentPart> >", "QList<QUrl>", | ||||
38 | "QMap<QByteArray, QString>", "QSharedPointer<KMime::Message>", | ||||
39 | "QSharedPointer<KPIM::MultiplyingLineData>", | ||||
40 | "QSharedPointer<MessageCore::AttachmentPart>", "QVector<Akonadi::Item>", | ||||
41 | "QVector<KMime::Headers::Base *>", "QVector<KMime::MDN::DispositionModifier>", | ||||
42 | "QVector<KMime::Types::AddrSpec>", "QVector<KMime::Types::Mailbox>", | ||||
43 | "std::vector<GpgME::Key, std::allocator<GpgME::Key> >") | ||||
44 | rule_helpers.module_add_imports(filename, sip, rule, "KIOCore/kio/kiomod.sip") | ||||
45 | rule_helpers.module_add_classes(filename, sip, rule, "KPIMTextEdit::PlainTextEditor", | ||||
46 | "MessageCore::MessageCoreSettingsBase", "KTimeZone", "KTimeZoneBackend", | ||||
47 | "KTimeZoneData", "KTimeZoneSource", "icalcomponent_impl", "_icaltimezone", | ||||
48 | "KDateTime", "KDateTime::Spec", "MessageViewer::MessageViewerSettingsBase", | ||||
49 | "MessageComposer::ContentJobBase", "MessageComposer::AbstractEncryptJob", | ||||
50 | "MessageComposer::MessageComposerSettingsBase", "_IO_FILE", "Kleo::DownloadJob", | ||||
51 | "Kleo::RefreshKeysJob", "Akonadi::Protocol::Command", | ||||
52 | "Akonadi::ServerManagerPrivate", "KIO::Connection", "KIO::ClipboardUpdater", | ||||
53 | "KParts::ReadOnlyPart", "QLatin1String", "VObject", "KActionCollection", | ||||
54 | "Akonadi::SpecialMailCollectionsPrivate", "MessageViewer::ViewerPrivate", | ||||
55 | "KLocalizedString", "KPIMTextEdit::NestedListHelper", | ||||
56 | "MailTransport::TransportComboBox", "SendLater::SendLaterInfo", | ||||
57 | "MessageComposer::RecipientsPicker", "PimCommon::AutoCorrection", | ||||
58 | "MailTransport::MessageQueueJob") | ||||
59 | | ||||
60 | | ||||
61 | def container_rules(): | ||||
62 | return [ | ||||
63 | # | ||||
64 | # There is a stray inlined destructor which confuses things... | ||||
65 | # | ||||
66 | ["messagesender.h", "MessageComposer", ".*", ".*", ".*", container_not_abstract], | ||||
67 | ["MessageComposer", "MessageComposerSettings", ".*", ".*", ".*", rule_helpers.container_make_uncopyable], | ||||
68 | ] | ||||
69 | | ||||
70 | | ||||
71 | def variable_rules(): | ||||
72 | return [ | ||||
73 | # | ||||
74 | # SIP does not support global arrays: | ||||
75 | # | ||||
76 | # https://www.riverbankcomputing.com/pipermail/pyqt/2017-September/039553.html | ||||
77 | # | ||||
78 | # ["kleo_util.h", "c(oncreteC|)ryptoMessageFormats", ".*", rule_helpers.variable_discard], | ||||
79 | ] | ||||
80 | | ||||
81 | | ||||
82 | def modulecode(): | ||||
83 | return { | ||||
84 | "MessageComposer/MessageComposermod.sip": { | ||||
85 | "code": module_fix_mapped_types, | ||||
86 | }, | ||||
87 | } |