Aspose.Tasks for C++
ImageSaveOptions.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="ImageSaveOptions.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/shared_ptr.h>
9 #include <cstdint>
10 
11 #include "aspose.tasks.cpp/Saving/ICloneableSaveOptions.h"
12 #include "aspose.tasks.cpp/Saving/SaveOptions.h"
13 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
14 
15 namespace Aspose
16 {
17 namespace Tasks
18 {
19 class FontSettings;
20 class IWriter;
21 namespace Saving
22 {
23 class IPageSavingCallback;
24 enum class SaveFileFormat;
25 class SaveOptions;
26 enum class TiffCompression;
27 } // namespace Saving
28 } // namespace Tasks
29 } // namespace Aspose
30 namespace System
31 {
32 namespace Collections
33 {
34 namespace Generic
35 {
36 template <typename> class List;
37 } // namespace Generic
38 } // namespace Collections
39 namespace Drawing
40 {
41 namespace Imaging
42 {
43 enum class PixelFormat;
44 } // namespace Imaging
45 } // namespace Drawing
46 } // namespace System
47 
48 namespace Aspose {
49 
50 namespace Tasks {
51 
52 namespace Saving {
53 
54 /// <summary>
55 /// Allows to specify additional options when rendering project pages to images.
56 /// </summary>
57 class ASPOSE_TASKS_SHARED_CLASS ImageSaveOptions : public Aspose::Tasks::Saving::SaveOptions, public Aspose::Tasks::Saving::SaveOptions::IReduceBottomGap, public Aspose::Tasks::Saving::SaveOptions::IFontCallbacks, public Aspose::Tasks::Saving::ICloneableSaveOptions
58 {
59  typedef ImageSaveOptions ThisType;
60  typedef Aspose::Tasks::Saving::SaveOptions BaseType;
61  typedef Aspose::Tasks::Saving::SaveOptions::IReduceBottomGap BaseType1;
62  typedef Aspose::Tasks::Saving::SaveOptions::IFontCallbacks BaseType2;
63  typedef Aspose::Tasks::Saving::ICloneableSaveOptions BaseType3;
64 
65  typedef ::System::BaseTypesInfo<BaseType, BaseType1, BaseType2, BaseType3> ThisTypeBaseTypesInfo;
66  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
67 
68 public:
69 
70  /// <summary>
71  /// Specifies font settings used when rendering project's view.
72  /// </summary>
73  ASPOSE_TASKS_SHARED_API System::SharedPtr<Aspose::Tasks::FontSettings> get_FontSettings() override;
74  /// <summary>
75  /// Gets a list of page numbers to save when saving project layout to separate files.
76  /// <remarks>All pages will be saved if this list is empty.</remarks>
77  /// </summary>
78  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Collections::Generic::List<int32_t>> get_Pages();
79  /// <summary>
80  /// Sets a list of page numbers to save when saving project layout to separate files.
81  /// <remarks>All pages will be saved if this list is empty.</remarks>
82  /// </summary>
83  ASPOSE_TASKS_SHARED_API void set_Pages(const System::SharedPtr<System::Collections::Generic::List<int32_t>>& value);
84  /// <summary>
85  /// Gets a JPEG quality. The allowed value range is 0..100.
86  /// </summary>
87  ASPOSE_TASKS_SHARED_API int32_t get_JpegQuality() const;
88  /// <summary>
89  /// Sets a JPEG quality. The allowed value range is 0..100.
90  /// </summary>
91  ASPOSE_TASKS_SHARED_API void set_JpegQuality(int32_t value);
92  /// <summary>
93  /// Gets a value indicating whether a gap between last task and the footer must be reduced.
94  /// </summary>
95  ASPOSE_TASKS_SHARED_API bool get_ReduceFooterGap() override;
96  /// <summary>
97  /// Sets a value indicating whether a gap between last task and the footer must be reduced.
98  /// </summary>
99  ASPOSE_TASKS_SHARED_API void set_ReduceFooterGap(bool value);
100  /// <summary>
101  /// Gets the type of compression to apply when saving generated images to the TIFF format.
102  /// </summary>
103  /// <remarks>
104  /// Has effect only when saving to TIFF.
105  /// The default value is <see cref="TiffCompression">LZW</see>.
106  /// </remarks>
107  ASPOSE_TASKS_SHARED_API Aspose::Tasks::Saving::TiffCompression get_TiffCompression() const;
108  /// <summary>
109  /// Sets the type of compression to apply when saving generated images to the TIFF format.
110  /// </summary>
111  /// <remarks>
112  /// Has effect only when saving to TIFF.
113  /// The default value is <see cref="TiffCompression">LZW</see>.
114  /// </remarks>
115  ASPOSE_TASKS_SHARED_API void set_TiffCompression(Aspose::Tasks::Saving::TiffCompression value);
116  /// <summary>
117  /// Gets the format of the color data for each pixel in the image.
118  /// </summary>
119  ASPOSE_TASKS_SHARED_API System::Drawing::Imaging::PixelFormat get_PixelFormat() const;
120  /// <summary>
121  /// Sets the format of the color data for each pixel in the image.
122  /// </summary>
123  ASPOSE_TASKS_SHARED_API void set_PixelFormat(System::Drawing::Imaging::PixelFormat value);
124  /// <summary>
125  /// Gets the horizontal resolution in dpi.
126  /// </summary>
127  ASPOSE_TASKS_SHARED_API float get_HorizontalResolution() const;
128  /// <summary>
129  /// Sets the horizontal resolution in dpi.
130  /// </summary>
131  ASPOSE_TASKS_SHARED_API void set_HorizontalResolution(float value);
132  /// <summary>
133  /// Gets the vertical resolution in dpi.
134  /// </summary>
135  ASPOSE_TASKS_SHARED_API float get_VerticalResolution() const;
136  /// <summary>
137  /// Sets the vertical resolution in dpi.
138  /// </summary>
139  ASPOSE_TASKS_SHARED_API void set_VerticalResolution(float value);
140  /// <summary>
141  /// Gets a user-defined callback which is used to get an output stream for each rendered page.
142  /// </summary>
143  ASPOSE_TASKS_SHARED_API const System::SharedPtr<IPageSavingCallback>& get_PageSavingCallback() const;
144  /// <summary>
145  /// Sets a user-defined callback which is used to get an output stream for each rendered page.
146  /// </summary>
147  ASPOSE_TASKS_SHARED_API void set_PageSavingCallback(const System::SharedPtr<IPageSavingCallback>& value);
148 
149  /// <summary>
150  /// Initializes a new instance of the <see cref="ImageSaveOptions"></see> class which can be used to save rendered images in TIFF, PNG, BMP or JPEG formats.
151  /// </summary>
152  /// <param name="saveFormat">Can be TIFF, PNG, BMP or JPEG<see cref="SaveFileFormat"></see>.</param>
153  /// <exception cref="ArgumentException">Thrown of <paramref name="saveFormat"></paramref> is not a valid image format. The valid values are TIFF, PNG, BMP or JPEG.</exception>
154  ASPOSE_TASKS_SHARED_API ImageSaveOptions(SaveFileFormat saveFormat);
155 
156 protected:
157 
158  /// <summary>
159  /// Initializes a new instance of the <see cref="ImageSaveOptions"></see> class.
160  /// </summary>
161  /// <param name="options">
162  /// The options to copy to.
163  /// </param>
164  ASPOSE_TASKS_SHARED_API ImageSaveOptions(const System::SharedPtr<ImageSaveOptions>& options);
165 
166  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(ImageSaveOptions, CODEPORTING_ARGS(const System::SharedPtr<ImageSaveOptions>& options));
167  ASPOSE_TASKS_SHARED_API System::SharedPtr<IWriter> GetWriter() override;
168 
169  virtual ASPOSE_TASKS_SHARED_API ~ImageSaveOptions();
170 
171  #ifdef ASPOSE_GET_SHARED_MEMBERS
172  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
173  #endif
174 
175 
176 private:
177 
178  System::SharedPtr<System::Collections::Generic::List<int32_t>> pages;
179  int32_t jpegQuality;
180  System::SharedPtr<Aspose::Tasks::FontSettings> pr_FontSettings;
181 
182  /// <summary>
183  /// Specifies font settings used when rendering project's view.
184  /// </summary>
185  ASPOSE_TASKS_SHARED_API void set_FontSettings(const System::SharedPtr<Aspose::Tasks::FontSettings>& value);
186 
187  bool pr_ReduceFooterGap;
188  Aspose::Tasks::Saving::TiffCompression pr_TiffCompression;
189  System::Drawing::Imaging::PixelFormat pr_PixelFormat;
190  float pr_HorizontalResolution;
191  float pr_VerticalResolution;
192  System::SharedPtr<IPageSavingCallback> pr_PageSavingCallback;
193 
194  System::SharedPtr<SaveOptions> Clone() override;
195  void CopyOutputPropertiesFrom(System::SharedPtr<SaveOptions> source) override;
196 
197 };
198 
199 } // namespace Saving
200 } // namespace Tasks
201 } // namespace Aspose
202 
203 
Allows to specify additional options when rendering project pages to images.
Definition: ImageSaveOptions.h:58
ImageSaveOptions(SaveFileFormat saveFormat)
Initializes a new instance of the ImageSaveOptions class which can be used to save rendered images in...
void set_PageSavingCallback(const System::SharedPtr< IPageSavingCallback > &value)
Sets a user-defined callback which is used to get an output stream for each rendered page.
System::SharedPtr< System::Collections::Generic::List< int32_t > > get_Pages()
Gets a list of page numbers to save when saving project layout to separate files.
void set_Pages(const System::SharedPtr< System::Collections::Generic::List< int32_t >> &value)
Sets a list of page numbers to save when saving project layout to separate files.
void set_HorizontalResolution(float value)
Sets the horizontal resolution in dpi.
void set_JpegQuality(int32_t value)
Sets a JPEG quality. The allowed value range is 0..100.
bool get_ReduceFooterGap() override
Gets a value indicating whether a gap between last task and the footer must be reduced.
Aspose::Tasks::Saving::TiffCompression get_TiffCompression() const
Gets the type of compression to apply when saving generated images to the TIFF format.
System::Drawing::Imaging::PixelFormat get_PixelFormat() const
Gets the format of the color data for each pixel in the image.
void set_TiffCompression(Aspose::Tasks::Saving::TiffCompression value)
Sets the type of compression to apply when saving generated images to the TIFF format.
int32_t get_JpegQuality() const
Gets a JPEG quality. The allowed value range is 0..100.
System::SharedPtr< Aspose::Tasks::FontSettings > get_FontSettings() override
Specifies font settings used when rendering project's view.
float get_VerticalResolution() const
Gets the vertical resolution in dpi.
const System::SharedPtr< IPageSavingCallback > & get_PageSavingCallback() const
Gets a user-defined callback which is used to get an output stream for each rendered page.
float get_HorizontalResolution() const
Gets the horizontal resolution in dpi.
void set_VerticalResolution(float value)
Sets the vertical resolution in dpi.
void set_PixelFormat(System::Drawing::Imaging::PixelFormat value)
Sets the format of the color data for each pixel in the image.
void set_ReduceFooterGap(bool value)
Sets a value indicating whether a gap between last task and the footer must be reduced.
This is an abstract base class for classes that allow the user to specify additional options when sav...
Definition: SaveOptions.h:95
Definition: Asn.h:13