LibreOffice Module oox (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
oox::ole::VbaModule Class Reference

#include <vbamodule.hxx>

Public Member Functions

 VbaModule (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XModel > &rxDocModel, OUString aName, rtl_TextEncoding eTextEnc, bool bExecutable)
 
sal_Int32 getType () const
 Returns the module type (com.sun.star.script.ModuleType constant). More...
 
void setType (sal_Int32 nType)
 Sets the passed module type. More...
 
const OUString & getName () const
 Returns the name of the module. More...
 
const OUString & getStreamName () const
 Returns the stream name of the module. More...
 
void importDirRecords (BinaryInputStream &rDirStrm)
 Imports all records for this module until the MODULEEND record. More...
 
void createAndImportModule (StorageBase &rVbaStrg, const css::uno::Reference< css::container::XNameContainer > &rxBasicLib, const css::uno::Reference< css::container::XNameAccess > &rxDocObjectNA)
 Imports the VBA source code into the passed Basic library. More...
 
void createEmptyModule (const css::uno::Reference< css::container::XNameContainer > &rxBasicLib, const css::uno::Reference< css::container::XNameAccess > &rxDocObjectNA) const
 Creates an empty Basic module in the passed Basic library. More...
 
void registerShortcutKeys ()
 

Private Member Functions

OUString readSourceCode (StorageBase &rVbaStrg)
 Reads and returns the VBA source code from the passed storage. More...
 
void createModule (std::u16string_view rVBASourceCode, const css::uno::Reference< css::container::XNameContainer > &rxBasicLib, const css::uno::Reference< css::container::XNameAccess > &rxDocObjectNA) const
 Creates a new Basic module and inserts it into the passed Basic library. More...
 

Private Attributes

css::uno::Reference< css::uno::XComponentContext > mxContext
 Component context with service manager. More...
 
css::uno::Reference< css::frame::XModel > mxDocModel
 Document model used to import/export the VBA project. More...
 
OUString maName
 
OUString maStreamName
 
OUString maDocString
 
rtl_TextEncoding meTextEnc
 
sal_Int32 mnType
 
sal_uInt32 mnOffset
 
bool mbReadOnly
 
bool mbPrivate
 
bool mbExecutable
 
std::vector< VbaMacroKeyAndMethodBindingmaKeyBindings
 Keys and VBA macro method bindings. More...
 

Detailed Description

Definition at line 54 of file vbamodule.hxx.

Constructor & Destructor Documentation

◆ VbaModule()

oox::ole::VbaModule::VbaModule ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::uno::Reference< css::frame::XModel > &  rxDocModel,
OUString  aName,
rtl_TextEncoding  eTextEnc,
bool  bExecutable 
)
explicit

Definition at line 46 of file vbamodule.cxx.

References aName, mnType, mxContext, SAL_MAX_UINT32, script, and UNKNOWN.

Member Function Documentation

◆ createAndImportModule()

void oox::ole::VbaModule::createAndImportModule ( StorageBase rVbaStrg,
const css::uno::Reference< css::container::XNameContainer > &  rxBasicLib,
const css::uno::Reference< css::container::XNameAccess > &  rxDocObjectNA 
)

Imports the VBA source code into the passed Basic library.

Definition at line 130 of file vbamodule.cxx.

References createModule(), readSourceCode(), and registerShortcutKeys().

Referenced by oox::ole::VbaProject::importModulesAndForms().

◆ createEmptyModule()

void oox::ole::VbaModule::createEmptyModule ( const css::uno::Reference< css::container::XNameContainer > &  rxBasicLib,
const css::uno::Reference< css::container::XNameAccess > &  rxDocObjectNA 
) const

Creates an empty Basic module in the passed Basic library.

Definition at line 154 of file vbamodule.cxx.

References createModule(), and u.

Referenced by oox::ole::VbaProject::importModulesAndForms().

◆ createModule()

void oox::ole::VbaModule::createModule ( std::u16string_view  rVBASourceCode,
const css::uno::Reference< css::container::XNameContainer > &  rxBasicLib,
const css::uno::Reference< css::container::XNameAccess > &  rxDocObjectNA 
) const
private

Creates a new Basic module and inserts it into the passed Basic library.

Definition at line 266 of file vbamodule.cxx.

References Any, Exception, maName, mbExecutable, mnType, and mxDocModel.

Referenced by createAndImportModule(), and createEmptyModule().

◆ getName()

const OUString & oox::ole::VbaModule::getName ( ) const
inline

Returns the name of the module.

Definition at line 70 of file vbamodule.hxx.

References maName.

Referenced by oox::ole::VbaProject::importModulesAndForms().

◆ getStreamName()

const OUString & oox::ole::VbaModule::getStreamName ( ) const
inline

Returns the stream name of the module.

Definition at line 72 of file vbamodule.hxx.

References maStreamName.

◆ getType()

sal_Int32 oox::ole::VbaModule::getType ( ) const
inline

Returns the module type (com.sun.star.script.ModuleType constant).

Definition at line 65 of file vbamodule.hxx.

References mnType.

Referenced by oox::ole::VbaProject::importModulesAndForms().

◆ importDirRecords()

void oox::ole::VbaModule::importDirRecords ( BinaryInputStream rDirStrm)

◆ readSourceCode()

OUString oox::ole::VbaModule::readSourceCode ( StorageBase rVbaStrg)
private

◆ registerShortcutKeys()

void oox::ole::VbaModule::registerShortcutKeys ( )

◆ setType()

void oox::ole::VbaModule::setType ( sal_Int32  nType)
inline

Sets the passed module type.

Definition at line 67 of file vbamodule.hxx.

References mnType, and nType.

Member Data Documentation

◆ maDocString

OUString oox::ole::VbaModule::maDocString
private

Definition at line 106 of file vbamodule.hxx.

Referenced by importDirRecords().

◆ maKeyBindings

std::vector<VbaMacroKeyAndMethodBinding> oox::ole::VbaModule::maKeyBindings
private

Keys and VBA macro method bindings.

Definition at line 115 of file vbamodule.hxx.

Referenced by readSourceCode(), and registerShortcutKeys().

◆ maName

OUString oox::ole::VbaModule::maName
private

Definition at line 104 of file vbamodule.hxx.

Referenced by createModule(), getName(), and importDirRecords().

◆ maStreamName

OUString oox::ole::VbaModule::maStreamName
private

Definition at line 105 of file vbamodule.hxx.

Referenced by getStreamName(), importDirRecords(), and readSourceCode().

◆ mbExecutable

bool oox::ole::VbaModule::mbExecutable
private

Definition at line 112 of file vbamodule.hxx.

Referenced by createModule(), and readSourceCode().

◆ mbPrivate

bool oox::ole::VbaModule::mbPrivate
private

Definition at line 111 of file vbamodule.hxx.

Referenced by importDirRecords().

◆ mbReadOnly

bool oox::ole::VbaModule::mbReadOnly
private

Definition at line 110 of file vbamodule.hxx.

Referenced by importDirRecords().

◆ meTextEnc

rtl_TextEncoding oox::ole::VbaModule::meTextEnc
private

Definition at line 107 of file vbamodule.hxx.

Referenced by importDirRecords(), and readSourceCode().

◆ mnOffset

sal_uInt32 oox::ole::VbaModule::mnOffset
private

Definition at line 109 of file vbamodule.hxx.

Referenced by importDirRecords(), and readSourceCode().

◆ mnType

sal_Int32 oox::ole::VbaModule::mnType
private

Definition at line 108 of file vbamodule.hxx.

Referenced by createModule(), getType(), importDirRecords(), and setType().

◆ mxContext

css::uno::Reference< css::uno::XComponentContext > oox::ole::VbaModule::mxContext
private

Component context with service manager.

Definition at line 101 of file vbamodule.hxx.

Referenced by readSourceCode().

◆ mxDocModel

css::uno::Reference< css::frame::XModel > oox::ole::VbaModule::mxDocModel
private

Document model used to import/export the VBA project.

Definition at line 103 of file vbamodule.hxx.

Referenced by createModule(), and registerShortcutKeys().


The documentation for this class was generated from the following files: