LibreOffice Module wizards (master) 1
Public Member Functions | Static Public Attributes | List of all members
scriptforge.SFScriptForge.SF_Dictionary Class Reference
Inheritance diagram for scriptforge.SFScriptForge.SF_Dictionary:
[legend]
Collaboration diagram for scriptforge.SFScriptForge.SF_Dictionary:
[legend]

Public Member Functions

def __init__ (self, dic=None)
 
def ConvertToPropertyValues (self)
 
def ImportFromPropertyValues (self, propertyvalues, overwrite=False)
 
- Public Member Functions inherited from scriptforge.SFServices
def __init__ (self, reference=-1, objtype=None, classmodule=0, name='')
 
def __getattr__ (self, name)
 
def __setattr__ (self, name, value)
 
def __repr__ (self)
 
def Dispose (self)
 
def ExecMethod (self, flags=0, methodname='', *args)
 
def GetProperty (self, propertyname, arg=None)
 
def Properties (self)
 
def basicmethods (self)
 
def basicproperties (self)
 
def SetProperty (self, propertyname, value)
 

Static Public Attributes

string serviceimplementation = 'python'
 
string servicename = 'ScriptForge.Dictionary'
 
tuple servicesynonyms = ('dictionary', 'scriptforge.dictionary')
 
- Static Public Attributes inherited from scriptforge.SFServices
 vbGet
 
 vbLet
 
 vbMethod
 
 vbSet
 
int flgPost = 32
 
int flgDateArg = 64
 
int flgDateRet = 128
 
int flgArrayArg = 512
 
int flgArrayRet = 1024
 
int flgUno = 256
 
int flgObject = 2048
 
int flgHardCode = 4096
 
 moduleClass
 
 moduleStandard
 
bool forceGetProperty = False
 
dictionary propertysynonyms = {}
 
tuple internal_attributes
 
 SIMPLEEXEC = ScriptForge.InvokeSimpleScript
 
 EXEC = ScriptForge.InvokeBasicService
 

Additional Inherited Members

- Public Attributes inherited from scriptforge.SFServices
 objectreference
 
 objecttype
 
 classmodule
 
 name
 
 internal
 
 localProperties
 
 serviceimplementation
 

Detailed Description

    The service adds to a Python dict instance the interfaces for conversion to and from
    a list of UNO PropertyValues

    Usage:
        dico = dict(A = 1, B = 2, C = 3)
        myDict = CreateScriptService('Dictionary', dico)    # Initialize myDict with the content of dico
        myDict['D'] = 4
        print(myDict)   # {'A': 1, 'B': 2, 'C': 3, 'D': 4}
        propval = myDict.ConvertToPropertyValues()
    or
        dico = dict(A = 1, B = 2, C = 3)
        myDict = CreateScriptService('Dictionary')          # Initialize myDict as an empty dict object
        myDict.update(dico) # Load the values of dico into myDict
        myDict['D'] = 4
        print(myDict)   # {'A': 1, 'B': 2, 'C': 3, 'D': 4}
        propval = myDict.ConvertToPropertyValues()

Definition at line 885 of file scriptforge.py.

Constructor & Destructor Documentation

◆ __init__()

def scriptforge.SFScriptForge.SF_Dictionary.__init__ (   self,
  reference = None 
)
    Trivial initialization of internal properties
    If the subclass has its own __init()__ method, a call to this one should be its first statement.
    Afterwards localProperties should be filled with the list of its own properties

Reimplemented from scriptforge.SFServices.

Definition at line 909 of file scriptforge.py.

References avmedia::priv::MediaWindowControl.update(), avmedia::win::Window.update(), canvas::SpriteRedrawManager::SpriteChangeRecord.update, xforms::Binding.update(), sd::HeaderFooterTabPage.update(), sd::SlideshowImpl.update(), slideshow::internal::LayerManager.update(), sdr::table::SdrTableObjImpl.update(), o3tl::LazyUpdate< typename In, typename Out, typename Func >.update(), slideshow::internal::DrawShape.update(), slideshow::internal::ExternalShapeBase.update(), slideshow::internal::Shape.update(), avmedia::MediaToolBoxControl_Impl.update(), avmedia::gstreamer::Window.update(), avmedia::macavf::Window.update, canvas::GraphicDeviceBase< class Base, class DeviceHelper, class Mutex, class UnambiguousBase >.update(), canvas::GraphicDeviceBase< Base, DeviceHelper, ::osl::MutexGuard, css::uno::XInterface >.update(), chart::ChartToolbarController.update(), chart::ChartView.update(), OCommonEmbeddedObject.update(), ODummyEmbeddedObject.update(), OleEmbeddedObject.update(), xforms::Model.update(), framework::ButtonToolbarController.update(), framework::ProgressBarWrapper.update(), framework::StatusIndicatorFactory.update(), framework::StyleToolbarController.update(), framework::ToolBarWrapper.update(), framework::UIConfigElementWrapperBase.update(), framework::UIElementWrapperBase.update(), rptui::OStatusbarController.update(), sd::framework::ConfigurationController.update(), slideshow::internal::ShapeManagerImpl.update(), svt::StatusbarController.update(), svt::ToolboxController.update(), unogallery::GalleryTheme.update(), StylesPreviewToolBoxControl.update(), SvxColorToolBoxControl.update(), SvxStyleToolBoxControl.update(), SwXDocumentIndex.update(), SwXTextField.update(), avmedia::MediaControl.update(), slideshow::internal::ViewUpdate.update(), canvas::ISurface.update(), ScDocRowHeightUpdater.update(), filter::config::CacheItem.update(), CProgressHandlerHelper.update(), CRC32.update(), slideshow::internal::ViewShape.update(), sd::CustomAnimationList.update(), StorageItem.update(), chart::impl::ControllerState.update(), chart::impl::ModelState.update(), comphelper::SequenceAsHashMap.update(), comphelper::Hash.update(), TmpRepositoryCommandEnv.update(), dp_manager::BaseCommandEnv.update(), dp_manager::PackageManagerImpl::CmdEnvWrapperImpl.update(), migration::TmpRepositoryCommandEnv.update(), dp_gui::UpdateCommandEnv.update(), ScFunctionData.update(), WelfordRunner.update(), QtPainter.update(), dp_misc::ProgressLevel.update(), org::mozilla::gecko::gfx::Layer.update(), pythonscript::DummyProgressHandler.update(), oox::crypto::Decrypt.update(), oox::crypto::Encrypt.update(), oox::crypto::CryptoHash.update(), sd::CustomAnimationDurationTabPage.update(), sd::CustomAnimationEffectTabPage.update(), sd::CustomAnimationTextAnimTabPage.update(), sw::OnlineAccessibilityCheck.update(), and UpdateDialog::Thread.update().

Member Function Documentation

◆ ConvertToPropertyValues()

def scriptforge.SFScriptForge.SF_Dictionary.ConvertToPropertyValues (   self)
    Store the content of the dictionary in an array of PropertyValues.
    Each entry in the array is a com.sun.star.beans.PropertyValue.
    he key is stored in Name, the value is stored in Value.

    If one of the items has a type datetime, it is converted to a com.sun.star.util.DateTime structure.
    If one of the items is an empty list, it is converted to None.

    The resulting array is empty when the dictionary is empty.

Definition at line 915 of file scriptforge.py.

References uno.createUnoStruct().

◆ ImportFromPropertyValues()

def scriptforge.SFScriptForge.SF_Dictionary.ImportFromPropertyValues (   self,
  propertyvalues,
  overwrite = False 
)
    Inserts the contents of an array of PropertyValue objects into the current dictionary.
    PropertyValue Names are used as keys in the dictionary, whereas Values contain the corresponding values.
    Date-type values are converted to datetime.datetime instances.
    :param propertyvalues: a list.tuple containing com.sun.star.beans.PropertyValue objects
    :param overwrite: When True, entries with same name may exist in the dictionary and their values
        are overwritten. When False (default), repeated keys are not overwritten.
    :return: True when successful

Definition at line 948 of file scriptforge.py.

References avmedia::priv::MediaWindowControl.update(), avmedia::win::Window.update(), canvas::SpriteRedrawManager::SpriteChangeRecord.update, xforms::Binding.update(), sd::HeaderFooterTabPage.update(), sd::SlideshowImpl.update(), slideshow::internal::LayerManager.update(), sdr::table::SdrTableObjImpl.update(), o3tl::LazyUpdate< typename In, typename Out, typename Func >.update(), slideshow::internal::DrawShape.update(), slideshow::internal::ExternalShapeBase.update(), slideshow::internal::Shape.update(), avmedia::MediaToolBoxControl_Impl.update(), avmedia::gstreamer::Window.update(), avmedia::macavf::Window.update, canvas::GraphicDeviceBase< class Base, class DeviceHelper, class Mutex, class UnambiguousBase >.update(), canvas::GraphicDeviceBase< Base, DeviceHelper, ::osl::MutexGuard, css::uno::XInterface >.update(), chart::ChartToolbarController.update(), chart::ChartView.update(), OCommonEmbeddedObject.update(), ODummyEmbeddedObject.update(), OleEmbeddedObject.update(), xforms::Model.update(), framework::ButtonToolbarController.update(), framework::ProgressBarWrapper.update(), framework::StatusIndicatorFactory.update(), framework::StyleToolbarController.update(), framework::ToolBarWrapper.update(), framework::UIConfigElementWrapperBase.update(), framework::UIElementWrapperBase.update(), rptui::OStatusbarController.update(), sd::framework::ConfigurationController.update(), slideshow::internal::ShapeManagerImpl.update(), svt::StatusbarController.update(), svt::ToolboxController.update(), unogallery::GalleryTheme.update(), StylesPreviewToolBoxControl.update(), SvxColorToolBoxControl.update(), SvxStyleToolBoxControl.update(), SwXDocumentIndex.update(), SwXTextField.update(), avmedia::MediaControl.update(), slideshow::internal::ViewUpdate.update(), canvas::ISurface.update(), ScDocRowHeightUpdater.update(), filter::config::CacheItem.update(), CProgressHandlerHelper.update(), CRC32.update(), slideshow::internal::ViewShape.update(), sd::CustomAnimationList.update(), StorageItem.update(), chart::impl::ControllerState.update(), chart::impl::ModelState.update(), comphelper::SequenceAsHashMap.update(), comphelper::Hash.update(), TmpRepositoryCommandEnv.update(), dp_manager::BaseCommandEnv.update(), dp_manager::PackageManagerImpl::CmdEnvWrapperImpl.update(), migration::TmpRepositoryCommandEnv.update(), dp_gui::UpdateCommandEnv.update(), ScFunctionData.update(), WelfordRunner.update(), QtPainter.update(), dp_misc::ProgressLevel.update(), org::mozilla::gecko::gfx::Layer.update(), pythonscript::DummyProgressHandler.update(), oox::crypto::Decrypt.update(), oox::crypto::Encrypt.update(), oox::crypto::CryptoHash.update(), sd::CustomAnimationDurationTabPage.update(), sd::CustomAnimationEffectTabPage.update(), sd::CustomAnimationTextAnimTabPage.update(), sw::OnlineAccessibilityCheck.update(), and UpdateDialog::Thread.update().

Member Data Documentation

◆ serviceimplementation

string scriptforge.SFScriptForge.SF_Dictionary.serviceimplementation = 'python'
static

◆ servicename

string scriptforge.SFScriptForge.SF_Dictionary.servicename = 'ScriptForge.Dictionary'
static

◆ servicesynonyms

tuple scriptforge.SFScriptForge.SF_Dictionary.servicesynonyms = ('dictionary', 'scriptforge.dictionary')
static

Definition at line 907 of file scriptforge.py.


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