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.
32 class TocWidget : public QWidget, public Ui::TocUi
37 TocWidget(GuiView & gui_view, QWidget * parent = 0);
40 void init(QString const & str);
42 void doDispatch(Cursor & cur, FuncRequest const & fr, DispatchResult & dr);
43 ///send request to lyx::dispatch with proper guiview handle
44 ///(if ToC is detached current_view can be different window)
45 void sendDispatch(FuncRequest fr);
47 bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & status)
51 /// Schedule an update of the dialog, delaying expensive operations
53 /// Update completely without delay
58 void select(QModelIndex const & index);
60 void goTo(QModelIndex const &);
62 void on_tocTV_activated(QModelIndex const &);
63 void on_tocTV_pressed(QModelIndex const &);
64 void on_updateTB_clicked();
65 void on_sortCB_stateChanged(int state);
66 void on_persistentCB_stateChanged(int state);
67 void on_depthSL_valueChanged(int depth);
68 void on_typeCO_currentIndexChanged(int value);
69 void on_moveUpTB_clicked();
70 void on_moveDownTB_clicked();
71 void on_moveInTB_clicked();
72 void on_moveOutTB_clicked();
73 void filterContents();
75 void showContextMenu(const QPoint & pos);
78 /// Perform the expensive update operations
79 void finishUpdateView();
83 void enableControls(bool enable = true);
86 { return current_type_ == "tableofcontents"; }
87 /// It is not possible to have synchronous navigation in a correct
88 /// and efficient way with the label and change type because Toc::item()
89 /// does a linear search. Even when fixed, it might even not be desirable
90 /// to do so if we want to support drag&drop of labels and references.
92 { return current_type_ != "label" && current_type_ != "change"; }
95 { return current_type_ != "tableofcontents"; }
97 void setTreeDepth(int depth);
99 void outline(FuncCode func_code);
100 /// finds the inset that is connected to the current item,
101 /// if any, otherwise return null
102 Inset * itemInset() const;
104 QString current_type_;
106 /// depth of list shown
108 /// persistence of uncollapsed nodes in toc view
112 // Timer for scheduling expensive update operations
116 } // namespace frontend
119 #endif // TOC_WIDGET_H