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