Generated reference › API — ICoreBlocks/ICoreStudio/StudioObjects/Panels/SearchBar
kind: generated#api#icoreblocks-icorestudio-studioobjects-panels-searchbar

API — ICoreBlocks/ICoreStudio/StudioObjects/Panels/SearchBar

The public contract of 3 header(s) under src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/SearchBar — 6 class/struct definition(s), 49 declaration(s). Each section shows the header's banner and its public (and protected-virtual) surface exactly as the file writes it.

HeaderDefinesDeclarationsBases
ICoreGlobalSearchDialog.hICoreGlobalSearchDialog, ICoreGlobalSearchSection, ICoreGlobalSearchResultRow22public ICoreWidget; public ICoreWidget; public ICoreWidget
ICorePanelSearchBar.hICorePanelSearchBar4public ICoreWidget
ICoreSearchBar.hICoreSearchBar, ICoreSearchTextBox23public ICoreWidget; public ICoreLineEdit

ICoreGlobalSearchDialog.h#

src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/SearchBar/ICoreGlobalSearchDialog.h

ICoreGlobalSearchDialog#

ICoreGlobalSearchDialog.h:41 · class · final · bases public ICoreWidget · pImpl · 8 declaration(s)

Search Everywhere.

class ICoreGlobalSearchDialog final : public ICoreWidget {
public:
    explicit ICoreGlobalSearchDialog(ICoreStudioSurface* editorWindow, ICoreWidget* parent = nullptr);

    // Binds the panel to the bar that drives it (its field is watched for the
    // arrow keys / Enter / Esc) and shows the results for the given query.
    // An empty query keeps the panel closed.
    // A1.3: the anchor arrives as ICoreWidget*, not ICoreNativeWidget*. The
    // sole caller (ICoreTopFixedPanel) passes an ICoreSearchBar, which IS an
    // ICoreWidget -- and the dialog needs mapToScreen() and height() off it,
    // neither of which exists on the one-member handle interface. Widening it
    // back would put the second anchor handle straight back (see the Impl).
    void showBelowAnchor(ICoreWidget* anchorWidget, ICoreLineEdit* field, const ICoreString& query);

    // Live retype from the anchor's field. An empty query closes the panel.
    void updateQuery(const ICoreString& query);

    void closePanel();

    ~ICoreGlobalSearchDialog() override;

protected:
    void paintContent(ICorePainter& painter) override;
    void pointerPressedOutside() override;

    // ⚠⚠ THE PANEL IS THE END OF THE LINE FOR A WHEEL, WHICHEVER WAY IT IS
    // TURNING. An overlay sits on top of the canvas rather than beside it, and
    // the toolkit underneath chains a notch the results list cannot use on to
    // the next responder -- which is the canvas. So scrolling the results to
    // either end and carrying on zoomed the diagram behind the panel, and the
    // user's next look at the editor found it at a scale they never asked for.
    //
    // Answering true here is what stops the chain: the seat only walks the
    // notch onwards for a hook that DECLINED it.
    //
    // ⚠ IT BELONGS HERE AND NOT IN THE SCROLL PANE. Chaining is correct for an
    // ordinary pane -- a list inside a scrolling page should hand the page the
    // rest of the gesture -- so the rule being asked for is "an OVERLAY does not
    // chain", and only the overlay knows it is one.
    bool wheelScrolled(const ICoreWheelEvent& event) override;

private:
    class Impl;                    // the two-line residue; state lives here
    std::unique_ptr<Impl> impl;
};

ICoreGlobalSearchSection#

ICoreGlobalSearchDialog.h:96 · class · final · bases public ICoreWidget · pImpl · 6 declaration(s)

One module's results: a clickable header (arrow, name, count) over a plain column of rows.

class ICoreGlobalSearchSection final : public ICoreWidget {
public:
    explicit ICoreGlobalSearchSection(ICoreWidget* parent, const ICoreString& title, const ICoreString& countText,
                                      std::function<void()> onToggled);

    void addRow(ICoreGlobalSearchResultRow* row) const;

    void setCollapsed(bool collapsed);
    bool isCollapsed() const;

    ICoreWidget* getContentWidget() const;

    ~ICoreGlobalSearchSection() override;

private:
    class Impl;                    // the two-line residue; state lives here
    std::unique_ptr<Impl> impl;
};

ICoreGlobalSearchResultRow#

ICoreGlobalSearchDialog.h:122 · class · final · bases public ICoreWidget · pImpl · 8 declaration(s)

A single result line: title on the left, path / value hint on the right.

class ICoreGlobalSearchResultRow final : public ICoreWidget {
public:
    explicit ICoreGlobalSearchResultRow(ICoreWidget* parent, ICoreString title, ICoreString subtitle,
                                        std::function<void()> onActivated);

    void setSelected(bool selected);
    void activate() const;

    ~ICoreGlobalSearchResultRow() override;

protected:
    void paintContent(ICorePainter& painter) override;
    void pointerEntered() override;
    void pointerLeft() override;
    bool mousePressed(const ICoreMouseEvent& event) override;

private:
    class Impl;                    // the two-line residue; state lives here
    std::unique_ptr<Impl> impl;
};

ICorePanelSearchBar.h#

src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/SearchBar/ICorePanelSearchBar.h

ICorePanelSearchBar#

ICorePanelSearchBar.h:19 · class · final · bases public ICoreWidget · pImpl · 4 declaration(s)

A small filter field for the top of a panel (library, variables, objects tracker, deploy targets, subsystem navigator).

class ICorePanelSearchBar final : public ICoreWidget {
public:
    // Mirror of the queryChanged signal, for clients outside the wrapper zone.
    ICoreSignal<ICoreString> onQueryChanged;

    // ICoreAnyWidget pending the ICoreEssentials reparenting: the caller
    // parents this to an ICoreDialog, which derives from the toolkit's
    // QDialog rather than from ICoreWidget. Narrow this to ICoreWidget*
    // once that base moves.
    explicit ICorePanelSearchBar(ICoreNativeWidget* parent = nullptr, const ICoreString& placeholder = "Search...");

    ICoreString query() const;
    void clearQuery() const;

    ~ICorePanelSearchBar() override;
private:
    class Impl;                    // the two-line residue; state lives here
    std::unique_ptr<Impl> impl;
};

ICoreSearchBar.h#

src/ICoreBlocks/ICoreStudio/StudioObjects/Panels/SearchBar/ICoreSearchBar.h

The field says "Search Everywhere" because that is what the top bar does with it; a host that searches one thing (the block library, say) renames it.

ICoreSearchBar#

ICoreSearchBar.h:17 · class · bases public ICoreWidget · pImpl · 19 declaration(s)

class ICoreSearchBar : public ICoreWidget {
public:
    explicit ICoreSearchBar(ICoreWidget* parent = nullptr);

    double bgOpacity() const;
    void setBgOpacity(double opacity);
    void animateBackgroundOpacity(double targetOpacity);

    void cancelSearch();
    void showClearButton();

    // The field says "Search Everywhere" because that is what the top bar does with
    // it; a host that searches one thing (the block library, say) renames it.
    void setPlaceholderText(const ICoreString& placeholder) const;

    // The bar AND the two icon buttons inside it. The buttons pin their own
    // sizes (24 and 25) and the bar keeps a 3-pixel inset, so setFixedHeight()
    // alone below 30 would crowd them past the field's rim; this shrinks both
    // to the height the inset leaves. The title bar uses it (28 there).
    void setBarHeight(int height);

    // The field itself, for a host that must hand it onward (the global search
    // dialog follows it with a key interceptor). Post-P5.11 the dialog cannot
    // findChild<ICoreLineEdit*>() its way back to it -- wrappers are not in the
    // QObject tree -- so the bar hands the wrapper over, per the doctrine in
    // ICoreNativeHandleAccess.h.
    ICoreLineEdit* searchField() const;

    // ⚠ THE BAR DRAWS THE FIELD'S CHROME, SO THE BAR HAS TO BE TOLD ABOUT THE
    // FIELD'S FOCUS. `Chrome::None` means the ICoreSearchTextBox inside paints
    // neither border nor ground -- which is what makes the bar and its field
    // read as one control -- and the price is that the one thing that knows
    // where the caret is cannot draw it. The field calls this from its own
    // focusGained/focusLost (A10.15 follow-up).
    void setFieldFocused(bool focused);

    // Puts the caret in the field, for a host that opens with the bar already live.
    void focusField() const;

    // Asks the host to open the global search panel (click on the bar).
    void requestSearch(const ICoreString& text);

    // Streams every edit of the field to the host, which keeps the already open
    // panel in sync. The text stays in the bar: it is the panel's only query field.
    void reportTextChanged(const ICoreString& text);

    ICoreString currentText() const;

    ~ICoreSearchBar() override;

    // Raised when the user asks for a search by clicking the bar. The host
    // decides what to open.
    ICoreSignal<ICoreString> onSearchInvoked;

    // Raised on every edit of the field, so the host can refilter a panel that
    // is already open (or open it on the first character).
    ICoreSignal<ICoreString> onSearchTextChanged;

protected:
    void paintContent(ICorePainter& painter) override;
    void pointerEntered() override;
    void pointerLeft() override;
    bool mousePressed(const ICoreMouseEvent& event) override;

private:
    class Impl;                    // the two-line residue; state lives here
    std::unique_ptr<Impl> impl;
};

ICoreSearchTextBox#

ICoreSearchBar.h:92 · class · bases public ICoreLineEdit · pImpl · 4 declaration(s)

Chrome::None: the ICoreSearchBar around it draws the border and the ground, so the field itself must paint neither.

class ICoreSearchTextBox : public ICoreLineEdit {
public:
    // The body moved to the .cpp with the state it sets up (the header surface
    // rule).
    explicit ICoreSearchTextBox(ICoreSearchBar* parent);

    // Declared, defined in the .cpp: the residue below is a unique_ptr to an
    // Impl this header cannot see.
    ~ICoreSearchTextBox() override;

protected:
    // Both forward to ICoreSearchBar::setFieldFocused -- see it for why the
    // bar and not the field is the one that draws the focus.
    void focusGained(const ICoreFocusEvent& event) override;
    void focusLost(const ICoreFocusEvent& event) override;

private:
    class Impl;                    // the two-line residue; state lives here
    std::unique_ptr<Impl> impl;
};