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_updateTB_clicked();
73 void on_sortCB_stateChanged(int state);
74 void on_persistentCB_stateChanged(int state);
75 void on_depthSL_valueChanged(int depth);
76 void on_typeCO_activated(int value);
77 void on_moveUpTB_clicked();
78 void on_moveDownTB_clicked();
79 void on_moveInTB_clicked();
80 void on_moveOutTB_clicked();
81 void filterContents();
83 void showContextMenu(const QPoint & pos);
86 /// Perform the expensive update operations
87 void finishUpdateView();
91 void enableControls(bool enable = true);
94 { return current_type_ == "tableofcontents"; }
95 /// It is not possible to have synchronous navigation in a correct
96 /// and efficient way with the label and change type because Toc::item()
97 /// does a linear search. Even when fixed, it might even not be desirable
98 /// to do so if we want to support drag&drop of labels and references.
100 { return current_type_ != "label" && current_type_ != "change"; }
103 { return current_type_ != "tableofcontents"; }
105 void setTreeDepth(int depth);
107 void outline(FuncCode func_code);
108 /// finds the inset that is connected to the current item,
109 /// if any, otherwise return null
110 Inset * itemInset() const;
112 QString current_type_;
114 /// depth of list shown
116 /// persistence of uncollapsed nodes in toc view
120 // Timer for scheduling expensive update operations
123 FancyLineEdit * filter_ = nullptr;
126 } // namespace frontend
129 #endif // TOC_WIDGET_H