4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Abdelrazak Younes
10 * Full author contact details are available in file CREDITS.
40 class TocWidget : public QWidget, public Ui::TocUi
45 TocWidget(GuiView & gui_view, QWidget * parent = 0);
48 void init(QString const & str);
50 void doDispatch(Cursor & cur, FuncRequest const & fr, DispatchResult & dr);
51 ///send request to lyx::dispatch with proper guiview handle
52 ///(if ToC is detached current_view can be different window)
53 void sendDispatch(FuncRequest fr);
55 bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & status)
59 /// Schedule an update of the dialog, delaying expensive operations
61 /// Update completely without delay
66 void select(QModelIndex const & index);
68 void goTo(QModelIndex const &);
70 void on_tocTV_activated(QModelIndex const &);
71 void on_tocTV_pressed(QModelIndex const &);
72 void on_tocTV_doubleClicked(QModelIndex const &);
73 void on_updateTB_clicked();
74 void on_sortCB_stateChanged(int state);
75 void on_persistentCB_stateChanged(int state);
76 void on_depthSL_valueChanged(int depth);
77 void on_typeCO_activated(int value);
78 void on_moveUpTB_clicked();
79 void on_moveDownTB_clicked();
80 void on_moveInTB_clicked();
81 void on_moveOutTB_clicked();
82 void filterContents();
84 void showContextMenu(const QPoint & pos);
87 /// Perform the expensive update operations
88 void finishUpdateView();
92 void enableControls(bool enable = true);
95 { return current_type_ == "tableofcontents"; }
96 /// It is not possible to have synchronous navigation in a correct
97 /// and efficient way with the label and change type because Toc::item()
98 /// does a linear search. Even when fixed, it might even not be desirable
99 /// to do so if we want to support drag&drop of labels and references.
101 { return current_type_ != "label" && current_type_ != "change"; }
104 { return current_type_ != "tableofcontents"; }
106 void setTreeDepth(int depth);
108 void outline(FuncCode func_code);
109 /// finds the inset that is connected to the current item,
110 /// if any, otherwise return null
111 Inset * itemInset() const;
113 QString current_type_;
115 /// depth of list shown
117 /// persistence of uncollapsed nodes in toc view
119 /// keep uncollapsed nodes in this event
123 // Timer for scheduling expensive update operations
126 FancyLineEdit * filter_ = nullptr;
129 } // namespace frontend
132 #endif // TOC_WIDGET_H