summaryrefslogtreecommitdiff
path: root/ui/typeview.h
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2022-10-21 22:58:46 +0200
committerPeter LaFosse <peter@vector35.com>2022-11-10 16:19:13 -0500
commit78a4c923fe3fd5790e03e2c963e0a519d8c2b93b (patch)
tree3641ec3679eeb65b9ea171b1b1479b67fb3040c3 /ui/typeview.h
parent4fd944de0e28e2d66cb5792c4f7a80cfad387b56 (diff)
Show filtered/total count in search
Diffstat (limited to 'ui/typeview.h')
-rw-r--r--ui/typeview.h38
1 files changed, 18 insertions, 20 deletions
diff --git a/ui/typeview.h b/ui/typeview.h
index 1aa89cc8..8744ffa7 100644
--- a/ui/typeview.h
+++ b/ui/typeview.h
@@ -18,6 +18,7 @@
#include "menus.h"
#include "xreflist.h"
#include "clickablelabel.h"
+#include "filter.h"
#define TYPE_VIEW_UPDATE_CHECK_INTERVAL 200
@@ -221,6 +222,9 @@ class BINARYNINJAUIAPI TypeView : public QAbstractScrollArea, public View, publi
virtual void setNavigationMode(std::string mode) override;
virtual std::vector<std::string> getNavigationModes() override;
+ size_t getUnfilteredTypeCount() const { return m_allTypeLines.size(); }
+ size_t getFilteredTypeCount() const { return m_typeLines.size(); }
+
uint64_t findMatchingLine(const BinaryNinja::QualifiedName& name, uint64_t offset, size_t& cursorOffset);
bool navigateToType(const std::string& name, uint64_t offset = 0);
@@ -287,6 +291,9 @@ class BINARYNINJAUIAPI TypeView : public QAbstractScrollArea, public View, publi
virtual void mouseDoubleClickEvent(QMouseEvent* event) override;
virtual void scrollContentsBy(int dx, int dy) override;
+ Q_SIGNALS:
+ void updateCount();
+
private Q_SLOTS:
void copySelection();
void selectAll();
@@ -355,31 +362,13 @@ class TypeViewType : public ViewType
\ingroup typeview
*/
-class BINARYNINJAUIAPI TypeFilterEdit : public QLineEdit
-{
- Q_OBJECT
-
- public:
- TypeFilterEdit(QWidget* parent);
-
- protected:
- virtual void keyPressEvent(QKeyEvent* event) override;
-
- Q_SIGNALS:
- void focusView();
-};
-
-/*!
-
- \ingroup typeview
-*/
-class BINARYNINJAUIAPI TypeFilter : public QWidget
+class BINARYNINJAUIAPI TypeFilter : public QWidget, public FilterTarget
{
Q_OBJECT
TypesContainer* m_container;
ClickableIcon* m_showSystemTypes;
- TypeFilterEdit* m_textFilter;
+ FilterEdit* m_textFilter;
bool MatchesAutoFilter(BinaryViewRef data, const BinaryNinja::QualifiedName& name);
bool MatchesTextFilter(const std::vector<BinaryNinja::TypeDefinitionLine>& lines);
@@ -400,6 +389,15 @@ class BINARYNINJAUIAPI TypeFilter : public QWidget
bool areAutoTypesVisible();
void setShowAutoTypes(bool showAutoTypes);
void clearTextFilter();
+ void setRightText(const QString& text);
+
+ protected:
+ void setFilter(const std::string& filter) override;
+ void scrollToFirstItem() override;
+ void scrollToCurrentItem() override;
+ void selectFirstItem() override;
+ void activateFirstItem() override;
+ void closeFilter() override;
};
/*!