VbaProject.h
1 //////////////////////////////////////////////////////////////////////////
2 // Copyright 2001-2020 Aspose Pty Ltd. All Rights Reserved.
3 //
4 // This file is part of Aspose.Words. The source code in this file
5 // is only intended as a supplement to the documentation, and is provided
6 // "as is", without warranty of any kind, either expressed or implied.
7 //////////////////////////////////////////////////////////////////////////
8 #pragma once
9 
10 
11 #include <system/string.h>
12 #include <system/shared_ptr.h>
13 #include <system/object.h>
14 #include <system/io/memory_stream.h>
15 #include <system/array.h>
16 #include <cstdint>
17 
18 #include "Aspose.Words.Cpp/aspose_words_api_defs.h"
19 
20 namespace Aspose { namespace Words { class VbaModule; } }
21 namespace Aspose { namespace Words { class VbaModuleCollection; } }
22 namespace Aspose { namespace Words { class Document; } }
23 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Reader { class DocxVbaReader; } } } } }
24 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Writer { class DocxVbaWriter; } } } } }
25 namespace Aspose { namespace Words { namespace RW { namespace Doc { class VarFiler; } } } }
26 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Writer { class DocWriter; } } } } }
27 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Writer { class WmlWriter; } } } } }
28 namespace Aspose { namespace Words { class VbaReferenceCollection; } }
29 namespace Aspose { namespace Ss { class MemoryStorage; } }
30 namespace Aspose { namespace Words { class VbaRecordReader; } }
31 
32 namespace Aspose {
33 
34 namespace Words {
35 
36 
37 /// <summary>
38 /// Provides access to VBA project information.
39 /// A VBA project inside the document is defined as a collection of VBA modules.
40 /// </summary>
41 class VbaProject : public System::Object
42 {
43  typedef VbaProject ThisType;
44  typedef System::Object BaseType;
45 
46  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
47  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
48 
50  friend class Aspose::Words::VbaModule;
51  friend class Aspose::Words::VbaModuleCollection;
52  friend class Aspose::Words::Document;
53  friend class Aspose::Words::RW::Docx::Reader::DocxVbaReader;
54  friend class Aspose::Words::RW::Docx::Writer::DocxVbaWriter;
55  friend class Aspose::Words::RW::Doc::VarFiler;
56  friend class Aspose::Words::RW::Doc::Writer::DocWriter;
57  friend class Aspose::Words::RW::Wml::Writer::WmlWriter;
58 
59 public:
60 
61  /// <summary>
62  /// Gets or sets VBA project name.
63  /// </summary>
64  ASPOSE_WORDS_SHARED_API System::String get_Name() const;
65  /// Setter for Aspose::Words::VbaProject::get_Name
66  ASPOSE_WORDS_SHARED_API void set_Name(System::String value);
67  /// <summary>
68  /// Returns collection of VBA project modules.
69  /// </summary>
70  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::VbaModuleCollection> get_Modules();
71  /// <summary>
72  /// Returns the VBA project´┐Żs code page.
73  /// </summary>
74  ASPOSE_WORDS_SHARED_API int32_t get_CodePage() const;
75  /// <summary>
76  /// Shows whether the VbaProject is signed or not.
77  /// </summary>
78  ASPOSE_WORDS_SHARED_API bool get_IsSigned();
79 
80  /// <summary>
81  /// Creates a blank VbaProject.
82  /// </summary>
83  ASPOSE_WORDS_SHARED_API VbaProject();
84 
85  /// <summary>
86  /// Performs a copy of the <see cref="Aspose::Words::VbaProject" />.
87  /// </summary>
88  /// <returns>The cloned VbaProject.</returns>
89  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::VbaProject> Clone();
90 
91 protected:
92 
93  System::ArrayPtr<uint8_t> get_Signature() const;
94  void set_Signature(System::ArrayPtr<uint8_t> value);
95  System::SharedPtr<Aspose::Words::VbaReferenceCollection> get_References() const;
96  int32_t get_SysKind() const;
97  int32_t get_Lcid() const;
98  int32_t get_LcidInvoke() const;
99  System::String get_Description() const;
100  System::String get_HelpFilePath1() const;
101  System::String get_HelpFilePath2() const;
102  int32_t get_HelpContext() const;
103  int32_t get_LibFlags() const;
104  uint32_t get_VersionMajor() const;
105  uint16_t get_VersionMinor() const;
106  System::String get_Constants() const;
107  System::SharedPtr<Aspose::Ss::MemoryStorage> get_Storage();
108 
109  VbaProject(System::SharedPtr<Aspose::Ss::MemoryStorage> vbaStorage);
110 
111  void ClearStorage();
112 
113  virtual ASPOSE_WORDS_SHARED_API ~VbaProject();
114 
115  ASPOSE_WORDS_SHARED_API System::Object::shared_members_type GetSharedMembers() override;
116 
117 private:
118 
119  System::SharedPtr<Aspose::Words::VbaRecordReader> mReader;
120  int16_t mCodePage;
121  System::String mName;
122  System::SharedPtr<Aspose::Words::VbaModuleCollection> mModulesCollection;
123  System::SharedPtr<Aspose::Words::VbaReferenceCollection> mReferences;
124  int32_t mSysKind;
125  int32_t mLcid;
126  int32_t mLcidInvoke;
127  System::String mDescription;
128  System::String mHelpFilePath1;
129  System::String mHelpFilePath2;
130  int32_t mHelpContext;
131  int32_t mLibFlags;
132  uint32_t mVersionMajor;
133  uint16_t mVersionMinor;
134  System::String mConstants;
135  System::SharedPtr<Aspose::Ss::MemoryStorage> mVbaStorage;
136  System::ArrayPtr<uint8_t> mSignature;
137 
138  System::SharedPtr<System::IO::MemoryStream> StreamPROJECT();
139  static System::SharedPtr<System::IO::MemoryStream> Stream_VBA_PROJECT();
140  void WriteDir(System::SharedPtr<System::IO::MemoryStream> compressedDir);
141 
142 };
143 
144 }
145 }
Definition: IFontData.h:20
@ InsertLineBreaks
Insert line breaks after every 76th character.
#define FRIEND_FUNCTION_System_MakeObject
Macro to befriend MakeObject function.
Definition: smart_ptr.h:1366