sublime
Sublime::Area Class Reference
#include <area.h>

Detailed Description
Area - the universal view container.Area contains views and toolviews, knows about their positions and provides functionality to add new (tool)views and remove existing.
Area takes care of all placement/configuration details so that in order for MainWindow to show the area it just needs to reconstruct itself according to the area's rules.
Usual way of creating an area is:
Controller *controller = new Controller(); ... //document creation code here Area *area = new Area(controller, "My Area"); area->addView(document->createView()); MainWindow *mw = new MainWindow(controller); controller->show(area, mw);
Definition at line 58 of file area.h.
Public Types | |
| enum | WalkerMode { StopWalker, ContinueWalker } |
Signals | |
| void | aboutToRemoveToolView (Sublime::View *, Sublime::Position) |
| void | aboutToRemoveView (Sublime::AreaIndex *, Sublime::View *) |
| void | requestToolViewRaise (Sublime::View *) |
| void | toolViewAdded (Sublime::View *, Sublime::Position) |
| void | toolViewMoved (Sublime::View *, Sublime::Position) |
| void | viewAdded (Sublime::AreaIndex *, Sublime::View *) |
Public Member Functions | |
| void | addToolView (View *toolView, Position defaultPosition) |
| void | addView (View *view, View *viewToSplit, Qt::Orientation orientation) |
| void | addView (View *view, View *after=0) |
| void | addView (View *view, AreaIndex *index) |
| Area (const Area &area) | |
| Area (Controller *controller, const QString &name, const QString &title="") | |
| Controller * | controller () const |
| AreaIndex * | indexOf (View *view) |
| void | load (const KConfigGroup &group) |
| void | moveToolView (View *toolView, Position newPosition) |
| void | raiseToolView (View *toolView) |
| View * | removeToolView (View *toolView) |
| View * | removeView (View *view) |
| RootAreaIndex * | rootIndex () const |
| void | save (KConfigGroup &group) const |
| void | setDesiredToolViews (const QMap< QString, Sublime::Position > &desiredToolViews) |
| void | setShownToolView (Sublime::Position pos, const QString &id) |
| void | setThickness (Sublime::Position pos, int thickness) |
| void | setTitle (const QString &title) |
| QString | shownToolView (Sublime::Position pos) const |
| int | thickness (Sublime::Position pos) const |
| QString | title () const |
| Position | toolViewPosition (View *toolView) const |
| QList< View * > & | toolViews () const |
| QList< View * > | views () |
| template<typename Operator> | |
| void | walkToolViews (Operator &op, Positions positions) |
| template<typename Operator> | |
| void | walkViews (Operator &op, AreaIndex *index) |
| bool | wantToolView (const QString &id) |
Member Enumeration Documentation
Constructor & Destructor Documentation
| Sublime::Area::Area | ( | Controller * | controller, | |
| const QString & | name, | |||
| const QString & | title = "" | |||
| ) |
Creates and area with given name and adds it to the controller.
- Parameters:
-
controller is the controller in which this area will be available. name should identify this area and be unique for all areas in the controller. QObject::objectName shall be used to get this name after area creation. title is the user-visible (translatable) title for the area. Use title and setTitle to operate on the title. This parameter can be omitted and then name will be used as title.
Member Function Documentation
| void Sublime::Area::aboutToRemoveToolView | ( | Sublime::View * | , | |
| Sublime::Position | ||||
| ) | [signal] |
Emitted when a toolview is going to be removed from the area.
| void Sublime::Area::aboutToRemoveView | ( | Sublime::AreaIndex * | , | |
| Sublime::View * | ||||
| ) | [signal] |
Emitted when a view is going to be removed from the area.
| void Sublime::Area::addToolView | ( | View * | toolView, | |
| Position | defaultPosition | |||
| ) |
| Controller * Sublime::Area::controller | ( | ) | const |
| void Sublime::Area::moveToolView | ( | View * | toolView, | |
| Position | newPosition | |||
| ) |
| void Sublime::Area::raiseToolView | ( | View * | toolView | ) |
| void Sublime::Area::requestToolViewRaise | ( | Sublime::View * | ) | [signal] |
Emitted when a toolview is requesting to be raised.
| RootAreaIndex * Sublime::Area::rootIndex | ( | ) | const |
| void Sublime::Area::toolViewAdded | ( | Sublime::View * | , | |
| Sublime::Position | ||||
| ) | [signal] |
Emitted when a new toolview is added to the area.
| void Sublime::Area::toolViewMoved | ( | Sublime::View * | , | |
| Sublime::Position | ||||
| ) | [signal] |
Emitted when a toolview is moved to a different position.
| Position Sublime::Area::toolViewPosition | ( | View * | toolView | ) | const |
| void Sublime::Area::viewAdded | ( | Sublime::AreaIndex * | , | |
| Sublime::View * | ||||
| ) | [signal] |
Emitted when a new view is added to the area.
| void Sublime::Area::walkToolViews | ( | Operator & | op, | |
| Positions | positions | |||
| ) | [inline] |
Walks the list of toolviews.
The order in which toolviews are walked is not specified.
Operator should be the class with bool operator()(View *view, Sublime::Position position) method. That method should return Area::StopWalker if the walker has to stop at current index or Area::ContinueWalker to continue.
Example (operator to print the list of views):
struct MyOperator { WalkerMode operator()(View *view, Sublime::Position position) { std::cerr << view << " at position " << position << std::endl; return Area::ContinueWalker; } }; ... MyOperator op; walkToolViews(op, Sublime::AllPositions)
Definition at line 52 of file areawalkers.h.
| void Sublime::Area::walkViews | ( | Operator & | op, | |
| AreaIndex * | index | |||
| ) | [inline] |
Walks the tree of area indices and executes the operator.
It will always walk the tree of views from top to bottom from left to right.
Operator should be the class with WalkerResult operator()(AreaIndex *index) method. That method should return Area::StopWalker if the walker has to stop at current index or Area::ContinueWalker to continue.
Example (operator to print the indices, assumes hypothetical operator <<()):
struct MyOperator { WalkerMode operator()(AreaIndex *index) { std::cerr << index << std::endl; return Area::ContinueWalker; } }; ... MyOperator op; walkViews(op, rootIndex())
Definition at line 46 of file areawalkers.h.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference