• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • KDevelop Platform Libraries
  • Sitemap
  • Contact Us
 

sublime

Sublime::Area

Sublime::Area Class Reference

#include <area.h>

Inheritance diagram for Sublime::Area:

Inheritance graph
[legend]

List of all members.


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

enum Sublime::Area::WalkerMode

Walker mode to determine the behavior of area walkers.

Enumerator:
StopWalker  Stop after processing this area index or toolview.
ContinueWalker  Continue walking.

Definition at line 134 of file area.h.


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.

Definition at line 98 of file area.cpp.


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 
)

Adds the toolview to the area.

Area will use its configuration and restore the proper position for the toolview when necessary. If it has no configuration for this view, it will use defaultPosition.

Definition at line 194 of file area.cpp.

void Sublime::Area::addView ( View *  view,
View *  viewToSplit,
Qt::Orientation  orientation 
)

Adds the view to the area splitting the viewToSplit using given orientation.

Definition at line 164 of file area.cpp.

void Sublime::Area::addView ( View *  view,
View *  after = 0 
)

Adds the view to the list of views at the current area index.

Definition at line 152 of file area.cpp.

void Sublime::Area::addView ( View *  view,
AreaIndex *  index 
)

Adds the view to the list of views at the given area index.

Definition at line 145 of file area.cpp.

Controller * Sublime::Area::controller (  )  const

Returns:
the controller for this area.

Definition at line 246 of file area.cpp.

AreaIndex * Sublime::Area::indexOf ( View *  view  ) 

Returns:
the index of view or 0 if it can not be found.

Definition at line 182 of file area.cpp.

void Sublime::Area::moveToolView ( View *  toolView,
Position  newPosition 
)

Moves the toolview to a different position.

Definition at line 225 of file area.cpp.

void Sublime::Area::raiseToolView ( View *  toolView  ) 

Raise tool view.

Definition at line 206 of file area.cpp.

View * Sublime::Area::removeToolView ( View *  toolView  ) 

Removes the toolview from the area.

Definition at line 211 of file area.cpp.

View * Sublime::Area::removeView ( View *  view  ) 

Removes the view from the area.

Definition at line 172 of file area.cpp.

void Sublime::Area::requestToolViewRaise ( Sublime::View *   )  [signal]

Emitted when a toolview is requesting to be raised.

RootAreaIndex * Sublime::Area::rootIndex (  )  const

Returns:
the root index of the area.

Root index always exists so this method will never return 0.

Definition at line 189 of file area.cpp.

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

Returns:
the current position of toolView in the area.

Definition at line 241 of file area.cpp.

QList< View * > & Sublime::Area::toolViews (  )  const

Returns:
the list of toolviews in the area.

No particular sort order is guaranteed.

Definition at line 236 of file area.cpp.

void Sublime::Area::viewAdded ( Sublime::AreaIndex *  ,
Sublime::View *   
) [signal]

Emitted when a new view is added to the area.

QList< View * > Sublime::Area::views (  ) 

Returns:
the list of all views in this area in no particular order.

To process the views in ordered manner (tree walk) use walkViews method. This method is added only for convenience.

Definition at line 251 of file area.cpp.

template<typename Operator>
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.

template<typename Operator>
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:
  • area.h
  • area.cpp
  • areawalkers.h

sublime

Skip menu "sublime"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

KDevelop Platform Libraries

Skip menu "KDevelop Platform Libraries"
  • interfaces
  • language
  •   duchain
  •   editor
  • outputview
  • project
  • shell
  • sublime
  • util
  • vcs
Generated for KDevelop Platform Libraries by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal