#ifndef INCLUDED_VCL_INC_SALVTABLES_HXX #define INCLUDED_VCL_INC_SALVTABLES_HXX #include #include #include #include #include #include class SalInstanceBuilder : public weld::Builder { private: std::unique_ptr m_xBuilder; VclPtr m_aOwnedToplevel; public: SalInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile); virtual std::unique_ptr weld_message_dialog(const OString& id, bool bTakeOwnership = true) override; virtual std::unique_ptr weld_about_dialog(const OString& id, bool bTakeOwnership = true) override; virtual std::unique_ptr weld_dialog(const OString& id, bool bTakeOwnership = true) override; virtual std::unique_ptr weld_assistant(const OString& id, bool bTakeOwnership = true) override; virtual std::unique_ptr create_screenshot_window() override; virtual std::unique_ptr weld_window(const OString& id, bool bTakeOwnership = true) override; virtual std::unique_ptr weld_widget(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_container(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_box(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_frame(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_scrolled_window(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_notebook(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_button(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_menu_button(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_link_button(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_toggle_button(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_radio_button(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_check_button(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_scale(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_progress_bar(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_spinner(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_image(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_calendar(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_entry(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_spin_button(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_metric_spin_button(const OString& id, FieldUnit eUnit, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_formatted_spin_button(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_time_spin_button(const OString& id, TimeFieldFormat eFormat, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_combo_box(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_entry_tree_view(const OString& containerid, const OString& entryid, const OString& treeviewid, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_tree_view(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_icon_view(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_label(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_text_view(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_expander(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_drawing_area(const OString& id, const a11yref& rA11yImpl = nullptr, FactoryFunction pUITestFactoryFunction = nullptr, void* pUserData = nullptr, bool bTakeOwnership = false) override; virtual std::unique_ptr weld_menu(const OString& id, bool bTakeOwnership = true) override; virtual std::unique_ptr weld_toolbar(const OString& id, bool bTakeOwnership = false) override; virtual std::unique_ptr create_size_group() override; OString get_current_page_help_id() const; virtual ~SalInstanceBuilder() override; }; class SalInstanceWidget : public virtual weld::Widget { protected: VclPtr m_xWidget; SalInstanceBuilder* m_pBuilder; private: DECL_LINK(EventListener, VclWindowEvent&, void); DECL_LINK(KeyEventListener, VclWindowEvent&, bool); DECL_LINK(MouseEventListener, VclSimpleEvent&, void); DECL_LINK(MnemonicActivateHdl, vcl::Window&, bool); const bool m_bTakeOwnership; bool m_bEventListener; bool m_bKeyEventListener; bool m_bMouseEventListener; int m_nBlockNotify; protected: void ensure_event_listener(); // we want the ability to mark key events as handled, so use this variant // for those, we get all keystrokes in this case, so we will need to filter // them later void ensure_key_listener(); // we want the ability to know about mouse events that happen in our children // so use this variant, we will need to filter them later void ensure_mouse_listener(); virtual void HandleEventListener(VclWindowEvent& rEvent); virtual bool HandleKeyEventListener(VclWindowEvent& rEvent); virtual void HandleMouseEventListener(VclSimpleEvent& rEvent); void set_background(const Color& rColor); public: SalInstanceWidget(vcl::Window* pWidget, SalInstanceBuilder* pBuilder, bool bTakeOwnership); virtual void set_sensitive(bool sensitive) override; virtual bool get_sensitive() const override; virtual bool get_visible() const override; virtual bool is_visible() const override; virtual void set_can_focus(bool bCanFocus) override; virtual void grab_focus() override; virtual bool has_focus() const override; virtual bool is_active() const override; virtual void set_has_default(bool has_default) override; virtual bool get_has_default() const override; virtual void show() override; virtual void hide() override; virtual void set_size_request(int nWidth, int nHeight) override; virtual Size get_size_request() const override; virtual Size get_preferred_size() const override; virtual float get_approximate_digit_width() const override; virtual int get_text_height() const override; virtual Size get_pixel_size(const OUString& rText) const override; virtual vcl::Font get_font() override; virtual OString get_buildable_name() const override; virtual void set_help_id(const OString& rId) override; virtual OString get_help_id() const override; virtual void set_grid_left_attach(int nAttach) override; virtual int get_grid_left_attach() const override; virtual void set_grid_width(int nCols) override; virtual void set_grid_top_attach(int nAttach) override; virtual int get_grid_top_attach() const override; virtual void set_hexpand(bool bExpand) override; virtual bool get_hexpand() const override; virtual void set_vexpand(bool bExpand) override; virtual bool get_vexpand() const override; virtual void set_secondary(bool bSecondary) override; virtual void set_margin_top(int nMargin) override; virtual void set_margin_bottom(int nMargin) override; virtual void set_margin_left(int nMargin) override; virtual void set_margin_right(int nMargin) override; virtual int get_margin_top() const override; virtual int get_margin_bottom() const override; virtual int get_margin_left() const override; virtual int get_margin_right() const override; virtual void set_accessible_name(const OUString& rName) override; virtual OUString get_accessible_name() const override; virtual OUString get_accessible_description() const override; virtual void set_accessible_relation_labeled_by(weld::Widget* pLabel) override; virtual void set_accessible_relation_label_for(weld::Widget* pLabeled) override; virtual void add_extra_accessible_relation(const css::accessibility::AccessibleRelation& rRelation) override; virtual void clear_extra_accessible_relations() override; virtual void set_tooltip_text(const OUString& rTip) override; virtual OUString get_tooltip_text() const override; virtual void connect_focus_in(const Link& rLink) override; virtual void connect_mnemonic_activate(const Link& rLink) override; virtual void connect_focus_out(const Link& rLink) override; virtual void connect_size_allocate(const Link& rLink) override; virtual void connect_mouse_press(const Link& rLink) override; virtual void connect_mouse_move(const Link& rLink) override; virtual void connect_mouse_release(const Link& rLink) override; virtual void connect_key_press(const Link& rLink) override; virtual void connect_key_release(const Link& rLink) override; virtual bool get_extents_relative_to(Widget& rRelative, int& x, int& y, int& width, int& height) override; virtual void grab_add() override; virtual bool has_grab() const override; virtual void grab_remove() override; virtual bool get_direction() const override; virtual void set_direction(bool bRTL) override; virtual void freeze() override; virtual void thaw() override; virtual std::unique_ptr weld_parent() const override; virtual ~SalInstanceWidget() override; vcl::Window* getWidget(); void disable_notify_events(); bool notify_events_disabled(); void enable_notify_events(); virtual void help_hierarchy_foreach(const std::function& func) override; virtual OUString strip_mnemonic(const OUString& rLabel) const override; virtual VclPtr create_virtual_device() const override; virtual css::uno::Reference get_drop_target() override; virtual void connect_get_property_tree(const Link& rLink) override; virtual void set_stack_background() override; virtual void set_toolbar_background() override; virtual void set_highlight_background() override; SystemWindow* getSystemWindow(); }; class SalInstanceLabel : public SalInstanceWidget, public virtual weld::Label { private: // Control instead of FixedText so we can also use this for // SelectableFixedText which is derived from Edit. We just typically need // [G|S]etText which exists in their shared baseclass VclPtr m_xLabel; public: SalInstanceLabel(Control* pLabel, SalInstanceBuilder* pBuilder, bool bTakeOwnership); virtual void set_label(const OUString& rText) override; virtual OUString get_label() const override; virtual void set_mnemonic_widget(Widget* pTarget) override; virtual void set_message_type(weld::EntryMessageType eType) override; virtual void set_font(const vcl::Font& rFont) override; }; class SalInstanceContainer : public SalInstanceWidget, public virtual weld::Container { protected: VclPtr m_xContainer; private: void implResetDefault(const vcl::Window* _pWindow); public: SalInstanceContainer(vcl::Window* pContainer, SalInstanceBuilder* pBuilder, bool bTakeOwnership); virtual void move(weld::Widget* pWidget, weld::Container* pNewParent) override; virtual void recursively_unset_default_buttons() override; virtual css::uno::Reference CreateChildFrame() override; }; class SalInstanceWindow : public SalInstanceContainer, public virtual weld::Window { private: VclPtr m_xWindow; DECL_LINK(HelpHdl, vcl::Window&, bool); void override_child_help(vcl::Window* pParent); void clear_child_help(vcl::Window* pParent); public: SalInstanceWindow(vcl::Window* pWindow, SalInstanceBuilder* pBuilder, bool bTakeOwnership); virtual void set_title(const OUString& rTitle) override; virtual OUString get_title() const override; void help(); virtual void set_busy_cursor(bool bBusy) override; virtual css::uno::Reference GetXWindow() override; virtual void resize_to_request() override; virtual void set_modal(bool bModal) override; virtual bool get_modal() const override; virtual void window_move(int x, int y) override; virtual Size get_size() const override; virtual Point get_position() const override; virtual tools::Rectangle get_monitor_workarea() const override; virtual void set_centered_on_parent(bool /*bTrackGeometryRequests*/) override; virtual bool get_resizable() const override; virtual bool has_toplevel_focus() const override; virtual void present() override; virtual void set_window_state(const OString& rStr) override; virtual OString get_window_state(WindowStateMask nMask) const override; virtual SystemEnvData get_system_data() const override; virtual void connect_toplevel_focus_changed(const Link& rLink) override; virtual void HandleEventListener(VclWindowEvent& rEvent) override; virtual void draw(VirtualDevice& rOutput) override; virtual weld::ScreenShotCollection collect_screenshot_data() override; virtual ~SalInstanceWindow() override; }; class SalInstanceDialog : public SalInstanceWindow, public virtual weld::Dialog { private: VclPtr<::Dialog> m_xDialog; // for calc ref dialog that shrink to range selection widgets and resize back VclPtr m_xRefEdit; std::vector> m_aHiddenWidgets; // vector of hidden Controls long m_nOldEditWidthReq; // Original width request of the input field sal_Int32 m_nOldBorderWidth; // border width for expanded dialog DECL_LINK(PopupScreenShotMenuHdl, const CommandEvent&, bool); public: SalInstanceDialog(::Dialog* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership); virtual bool runAsync(std::shared_ptr aOwner, const std::function& rEndDialogFn) override; virtual bool runAsync(std::shared_ptr const& rxSelf, const std::function& rEndDialogFn) override; virtual void collapse(weld::Widget* pEdit, weld::Widget* pButton) override; virtual void undo_collapse() override; virtual void SetInstallLOKNotifierHdl(const Link& rLink) override; virtual int run() override; virtual void response(int nResponse) override; virtual void add_button(const OUString& rText, int nResponse, const OString& rHelpId = OString()) override; virtual void set_modal(bool bModal) override; virtual bool get_modal() const override; virtual weld::Button* weld_widget_for_response(int nResponse) override; virtual void set_default_response(int nResponse) override; virtual weld::Container* weld_content_area() override; }; #endif