diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-01-25 22:37:17 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-01-30 19:11:03 +0100 |
commit | 0a354af02cf51aeb1602596988c8f826b47b3a81 (patch) | |
tree | 3d101f330f411080149082db2dba5291d9b7003f /include | |
parent | a87dcba13f4501adc448d82c58fa1dfa7274046d (diff) | |
download | qpdf-0a354af02cf51aeb1602596988c8f826b47b3a81.tar.zst |
QPDFJob: convert AddAttachment handlers
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDFJob.hh | 55 | ||||
-rw-r--r-- | include/qpdf/auto_job_c_att.hh | 13 |
2 files changed, 50 insertions, 18 deletions
diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh index 18f1a28e..734f5f45 100644 --- a/include/qpdf/QPDFJob.hh +++ b/include/qpdf/QPDFJob.hh @@ -108,14 +108,49 @@ class QPDFJob std::string prefix; }; + struct AddAttachment + { + AddAttachment() : + replace(false) + { + } + + std::string path; + std::string key; + std::string filename; + std::string creationdate; + std::string moddate; + std::string mimetype; + std::string description; + bool replace; + }; + public: class Config; + + class AttConfig + { + friend class QPDFJob; + friend class Config; + public: + QPDF_DLL AttConfig& path(char const* parameter); + +# include <qpdf/auto_job_c_att.hh> + + private: + AttConfig(Config&); + AttConfig(AttConfig const&) = delete; + + Config& config; + AddAttachment att; + }; + class CopyAttConfig { friend class QPDFJob; friend class Config; public: - QPDF_DLL CopyAttConfig& filename(char const* parameter); + QPDF_DLL CopyAttConfig& path(char const* parameter); # include <qpdf/auto_job_c_copy_att.hh> @@ -134,6 +169,7 @@ class QPDFJob public: QPDF_DLL std::shared_ptr<CopyAttConfig> copyAttachmentsFrom(); + std::shared_ptr<AttConfig> addAttachment(); # include <qpdf/auto_job_c_main.hh> @@ -244,23 +280,6 @@ class QPDFJob std::vector<int> repeat_pagenos; }; - struct AddAttachment - { - AddAttachment() : - replace(false) - { - } - - std::string path; - std::string key; - std::string filename; - std::string creationdate; - std::string moddate; - std::string mimetype; - std::string description; - bool replace; - }; - enum remove_unref_e { re_auto, re_yes, re_no }; std::shared_ptr<char> password; diff --git a/include/qpdf/auto_job_c_att.hh b/include/qpdf/auto_job_c_att.hh new file mode 100644 index 00000000..ac0f4223 --- /dev/null +++ b/include/qpdf/auto_job_c_att.hh @@ -0,0 +1,13 @@ +// +// This file is automatically generated by generate_auto_job. +// Edits will be automatically overwritten if the build is +// run in maintainer mode. +// +QPDF_DLL Config& end(); +QPDF_DLL AttConfig& replace(); +QPDF_DLL AttConfig& key(char const* parameter); +QPDF_DLL AttConfig& filename(char const* parameter); +QPDF_DLL AttConfig& creationdate(char const* parameter); +QPDF_DLL AttConfig& moddate(char const* parameter); +QPDF_DLL AttConfig& mimetype(char const* parameter); +QPDF_DLL AttConfig& description(char const* parameter); |