Update tocmodel to support read/write to buffer
Development Goal: Update the existing LyX toc-model so that it can both read and write to the document buffer.
(For more information about the larger LyX-Outline project, see http://
Background: At the present time, the model that LyX uses to display it's table of contents, figures, tables, etc. in the "Outline View" only supports the reading of information. This is because it only partially implements the methods of QStandardItemView. The Qt Model/View architecture, however, allows for custom views to be created that can both read and write information, if all of the necessary methods are supported.
(See http://
Constraints: Due to the need to support older versions of Qt, methods or classes that are not supported in Qt 4.3 should not be used. If no workaround can be found, they should be presented to the LyX developer list prior to implementation.
Tasks:
1.) Determine which methods need to be added in order to support read/write in TocModel
2.) Extend the TocBackend, TocModel and dispatch classes so that they are able to make changes to the underlying buffer and update the view that the changes have been made
3.) Add new LyX functions as necessary to support the expanded classes in Item 2
4.) Test functionality with Corkboard view that has been added to LyX
5.) Create new LyX inset called synopsis that will be added to a second column in the LyX model. Create custom functions that allow for it to be updated and manipulated
Major Classes:
./src/
LyXAction.cpp: LyX makes use of a dispatch mechanism for modifying the current buffer. This class holds a list of all of the different LyX functions that are used to manipulate the buffer. For an example of a LyX function that I created, see LFUN_OUTLINE_
Text3.cpp: Class which contains a number of LFUN implementations. They show examples of how to manipulate the LyX buffer. Includes the implementation of LFUN_OUTLINE_
TocBackend.cpp, TocBackend.h: Contains the implementation of Toc::item, which translates buffer information into a format that can be used by QStandardItemView. Using this class to support writing to the buffer may be a good option. It would need to be updated to the setData() function and proper signal/slot mechanisms.
(See http://
./src/frontends
TocModel.cpp, TocModel.h: These are the major classes associated with LyX's model/view. They hold many of the methods involved for translating the underlying document buffer into a hierarchical data structure that can be displayed in the Outliner pane. Some of the code here may need to be refactored into the background classes so that it can be used by custom models (such as the Corkboard).
Corkboard Classes
./src/frontends
Corkboard.cpp, Corkboard.h, CorkboardDelega
These classes represent a custom corkboard view that I ported from the prototype. I have implemented one custom LFUN, which allows for document sections to be moved via drag/drop.
Source Code:
Because the LyX team is currently trying to release version 2.0 and the development emphasis has shifted to finding bugs, I have created a separate launchpad branch for development (https:/
A copy of the source code can be checked out by using:
bzr branch lp:lyx-outline