Changeset View
Changeset View
Standalone View
Standalone View
documentation/documentationfindwidget.h
Show All 36 Lines | 35 | enum FindOption { | |||
---|---|---|---|---|---|
37 | Previous = 2, | 37 | Previous = 2, | ||
38 | MatchCase = 4 | 38 | MatchCase = 4 | ||
39 | }; | 39 | }; | ||
40 | Q_DECLARE_FLAGS(FindOptions, FindOption) | 40 | Q_DECLARE_FLAGS(FindOptions, FindOption) | ||
41 | 41 | | |||
42 | explicit DocumentationFindWidget(QWidget* parent = nullptr); | 42 | explicit DocumentationFindWidget(QWidget* parent = nullptr); | ||
43 | virtual ~DocumentationFindWidget(); | 43 | virtual ~DocumentationFindWidget(); | ||
44 | 44 | | |||
45 | void showEvent ( QShowEvent* ) override; | 45 | void hideEvent(QHideEvent* event) override; | ||
46 | 46 | | |||
47 | private Q_SLOTS: | 47 | public Q_SLOTS: | ||
48 | void startSearch(); | 48 | void startSearch(); | ||
49 | | ||||
50 | private Q_SLOTS: | ||||
49 | void searchNext(); | 51 | void searchNext(); | ||
50 | void searchPrevious(); | 52 | void searchPrevious(); | ||
53 | void emitDataChanged(); | ||||
51 | 54 | | |||
52 | Q_SIGNALS: | 55 | Q_SIGNALS: | ||
53 | void newSearch(const QString& text, KDevelop::DocumentationFindWidget::FindOptions); | 56 | /** | ||
57 | * Emitted when the user requests a search | ||||
58 | * @param text text to search in documentation | ||||
59 | * @param options MatchCase being set or empty flags (Next/Previous unused here) | ||||
60 | */ | ||||
61 | void searchRequested(const QString& text, KDevelop::DocumentationFindWidget::FindOptions options); | ||||
62 | /** | ||||
63 | * Emitted when the user edits the search field or changes the case-sensitivity checkbox. | ||||
64 | * Allows documentation views capable of live searches to show live results while the user types. | ||||
65 | * @param text current text in search text field | ||||
66 | * @param options MatchCase being set or empty flags (Next/Previous unused here) | ||||
67 | */ | ||||
68 | void searchDataChanged(const QString& text, KDevelop::DocumentationFindWidget::FindOptions options); | ||||
69 | /** | ||||
70 | * Emitted when the search tool view is closed, so no more search hits should be displayed. | ||||
71 | */ | ||||
72 | void searchFinished(); | ||||
54 | 73 | | |||
55 | private: | 74 | private: | ||
56 | Ui::FindWidget* m_ui; | 75 | Ui::FindWidget* m_ui; | ||
57 | }; | 76 | }; | ||
58 | 77 | | |||
59 | } | 78 | } | ||
60 | 79 | | |||
61 | #endif // KDEVPLATFORM_DOCUMENTATIONFINDWIDGET_H | 80 | #endif // KDEVPLATFORM_DOCUMENTATIONFINDWIDGET_H |