LibreOffice Module filter (master) 1
|
#include <xmlfiltersettingsdialog.hxx>
Public Member Functions | |
XMLFilterSettingsDialog (weld::Window *pParent, const css::uno::Reference< css::uno::XComponentContext > &rxContext) | |
virtual | ~XMLFilterSettingsDialog () override |
DECL_LINK (ClickHdl_Impl, weld::Button &, void) | |
DECL_LINK (SelectionChangedHdl_Impl, weld::TreeView &, void) | |
DECL_LINK (DoubleClickHdl_Impl, weld::TreeView &, bool) | |
void | UpdateWindow () |
void | present () |
void | onNew () |
is called when the user clicks on the "New" button More... | |
void | onEdit () |
is called when the user clicks on the "Edit" Button More... | |
void | onTest () |
is called when the user clicks the "Test" button More... | |
void | onDelete () |
void | onSave () |
void | onOpen () |
void | updateStates () |
Public Member Functions inherited from weld::GenericDialogController | |
GenericDialogController (weld::Widget *pParent, const OUString &rUIFile, const OUString &rDialogId, bool bMobile=false) | |
virtual Dialog * | getDialog () override |
virtual | ~GenericDialogController () COVERITY_NOEXCEPT_FALSE override |
Public Member Functions inherited from weld::DialogController | |
virtual Dialog * | getDialog ()=0 |
const Dialog * | getConstDialog () const |
virtual short | run () |
void | set_title (const OUString &rTitle) |
OUString | get_title () const |
void | set_help_id (const OUString &rHelpId) |
OUString | get_help_id () const |
void | response (int nResponse) |
virtual | ~DialogController () COVERITY_NOEXCEPT_FALSE |
Private Member Functions | |
void | initFilterList () |
void | disposeFilterList () |
void | incBusy () |
void | decBusy () |
bool | insertOrEdit (filter_info_impl *pNewInfo, const filter_info_impl *pOldInfo=nullptr) |
inserts a new filter into the ui and configuration if pOldInfo is NULL. More... | |
OUString | createUniqueFilterName (const OUString &rUIName) |
checks if the given name is unique inside the filter factory. More... | |
OUString | createUniqueTypeName (const OUString &rTypeName) |
checks if the given name is unique inside the type detection. More... | |
OUString | createUniqueInterfaceName (const OUString &rInterfaceName) |
checks if the given name is a unique ui name inside the filter factory. More... | |
void | addFilterEntry (const filter_info_impl *pInfo) |
adds a new filter info entry to the ui filter list More... | |
void | changeEntry (const filter_info_impl *pInfo) |
Static Private Member Functions | |
static OUString | getEntryString (const filter_info_impl *pInfo) |
Private Attributes | |
css::uno::Reference< css::uno::XComponentContext > | mxContext |
css::uno::Reference< css::container::XNameContainer > | mxFilterContainer |
css::uno::Reference< css::container::XNameContainer > | mxTypeDetection |
css::uno::Reference< css::container::XNameContainer > | mxExtendedTypeDetection |
std::vector< std::unique_ptr< filter_info_impl > > | maFilterVector |
TopLevelWindowLocker | maBusy |
OUString | m_sTemplatePath |
OUString | m_sDocTypePrefix |
SvtModuleOptions | maModuleOpt |
std::unique_ptr< weld::Button > | m_xPBNew |
std::unique_ptr< weld::Button > | m_xPBEdit |
std::unique_ptr< weld::Button > | m_xPBTest |
std::unique_ptr< weld::Button > | m_xPBDelete |
std::unique_ptr< weld::Button > | m_xPBSave |
std::unique_ptr< weld::Button > | m_xPBOpen |
std::unique_ptr< weld::Button > | m_xPBClose |
std::unique_ptr< weld::TreeView > | m_xFilterListBox |
Additional Inherited Members | |
Static Public Member Functions inherited from weld::DialogController | |
static bool | runAsync (const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &) |
Protected Attributes inherited from weld::GenericDialogController | |
std::unique_ptr< weld::Builder > | m_xBuilder |
std::shared_ptr< weld::Dialog > | m_xDialog |
Definition at line 29 of file xmlfiltersettingsdialog.hxx.
XMLFilterSettingsDialog::XMLFilterSettingsDialog | ( | weld::Window * | pParent, |
const css::uno::Reference< css::uno::XComponentContext > & | rxContext | ||
) |
Definition at line 63 of file xmlfiltersettingsdialog.cxx.
References Exception, LINK, m_sTemplatePath, m_xFilterListBox, m_xPBClose, m_xPBDelete, m_xPBEdit, m_xPBNew, m_xPBOpen, m_xPBSave, m_xPBTest, mxContext, mxExtendedTypeDetection, mxFilterContainer, mxTypeDetection, SvtPathOptions::SubstituteVariable(), and TOOLS_WARN_EXCEPTION.
|
overridevirtual |
Definition at line 110 of file xmlfiltersettingsdialog.cxx.
|
private |
adds a new filter info entry to the ui filter list
Definition at line 1204 of file xmlfiltersettingsdialog.cxx.
References getEntryString(), m_xFilterListBox, filter_info_impl::maFilterName, sId, and weld::toId().
Referenced by initFilterList(), and insertOrEdit().
|
private |
Definition at line 1212 of file xmlfiltersettingsdialog.cxx.
References getEntryString(), m_xFilterListBox, filter_info_impl::maFilterName, nCount, and nPos.
Referenced by insertOrEdit().
|
private |
checks if the given name is unique inside the filter factory.
If not, numbers are added until the returned name is unique
Definition at line 302 of file xmlfiltersettingsdialog.cxx.
References mxFilterContainer, and nId.
Referenced by onNew().
|
private |
checks if the given name is a unique ui name inside the filter factory.
If not, numbers are added until the returned name is unique
Definition at line 334 of file xmlfiltersettingsdialog.cxx.
References Any, Exception, mxFilterContainer, nValue, pValues, o3tl::toInt32(), and TOOLS_WARN_EXCEPTION.
Referenced by onNew().
|
private |
checks if the given name is unique inside the type detection.
If not, numbers are added until the returned name is unique
Definition at line 318 of file xmlfiltersettingsdialog.cxx.
References mxFilterContainer, and nId.
Referenced by insertOrEdit().
|
inlineprivate |
Definition at line 57 of file xmlfiltersettingsdialog.hxx.
References TopLevelWindowLocker::decBusy(), and maBusy.
XMLFilterSettingsDialog::DECL_LINK | ( | ClickHdl_Impl | , |
weld::Button & | , | ||
void | |||
) |
XMLFilterSettingsDialog::DECL_LINK | ( | DoubleClickHdl_Impl | , |
weld::TreeView & | , | ||
bool | |||
) |
XMLFilterSettingsDialog::DECL_LINK | ( | SelectionChangedHdl_Impl | , |
weld::TreeView & | , | ||
void | |||
) |
|
private |
Definition at line 932 of file xmlfiltersettingsdialog.cxx.
References m_xFilterListBox, and maFilterVector.
Referenced by onOpen(), and UpdateWindow().
|
staticprivate |
Definition at line 1227 of file xmlfiltersettingsdialog.cxx.
References getApplicationUIName(), filter_info_impl::maExportService, filter_info_impl::maFlags, and filter_info_impl::maImportService.
Referenced by addFilterEntry(), and changeEntry().
|
inlineprivate |
Definition at line 56 of file xmlfiltersettingsdialog.hxx.
References TopLevelWindowLocker::incBusy(), weld::GenericDialogController::m_xDialog, and maBusy.
|
private |
Definition at line 938 of file xmlfiltersettingsdialog.cxx.
References addFilterEntry(), Any, Exception, m_sDocTypePrefix, m_xFilterListBox, maFilterVector, mxFilterContainer, mxTypeDetection, n, nValue, pValues, and TOOLS_WARN_EXCEPTION.
Referenced by onOpen(), and UpdateWindow().
|
private |
inserts a new filter into the ui and configuration if pOldInfo is NULL.
If pOldInfo is not null, the old filter will be replaced with the new settings
Definition at line 390 of file xmlfiltersettingsdialog.cxx.
References addFilterEntry(), Any, aTypes, changeEntry(), copyStreams(), createDirectory(), createExtensionsSequence(), createUniqueTypeName(), Exception, filter_info_impl::getFilterUserData(), INetURLObject::GetLastName(), m_sDocTypePrefix, m_sTemplatePath, filter_info_impl::maDocType, filter_info_impl::maDocumentService, filter_info_impl::maExportXSLT, filter_info_impl::maExtension, filter_info_impl::maFileFormatVersion, filter_info_impl::maFilterName, maFilterVector, filter_info_impl::maFlags, filter_info_impl::maImportTemplate, filter_info_impl::maImportXSLT, filter_info_impl::maInterfaceName, comphelper::makePropertyValue(), filter_info_impl::maType, filter_info_impl::mnDocumentIconID, mxExtendedTypeDetection, mxFilterContainer, mxTypeDetection, Name, nCount, nIndex, pValues, TOOLS_WARN_EXCEPTION, and Value.
void XMLFilterSettingsDialog::onDelete | ( | ) |
Definition at line 719 of file xmlfiltersettingsdialog.cxx.
References Any, Application::CreateMessageDialog(), Exception, weld::GenericDialogController::m_xDialog, m_xFilterListBox, filter_info_impl::maFilterName, maFilterVector, filter_info_impl::maType, mxFilterContainer, mxTypeDetection, nCount, nIndex, nValue, p, pValues, RET_YES, TOOLS_WARN_EXCEPTION, and updateStates().
void XMLFilterSettingsDialog::onEdit | ( | ) |
is called when the user clicks on the "Edit" Button
Definition at line 227 of file xmlfiltersettingsdialog.cxx.
References XMLFilterTabDialog::getNewFilterInfo(), insertOrEdit(), weld::GenericDialogController::m_xDialog, m_xFilterListBox, mxContext, RET_OK, and weld::DialogController::run().
void XMLFilterSettingsDialog::onNew | ( | ) |
is called when the user clicks on the "New" button
Definition at line 201 of file xmlfiltersettingsdialog.cxx.
References createUniqueFilterName(), createUniqueInterfaceName(), XMLFilterTabDialog::getNewFilterInfo(), insertOrEdit(), weld::GenericDialogController::m_xDialog, filter_info_impl::maDocumentService, filter_info_impl::maExtension, filter_info_impl::maFilterName, filter_info_impl::maInterfaceName, mxContext, RET_OK, weld::DialogController::run(), and STR_DEFAULT_EXTENSION.
void XMLFilterSettingsDialog::onOpen | ( | ) |
Definition at line 867 of file xmlfiltersettingsdialog.cxx.
References sfx2::FileDialogHelper::AddFilter(), aURL, Application::CreateMessageDialog(), disposeFilterList(), ERRCODE_NONE, sfx2::FileDialogHelper::Execute(), INetURLObject::GetLastName(), sfx2::FileDialogHelper::GetPath(), initFilterList(), insertOrEdit(), weld::GenericDialogController::m_xDialog, mxContext, XMLFilterJarHelper::openPackage(), sfx2::FileDialogHelper::SetContext(), and sfx2::FileDialogHelper::XMLFilterSettings.
void XMLFilterSettingsDialog::onSave | ( | ) |
Definition at line 812 of file xmlfiltersettingsdialog.cxx.
References sfx2::FileDialogHelper::AddFilter(), aURL, Application::CreateMessageDialog(), ERRCODE_NONE, sfx2::FileDialogHelper::Execute(), sfx2::FileDialogHelper::GetPath(), weld::GenericDialogController::m_xDialog, m_xFilterListBox, mxContext, XMLFilterJarHelper::savePackage(), sfx2::FileDialogHelper::SetContext(), and sfx2::FileDialogHelper::XMLFilterSettings.
void XMLFilterSettingsDialog::onTest | ( | ) |
is called when the user clicks the "Test" button
Definition at line 708 of file xmlfiltersettingsdialog.cxx.
References weld::GenericDialogController::m_xDialog, m_xFilterListBox, mxContext, and XMLFilterTestDialog::test().
|
inline |
Definition at line 42 of file xmlfiltersettingsdialog.hxx.
References weld::GenericDialogController::m_xDialog.
void XMLFilterSettingsDialog::updateStates | ( | ) |
Definition at line 170 of file xmlfiltersettingsdialog.cxx.
References SvtModuleOptions::GetFactoryDefaultFilter(), m_xFilterListBox, m_xPBDelete, m_xPBEdit, m_xPBSave, m_xPBTest, filter_info_impl::maFilterName, maModuleOpt, and filter_info_impl::mbReadonly.
Referenced by onDelete(), and UpdateWindow().
void XMLFilterSettingsDialog::UpdateWindow | ( | ) |
Definition at line 161 of file xmlfiltersettingsdialog.cxx.
References disposeFilterList(), initFilterList(), m_xFilterListBox, and updateStates().
|
private |
Definition at line 83 of file xmlfiltersettingsdialog.hxx.
Referenced by initFilterList(), and insertOrEdit().
|
private |
Definition at line 82 of file xmlfiltersettingsdialog.hxx.
Referenced by insertOrEdit(), and XMLFilterSettingsDialog().
|
private |
Definition at line 94 of file xmlfiltersettingsdialog.hxx.
Referenced by addFilterEntry(), changeEntry(), disposeFilterList(), initFilterList(), onDelete(), onEdit(), onSave(), onTest(), updateStates(), UpdateWindow(), and XMLFilterSettingsDialog().
|
private |
Definition at line 93 of file xmlfiltersettingsdialog.hxx.
Referenced by XMLFilterSettingsDialog().
|
private |
Definition at line 90 of file xmlfiltersettingsdialog.hxx.
Referenced by updateStates(), and XMLFilterSettingsDialog().
|
private |
Definition at line 88 of file xmlfiltersettingsdialog.hxx.
Referenced by updateStates(), and XMLFilterSettingsDialog().
|
private |
Definition at line 87 of file xmlfiltersettingsdialog.hxx.
Referenced by XMLFilterSettingsDialog().
|
private |
Definition at line 92 of file xmlfiltersettingsdialog.hxx.
Referenced by XMLFilterSettingsDialog().
|
private |
Definition at line 91 of file xmlfiltersettingsdialog.hxx.
Referenced by updateStates(), and XMLFilterSettingsDialog().
|
private |
Definition at line 89 of file xmlfiltersettingsdialog.hxx.
Referenced by updateStates(), and XMLFilterSettingsDialog().
|
private |
Definition at line 80 of file xmlfiltersettingsdialog.hxx.
|
private |
Definition at line 78 of file xmlfiltersettingsdialog.hxx.
Referenced by disposeFilterList(), initFilterList(), insertOrEdit(), and onDelete().
|
private |
Definition at line 85 of file xmlfiltersettingsdialog.hxx.
Referenced by updateStates().
|
private |
|
private |
Definition at line 76 of file xmlfiltersettingsdialog.hxx.
Referenced by insertOrEdit(), and XMLFilterSettingsDialog().
|
private |
Definition at line 74 of file xmlfiltersettingsdialog.hxx.
Referenced by createUniqueFilterName(), createUniqueInterfaceName(), createUniqueTypeName(), initFilterList(), insertOrEdit(), onDelete(), and XMLFilterSettingsDialog().
|
private |
Definition at line 75 of file xmlfiltersettingsdialog.hxx.
Referenced by initFilterList(), insertOrEdit(), onDelete(), and XMLFilterSettingsDialog().