ACAV f0ba4b7c9529
Abstract Syntax Tree (AST) visualization tool for C, C++, and Objective-C
Loading...
Searching...
No Matches
NodeCycleWidget.h
Go to the documentation of this file.
1/*$!{
2* Aurora Clang AST Viewer (ACAV)
3*
4* Copyright (c) 2026 Min Liu
5* Copyright (c) 2026 Michael David Adams
6*
7* SPDX-License-Identifier: GPL-2.0-or-later
8*
9* This program is free software; you can redistribute it and/or modify
10* it under the terms of the GNU General Public License as published by
11* the Free Software Foundation; either version 2 of the License, or
12* (at your option) any later version.
13*
14* This program is distributed in the hope that it will be useful,
15* but WITHOUT ANY WARRANTY; without even the implied warranty of
16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17* GNU General Public License for more details.
18*
19* You should have received a copy of the GNU General Public License along
20* with this program; if not, see <https://www.gnu.org/licenses/>.
21}$!*/
22
25#pragma once
26
27#include <QLabel>
28#include <QPushButton>
29#include <QWidget>
30#include <vector>
31
32namespace acav {
33
34class AstViewNode; // Forward declaration
35
40class NodeCycleWidget : public QWidget {
41 Q_OBJECT
42
43public:
44 explicit NodeCycleWidget(QWidget *parent = nullptr);
45
49 void showMatches(const std::vector<AstViewNode *> &matches,
50 const QPoint &clickPos);
51
52signals:
55
57 void closed();
58
59private slots:
60 void onNext();
61 void onPrevious();
62 void onClose();
63
64private:
65 void updateDisplay();
66
67 std::vector<AstViewNode *> matches_;
68 std::size_t currentIndex_ = 0;
69
70 QLabel *infoLabel_;
71 QPushButton *prevButton_;
72 QPushButton *nextButton_;
73 QPushButton *closeButton_;
74};
75
76} // namespace acav
Represents node in AST tree hierarchy.
Definition AstNode.h:195
void nodeSelected(AstViewNode *node)
Emitted when user navigates to a node.
void closed()
Emitted when widget is closed.
void showMatches(const std::vector< AstViewNode * > &matches, const QPoint &clickPos)
Show widget with list of matches.