• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/sublime

  • Sublime
  • Area
Public Types | Signals | Public Member Functions | List of all members
Sublime::Area Class Reference

#include <area.h>

Inheritance diagram for Sublime::Area:
Inheritance graph
[legend]

Public Types

enum  WalkerMode { StopWalker, ContinueWalker }
 

Signals

void aboutToRemoveToolView (Sublime::View *, Sublime::Position)
 
void aboutToRemoveView (Sublime::AreaIndex *, Sublime::View *)
 
void changedWorkingSet (Sublime::Area *area, const QString &from, const QString &to)
 
void changingWorkingSet (Sublime::Area *area, const QString &from, const QString &to)
 
void clearWorkingSet (Sublime::Area *area)
 
void requestToolViewRaise (Sublime::View *)
 
void toolViewAdded (Sublime::View *, Sublime::Position)
 
void toolViewMoved (Sublime::View *, Sublime::Position)
 
void viewAdded (Sublime::AreaIndex *, Sublime::View *)
 
void viewRemoved (Sublime::AreaIndex *, Sublime::View *)
 

Public Member Functions

 Area (const Area &area)
 
 Area (Controller *controller, const QString &name, const QString &title={})
 
 ~Area () override
 
QList< QAction * > actions () const
 
View * activeView () const
 
void addAction (QAction *action)
 
void addToolView (View *toolView, Position defaultPosition)
 
void addView (View *view, AreaIndex *index, View *after=nullptr)
 
void addView (View *view, AreaIndex *indexToSplit, Qt::Orientation orientation)
 
void addView (View *view, View *after=nullptr)
 
void addView (View *view, View *viewToSplit, Qt::Orientation orientation)
 
void clearDocuments ()
 
void clearViews (bool silent=false)
 
bool closeView (View *view, bool silent=false)
 
Controller * controller () const
 
QString iconName () 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 setActiveView (View *view)
 
void setDesiredToolViews (const QMap< QString, Sublime::Position > &desiredToolViews)
 
void setIconName (const QString &iconName)
 
void setShownToolViews (Sublime::Position pos, const QStringList &ids)
 
void setTitle (const QString &title)
 
void setWorkingSet (const QString &name)
 
QStringList shownToolViews (Sublime::Position pos) const
 
QString title () const
 
Position toolViewPosition (View *toolView) const
 
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)
 
QString workingSet () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Area - the universal view container.

Area contains views and tool views, 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 59 of file area.h.

Member Enumeration Documentation

◆ WalkerMode

enum Sublime::Area::WalkerMode

Walker mode to determine the behavior of area walkers.

Enumerator
StopWalker 

Stop after processing this area index or tool view.

ContinueWalker 

Continue walking.

Definition at line 185 of file area.h.

Constructor & Destructor Documentation

◆ Area() [1/2]

Sublime::Area::Area ( Controller *  controller,
const QString &  name,
const QString &  title = {} 
)

Creates and area with given name and adds it to the controller.

Parameters
controlleris the controller in which this area will be available.
nameshould identify this area and be unique for all areas in the controller. QObject::objectName shall be used to get this name after area creation.
titleis 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 120 of file area.cpp.

◆ Area() [2/2]

Sublime::Area::Area ( const Area &  area)

Definition at line 137 of file area.cpp.

◆ ~Area()

Sublime::Area::~Area ( )
overridedefault

Member Function Documentation

◆ aboutToRemoveToolView

void Sublime::Area::aboutToRemoveToolView ( Sublime::View *  ,
Sublime::Position   
)
signal

Emitted when a tool view is going to be removed from the area.

◆ aboutToRemoveView

void Sublime::Area::aboutToRemoveView ( Sublime::AreaIndex *  ,
Sublime::View *   
)
signal

Emitted when a view is going to be removed from the area.

◆ actions()

QList< QAction * > Sublime::Area::actions ( ) const
Returns
the actions related to the area

Definition at line 539 of file area.cpp.

◆ activeView()

View * Sublime::Area::activeView ( ) const

Returns the view that was last stored through setActiveView(view), or zero if the view was deleted or it was never set.

Definition at line 181 of file area.cpp.

◆ addAction()

void Sublime::Area::addAction ( QAction *  action)

Adds an action to the area.

They will be made available from different places, like the Area Display

Definition at line 546 of file area.cpp.

◆ addToolView()

void Sublime::Area::addToolView ( View *  toolView,
Position  defaultPosition 
)

Adds the tool view to the area.

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

Definition at line 264 of file area.cpp.

◆ addView() [1/4]

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

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

If after == 0 && controller()->openAfterCurrent(): view is inserted after current view If after == 0 && !controller()->openAfterCurrent(): view is inserted at the last position.

Definition at line 195 of file area.cpp.

◆ addView() [2/4]

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

Adds the view to the area splitting the area index indexToSplit using given orientation.

view Will be in the second child index of the area-index containing the view.

Definition at line 228 of file area.cpp.

◆ addView() [3/4]

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

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

Definition at line 208 of file area.cpp.

◆ addView() [4/4]

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

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

view Will be in the second child index of the area-index containing the view.

Definition at line 222 of file area.cpp.

◆ changedWorkingSet

void Sublime::Area::changedWorkingSet ( Sublime::Area *  area,
const QString &  from,
const QString &  to 
)
signal

Emitted after the working-set was changed.

◆ changingWorkingSet

void Sublime::Area::changingWorkingSet ( Sublime::Area *  area,
const QString &  from,
const QString &  to 
)
signal

Emitted before the working-set is changed.

◆ clearDocuments()

void Sublime::Area::clearDocuments ( )

Closes all the views and requests the working set to be cleared.

Works even though the area isn't opened yet

Definition at line 531 of file area.cpp.

◆ clearViews()

void Sublime::Area::clearViews ( bool  silent = false)

Removes all views from this area and deletes them.

If an open document has changes, and it is the last view of that document, the user may push 'Cancel', and the view will stay active.

Parameters
silentIf this is true, the user is never asked for feedback.

Definition at line 523 of file area.cpp.

◆ clearWorkingSet

void Sublime::Area::clearWorkingSet ( Sublime::Area *  area)
signal

notifies the working set that it should clear

◆ closeView()

bool Sublime::Area::closeView ( View *  view,
bool  silent = false 
)

Closes and deletes the view, asking the user for feedback if needed.

Closes the document if it is the last view. Does allow breaking the closing process. If it is the last view of the document that has changes, and the user pushed 'Cancel', false will be returned, and the view will not be closed.

Parameters
silentIf this is false, the user will be asked for feedback. Otherwise he won't.

Definition at line 484 of file area.cpp.

◆ controller()

Controller * Sublime::Area::controller ( ) const
Returns
the controller for this area.

Definition at line 324 of file area.cpp.

◆ iconName()

QString Sublime::Area::iconName ( ) const

Definition at line 441 of file area.cpp.

◆ indexOf()

AreaIndex * Sublime::Area::indexOf ( View *  view)
Returns
the index of view or 0 if it can not be found.

Definition at line 248 of file area.cpp.

◆ load()

void Sublime::Area::load ( const KConfigGroup &  group)

Definition at line 372 of file area.cpp.

◆ moveToolView()

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

Moves the tool view to a different position.


Definition at line 297 of file area.cpp.

◆ raiseToolView()

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

Raise tool view.

Definition at line 276 of file area.cpp.

◆ removeToolView()

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

Removes the tool view from the area.

Definition at line 281 of file area.cpp.

◆ removeView()

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

Removes the view from the area.

Does not delete it.

Definition at line 235 of file area.cpp.

◆ requestToolViewRaise

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

Emitted when a tool view is requesting to be raised.

◆ rootIndex()

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 257 of file area.cpp.

◆ save()

void Sublime::Area::save ( KConfigGroup &  group) const

Definition at line 354 of file area.cpp.

◆ setActiveView()

void Sublime::Area::setActiveView ( View *  view)

Allows marking a view as active that can later be retrieved through activeView()

Definition at line 188 of file area.cpp.

◆ setDesiredToolViews()

void Sublime::Area::setDesiredToolViews ( const QMap< QString, Sublime::Position > &  desiredToolViews)

Definition at line 433 of file area.cpp.

◆ setIconName()

void Sublime::Area::setIconName ( const QString &  iconName)

Definition at line 448 of file area.cpp.

◆ setShownToolViews()

void Sublime::Area::setShownToolViews ( Sublime::Position  pos,
const QStringList &  ids 
)

Definition at line 410 of file area.cpp.

◆ setTitle()

void Sublime::Area::setTitle ( const QString &  title)

Definition at line 347 of file area.cpp.

◆ setWorkingSet()

void Sublime::Area::setWorkingSet ( const QString &  name)

Sets the working-set for this area.

The working-set is just a marker, and does nothing within Area. The actual view management has to be implemented in the entity that knows more about possible views, documents, etc. (kdevplatform/shell)

Warning
(KDevelop): Before calling this, make sure that all views are saved! (see IDocumentController::saveAllDocumentsForWindow)

Definition at line 471 of file area.cpp.

◆ shownToolViews()

QStringList Sublime::Area::shownToolViews ( Sublime::Position  pos) const

Definition at line 417 of file area.cpp.

◆ title()

QString Sublime::Area::title ( ) const

Definition at line 340 of file area.cpp.

◆ toolViewAdded

void Sublime::Area::toolViewAdded ( Sublime::View *  ,
Sublime::Position   
)
signal

Emitted when a new tool view is added to the area.

◆ toolViewMoved

void Sublime::Area::toolViewMoved ( Sublime::View *  ,
Sublime::Position   
)
signal

Emitted when a tool view is moved to a different position.

◆ toolViewPosition()

Position Sublime::Area::toolViewPosition ( View *  toolView) const
Returns
the current position of toolView in the area.

Definition at line 317 of file area.cpp.

◆ toolViews()

const QList< View * > & Sublime::Area::toolViews ( ) const
Returns
the list of tool views in the area. No particular sort order is guaranteed.

Definition at line 310 of file area.cpp.

◆ viewAdded

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

Emitted when a new view is added to the area.

◆ viewRemoved

void Sublime::Area::viewRemoved ( Sublime::AreaIndex *  ,
Sublime::View *   
)
signal

Emitted when a view was removed from the area.

◆ views()

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 331 of file area.cpp.

◆ walkToolViews()

template<typename Operator >
void Sublime::Area::walkToolViews ( Operator &  op,
Positions  positions 
)

Walks the list of tool views.

The order in which tool views 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 67 of file areawalkers.h.

◆ walkViews()

template<typename Operator >
void Sublime::Area::walkViews ( Operator &  op,
AreaIndex *  index 
)

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 61 of file areawalkers.h.

◆ wantToolView()

bool Sublime::Area::wantToolView ( const QString &  id)

Definition at line 403 of file area.cpp.

◆ workingSet()

QString Sublime::Area::workingSet ( ) const

Returns the currently set working-set for this area. The working-set is persistent.

Definition at line 463 of file area.cpp.


The documentation for this class was generated from the following files:
  • area.h
  • area.cpp
  • areawalkers.h
Sublime::Position
Position
Positions for tool views in Sublime UI.
Definition: sublimedefs.h:35
Sublime::AllPositions
all tool view positions
Definition: sublimedefs.h:41
Sublime::Area::walkViews
void walkViews(Operator &op, AreaIndex *index)
Walks the tree of area indices and executes the operator.
Definition: areawalkers.h:61
Sublime::Area::Area
Area(Controller *controller, const QString &name, const QString &title={})
Creates and area with given name and adds it to the controller.
Definition: area.cpp:120
Sublime::Area::rootIndex
RootAreaIndex * rootIndex() const
Definition: area.cpp:257
Sublime::Area::WalkerMode
WalkerMode
Walker mode to determine the behavior of area walkers.
Definition: area.h:185
Sublime::Area::controller
Controller * controller() const
Definition: area.cpp:324
Sublime::Area::ContinueWalker
Continue walking.
Definition: area.h:187
Sublime::Area::walkToolViews
void walkToolViews(Operator &op, Positions positions)
Walks the list of tool views.
Definition: areawalkers.h:67
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 23:37:37 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/sublime

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

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal