/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include #include #include #include #include #include #include QtInstanceBuilder::QtInstanceBuilder(QWidget* pParent, std::u16string_view sUIRoot, const OUString& rUIFile) : m_xBuilder(std::make_unique(pParent, sUIRoot, rUIFile)) { } QtInstanceBuilder::~QtInstanceBuilder() {} bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile) { // set of supported UI files // // The idea is to implement functionality needed for a specific UI file/dialog // in QtInstanceBuilder, then add it to the set of supported UI files here. // This allows looking at one .ui file at a time and only having to implement // what is relevant for that particular one, without having to implement the full // weld API at once. static std::unordered_set aSupportedUIFiles = { u"modules/schart/ui/insertaxisdlg.ui"_ustr, u"modules/swriter/ui/inforeadonlydialog.ui"_ustr, u"sfx/ui/licensedialog.ui"_ustr, u"sfx/ui/querysavedialog.ui"_ustr, }; return aSupportedUIFiles.contains(rUIFile); } std::unique_ptr QtInstanceBuilder::weld_message_dialog(const OUString& id) { QMessageBox* pMessageBox = m_xBuilder->get(id); std::unique_ptr xRet( pMessageBox ? std::make_unique(pMessageBox) : nullptr); return xRet; } std::unique_ptr QtInstanceBuilder::weld_dialog(const OUString& rId) { QDialog* pDialog = m_xBuilder->get(rId); std::unique_ptr xRet(pDialog ? std::make_unique(pDialog) : nullptr); return xRet; } std::unique_ptr QtInstanceBuilder::weld_assistant(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::create_screenshot_window() { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_widget(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_container(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_box(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_paned(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_frame(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_scrolled_window(const OUString&, bool) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_notebook(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_button(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_menu_button(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_menu_toggle_button(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_link_button(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_toggle_button(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_radio_button(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_check_button(const OUString& rId) { QCheckBox* pCheckBox = m_xBuilder->get(rId); std::unique_ptr xRet( pCheckBox ? std::make_unique(pCheckBox) : nullptr); return xRet; } std::unique_ptr QtInstanceBuilder::weld_scale(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_progress_bar(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_level_bar(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_spinner(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_image(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_calendar(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_entry(const OUString& rId) { QLineEdit* pLineEdit = m_xBuilder->get(rId); std::unique_ptr xRet(pLineEdit ? std::make_unique(pLineEdit) : nullptr); return xRet; } std::unique_ptr QtInstanceBuilder::weld_spin_button(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_metric_spin_button(const OUString&, FieldUnit) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_formatted_spin_button(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_combo_box(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_entry_tree_view(const OUString&, const OUString&, const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_tree_view(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_icon_view(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_label(const OUString& rId) { QLabel* pLabel = m_xBuilder->get(rId); std::unique_ptr xRet(pLabel ? std::make_unique(pLabel) : nullptr); return xRet; } std::unique_ptr QtInstanceBuilder::weld_text_view(const OUString& rId) { QPlainTextEdit* pTextEdit = m_xBuilder->get(rId); std::unique_ptr xRet(pTextEdit ? std::make_unique(pTextEdit) : nullptr); return xRet; } std::unique_ptr QtInstanceBuilder::weld_expander(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_drawing_area(const OUString&, const a11yref&, FactoryFunction, void*) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_menu(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_popover(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_toolbar(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::weld_scrollbar(const OUString&) { assert(false && "Not implemented yet"); return nullptr; } std::unique_ptr QtInstanceBuilder::create_size_group() { assert(false && "Not implemented yet"); return nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */