Aspose.Tasks for C++
HeaderFooterInfo.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="HeaderFooterInfo.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2024 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 
8 #include <system/array.h>
9 #include <drawing/size.h>
10 
11 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
12 
13 namespace Aspose
14 {
15 namespace Tasks
16 {
17 namespace IO
18 {
19 namespace MSProject
20 {
21 class MPPPageHeaderFooterReader;
22 class MPPPageHeaderFooterWriter;
23 class RtfImageInfo;
24 } // namespace MSProject
25 } // namespace IO
26 namespace Visualization
27 {
28 class ApsDefaultPage;
29 class HeaderFooterRtfInfo;
30 } // namespace Visualization
31 } // namespace Tasks
32 } // namespace Aspose
33 namespace System
34 {
35 namespace Drawing
36 {
37 class Image;
38 } // namespace Drawing
39 } // namespace System
40 
41 namespace Aspose {
42 
43 namespace Tasks {
44 
45 namespace Visualization {
46 
47 /// <summary>
48 /// Represents header or footer data which is present in views and used for printing.
49 /// </summary>
50 class ASPOSE_TASKS_SHARED_CLASS HeaderFooterInfo : public System::Object
51 {
52  typedef HeaderFooterInfo ThisType;
53  typedef System::Object BaseType;
54 
55  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
56  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
57 
58  friend class Aspose::Tasks::Visualization::ApsDefaultPage;
59  friend class Aspose::Tasks::IO::MSProject::MPPPageHeaderFooterReader;
60  friend class Aspose::Tasks::IO::MSProject::MPPPageHeaderFooterWriter;
61 
62 public:
63 
64  /// <summary>
65  /// Gets the left aligned text to display in the header or footer.
66  /// </summary>
67  ASPOSE_TASKS_SHARED_API System::String get_LeftText() const;
68  /// <summary>
69  /// Sets the left aligned text to display in the header or footer.
70  /// </summary>
71  ASPOSE_TASKS_SHARED_API void set_LeftText(const System::String& value);
72  /// <summary>
73  /// Gets the centered text to display in the header or footer .
74  /// </summary>
75  ASPOSE_TASKS_SHARED_API System::String get_CenteredText() const;
76  /// <summary>
77  /// Sets the centered text to display in the header or footer .
78  /// </summary>
79  ASPOSE_TASKS_SHARED_API void set_CenteredText(const System::String& value);
80  /// <summary>
81  /// Gets the right aligned text to display in the header or footer.
82  /// </summary>
83  ASPOSE_TASKS_SHARED_API System::String get_RightText() const;
84  /// <summary>
85  /// Sets the right aligned text to display in the header or footer.
86  /// </summary>
87  ASPOSE_TASKS_SHARED_API void set_RightText(const System::String& value);
88  /// <summary>
89  /// Gets the left aligned image to be displayed in the header or footer.
90  /// </summary>
91  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Drawing::Image> get_LeftImage() const;
92  /// <summary>
93  /// Sets the left aligned image to be displayed in the header or footer.
94  /// </summary>
95  ASPOSE_TASKS_SHARED_API void set_LeftImage(const System::SharedPtr<System::Drawing::Image>& value);
96  /// <summary>
97  /// Gets the centered image to be displayed in the header or footer.
98  /// </summary>
99  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Drawing::Image> get_CenteredImage() const;
100  /// <summary>
101  /// Sets the centered image to be displayed in the header or footer.
102  /// </summary>
103  ASPOSE_TASKS_SHARED_API void set_CenteredImage(const System::SharedPtr<System::Drawing::Image>& value);
104  /// <summary>
105  /// Gets the right aligned image to be displayed in the header or footer.
106  /// </summary>
107  ASPOSE_TASKS_SHARED_API System::SharedPtr<System::Drawing::Image> get_RightImage() const;
108  /// <summary>
109  /// Sets the right aligned image to be displayed in the header or footer.
110  /// </summary>
111  ASPOSE_TASKS_SHARED_API void set_RightImage(const System::SharedPtr<System::Drawing::Image>& value);
112  /// <summary>
113  /// Gets the displayed size of the left image.
114  /// </summary>
115  ASPOSE_TASKS_SHARED_API System::Drawing::Size get_LeftImageSize() const;
116  /// <summary>
117  /// Sets the displayed size of the left image.
118  /// </summary>
119  ASPOSE_TASKS_SHARED_API void set_LeftImageSize(System::Drawing::Size value);
120  /// <summary>
121  /// Gets the displayed size of the center image.
122  /// </summary>
123  ASPOSE_TASKS_SHARED_API System::Drawing::Size get_CenteredImageSize() const;
124  /// <summary>
125  /// Sets the displayed size of the center image.
126  /// </summary>
127  ASPOSE_TASKS_SHARED_API void set_CenteredImageSize(System::Drawing::Size value);
128  /// <summary>
129  /// Gets the displayed size of the right image.
130  /// </summary>
131  ASPOSE_TASKS_SHARED_API System::Drawing::Size get_RightImageSize() const;
132  /// <summary>
133  /// Sets the displayed size of the right image.
134  /// </summary>
135  ASPOSE_TASKS_SHARED_API void set_RightImageSize(System::Drawing::Size value);
136 
137  /// <summary>Initializes a new instance of the <see cref="HeaderFooterInfo"></see> class.</summary>
138  ASPOSE_TASKS_SHARED_API HeaderFooterInfo();
139 
140 protected:
141 
142  ASPOSE_TASKS_SHARED_API System::Drawing::Size get_LeftImageOriginalSize() const;
143  ASPOSE_TASKS_SHARED_API void set_LeftImageOriginalSize(System::Drawing::Size value);
144  ASPOSE_TASKS_SHARED_API System::Drawing::Size get_CenteredImageOriginalSize() const;
145  ASPOSE_TASKS_SHARED_API void set_CenteredImageOriginalSize(System::Drawing::Size value);
146  ASPOSE_TASKS_SHARED_API System::Drawing::Size get_RightImageOriginalSize() const;
147  ASPOSE_TASKS_SHARED_API void set_RightImageOriginalSize(System::Drawing::Size value);
148  ASPOSE_TASKS_SHARED_API System::String get_LeftRtf() const;
149  ASPOSE_TASKS_SHARED_API void set_LeftRtf(const System::String& value);
150  ASPOSE_TASKS_SHARED_API System::String get_CenteredRtf() const;
151  ASPOSE_TASKS_SHARED_API void set_CenteredRtf(const System::String& value);
152  ASPOSE_TASKS_SHARED_API System::String get_RightRtf() const;
153  ASPOSE_TASKS_SHARED_API void set_RightRtf(const System::String& value);
154 
155  ASPOSE_TASKS_SHARED_API System::SharedPtr<HeaderFooterRtfInfo> GetRtfInfo();
156  #ifdef ASPOSE_GET_SHARED_MEMBERS
157  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
158  #endif
159 
160 
161 private:
162 
163  System::String leftText;
164  System::String centeredText;
165  System::String rightText;
166  System::SharedPtr<System::Drawing::Image> leftImage;
167  System::SharedPtr<System::Drawing::Image> centeredImage;
168  System::SharedPtr<System::Drawing::Image> rightImage;
169  System::Drawing::Size leftImageSize;
170  System::Drawing::Size centeredImageSize;
171  System::Drawing::Size rightImageSize;
172  System::String leftRtf;
173  System::String centeredRtf;
174  System::String rightRtf;
175  System::SharedPtr<HeaderFooterRtfInfo> headerFooterRtfInfo;
176 
177  static System::ArrayPtr<char16_t>& NewLineChars();
178 
179  System::Drawing::Size pr_LeftImageOriginalSize;
180  System::Drawing::Size pr_CenteredImageOriginalSize;
181  System::Drawing::Size pr_RightImageOriginalSize;
182 
183  static System::String GetPlainText(const System::String& text);
184  static System::SharedPtr<Aspose::Tasks::IO::MSProject::RtfImageInfo> GetImage(const System::String& text);
185  void RecalculateLeftRtf();
186  void RecalculateCenteredRtf();
187  void RecalculateRightRtf();
188 
189 };
190 
191 } // namespace Visualization
192 } // namespace Tasks
193 } // namespace Aspose
194 
195