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

Konsole

  • Konsole
  • ViewContainer
Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
Konsole::ViewContainer Class Referenceabstract

#include <ViewContainer.h>

Inheritance diagram for Konsole::ViewContainer:
Inheritance graph
[legend]

Public Types

enum  Feature { QuickNewView = 1, QuickCloseView = 2 }
 
enum  MoveDirection { MoveViewLeft, MoveViewRight }
 
enum  NavigationPosition { NavigationPositionTop, NavigationPositionBottom, NavigationPositionLeft, NavigationPositionRight }
 
enum  NavigationVisibility { AlwaysShowNavigation, ShowNavigationAsNeeded, AlwaysHideNavigation }
 

Signals

void activeViewChanged (QWidget *view)
 
void destroyed (ViewContainer *container)
 
void empty (ViewContainer *container)
 
void moveViewRequest (int index, int id, bool &success, TabbedViewContainer *sourceContainer)
 
void newViewRequest ()
 
void newViewRequest (Profile::Ptr)
 
void viewAdded (QWidget *view, ViewProperties *properties)
 
void viewRemoved (QWidget *view)
 

Public Member Functions

 ViewContainer (NavigationPosition position, QObject *parent)
 
virtual ~ViewContainer ()
 
void activateLastView ()
 
void activateNextView ()
 
void activatePreviousView ()
 
virtual QWidget * activeView () const =0
 
void addView (QWidget *view, ViewProperties *navigationItem, int index=-1)
 
virtual QWidget * containerWidget () const =0
 
Features features () const
 
void moveActiveView (MoveDirection direction)
 
NavigationPosition navigationPosition () const
 
NavigationVisibility navigationVisibility () const
 
void removeView (QWidget *view)
 
IncrementalSearchBar * searchBar ()
 
virtual void setActiveView (QWidget *widget)=0
 
virtual void setFeatures (Features features)
 
void setNavigationPosition (NavigationPosition position)
 
void setNavigationTextMode (bool mode)
 
void setNavigationVisibility (NavigationVisibility mode)
 
virtual void setNewViewMenu (QMenu *menu)
 
virtual void setStyleSheet (const QString &styleSheet)
 
virtual Features supportedFeatures () const
 
virtual QList< NavigationPosition > supportedNavigationPositions () const
 
ViewProperties * viewProperties (QWidget *view) const
 
const QList< QWidget * > views () 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 QObject *receiver, const char *method)
 
bool disconnect (const char *signal, 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
 

Protected Member Functions

virtual void addViewWidget (QWidget *view, int index)=0
 
virtual void moveViewWidget (int fromIndex, int toIndex)
 
virtual void navigationPositionChanged (NavigationPosition)
 
virtual void navigationTextModeChanged (bool)
 
virtual void navigationVisibilityChanged (NavigationVisibility)
 
virtual void removeViewWidget (QWidget *view)=0
 
QList< QWidget * > widgetsForItem (ViewProperties *item) const
 
- 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)
 

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)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

An interface for container widgets which can hold one or more views.

The container widget typically displays a list of the views which it has and provides a means of switching between them.

Subclasses should reimplement the addViewWidget() and removeViewWidget() functions to actually add or remove view widgets from the container widget, as well as updating any navigation aids.

Definition at line 64 of file ViewContainer.h.

Member Enumeration Documentation

enum Konsole::ViewContainer::Feature

Enum describing extra UI features which can be provided by the container.

Enumerator
QuickNewView 

Provides a button which can be clicked to create new views quickly.

When the button is clicked, a newViewRequest() signal is emitted.

QuickCloseView 

Provides a button which can be clicked to close views quickly.

Definition at line 237 of file ViewContainer.h.

enum Konsole::ViewContainer::MoveDirection

This enum describes the directions in which views can be re-arranged within the container using the moveActiveView() method.

Enumerator
MoveViewLeft 

Moves the view to the left.

MoveViewRight 

Moves the view to the right.

Definition at line 219 of file ViewContainer.h.

enum Konsole::ViewContainer::NavigationPosition

This enum describes the options for positioning the container's navigation widget.

Enumerator
NavigationPositionTop 

Position the navigation widget above the views.

NavigationPositionBottom 

Position the navigation widget below the views.

NavigationPositionLeft 

Position the navigation widget to the left of the views.

NavigationPositionRight 

Position the navigation widget to the right of the views.

Definition at line 73 of file ViewContainer.h.

enum Konsole::ViewContainer::NavigationVisibility

This enum describes the options for showing or hiding the container's navigation widget.

Enumerator
AlwaysShowNavigation 

Always show the navigation widget.

ShowNavigationAsNeeded 

Show the navigation widget only when the container has more than one view.

AlwaysHideNavigation 

Always hide the navigation widget.

Definition at line 106 of file ViewContainer.h.

Constructor & Destructor Documentation

ViewContainer::ViewContainer ( NavigationPosition  position,
QObject *  parent 
)

Constructs a new view container with the specified parent.

Parameters
positionThe initial position of the navigation widget
parentThe parent object of the container

Definition at line 54 of file ViewContainer.cpp.

ViewContainer::~ViewContainer ( )
virtual

Called when the ViewContainer is destroyed.

When reimplementing this in subclasses, use object->deleteLater() to delete any widgets or other objects instead of 'delete object'.

Definition at line 62 of file ViewContainer.cpp.

Member Function Documentation

void ViewContainer::activateLastView ( )

Changes the active view to the last view.

Definition at line 226 of file ViewContainer.cpp.

void ViewContainer::activateNextView ( )

Changes the active view to the next view.

Definition at line 209 of file ViewContainer.cpp.

void ViewContainer::activatePreviousView ( )

Changes the active view to the previous view.

Definition at line 231 of file ViewContainer.cpp.

virtual QWidget* Konsole::ViewContainer::activeView ( ) const
pure virtual

Returns the view which currently has the focus or 0 if none of the child views have the focus.

Implemented in Konsole::StackedViewContainer, and Konsole::TabbedViewContainer.

void Konsole::ViewContainer::activeViewChanged ( QWidget *  view)
signal

Emitted when the active view changes.

void ViewContainer::addView ( QWidget *  view,
ViewProperties *  navigationItem,
int  index = -1 
)

Adds a new view to the container widget.

Definition at line 138 of file ViewContainer.cpp.

virtual void Konsole::ViewContainer::addViewWidget ( QWidget *  view,
int  index 
)
protectedpure virtual

Performs the task of adding the view widget to the container widget.

Implemented in Konsole::StackedViewContainer, and Konsole::TabbedViewContainer.

virtual QWidget* Konsole::ViewContainer::containerWidget ( ) const
pure virtual

Returns the widget which contains the view widgets.

Implemented in Konsole::StackedViewContainer, and Konsole::TabbedViewContainer.

void Konsole::ViewContainer::destroyed ( ViewContainer *  container)
signal

Emitted when the container is deleted.

void Konsole::ViewContainer::empty ( ViewContainer *  container)
signal

Emitted when the container has no more children.

ViewContainer::Features ViewContainer::features ( ) const

Returns a bitwise-OR of enabled extra UI features.

See setFeatures()

Definition at line 79 of file ViewContainer.cpp.

void ViewContainer::moveActiveView ( MoveDirection  direction)

Moves the active view within the container and updates the order in which the views are shown in the container's navigation widget.

The default implementation does nothing.

Definition at line 83 of file ViewContainer.cpp.

void Konsole::ViewContainer::moveViewRequest ( int  index,
int  id,
bool &  success,
TabbedViewContainer *  sourceContainer 
)
signal

Emitted when the user requests to move a view from another container into this container.

If 'success' is set to true by a connected slot then the original view will be removed.

Parameters
indexIndex at which to insert the new view in the container or -1 to append it. This index should be passed to addView() when the new view has been created.
idThe identifier of the view.
successThe slot handling this signal should set this to true if the new view was successfully created.
sourceContainerInitial move event Tabbed view container.
void ViewContainer::moveViewWidget ( int  fromIndex,
int  toIndex 
)
protectedvirtual

Rearranges the order of widgets in the container.

Parameters
fromIndexCurrent index of the widget to move
toIndexNew index for the widget

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 74 of file ViewContainer.cpp.

ViewContainer::NavigationPosition ViewContainer::navigationPosition ( ) const

Returns the position of the navigation widget with respect to the main content area.

Definition at line 111 of file ViewContainer.cpp.

virtual void Konsole::ViewContainer::navigationPositionChanged ( NavigationPosition  )
inlineprotectedvirtual

Called when the navigation position changes to re-layout the container and place the navigation widget in the specified position.

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 325 of file ViewContainer.h.

virtual void Konsole::ViewContainer::navigationTextModeChanged ( bool  )
inlineprotectedvirtual

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 327 of file ViewContainer.h.

ViewContainer::NavigationVisibility ViewContainer::navigationVisibility ( ) const

Returns the current mode for controlling the visibility of the the view container's navigation widget.

Definition at line 128 of file ViewContainer.cpp.

virtual void Konsole::ViewContainer::navigationVisibilityChanged ( NavigationVisibility  )
inlineprotectedvirtual

Called when the navigation display mode changes.

See setNavigationVisibility

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 318 of file ViewContainer.h.

void Konsole::ViewContainer::newViewRequest ( )
signal

Emitted when the user requests to open a new view.

void Konsole::ViewContainer::newViewRequest ( Profile::Ptr  )
signal

Requests creation of a new view, with the selected profile.

void ViewContainer::removeView ( QWidget *  view)

Removes a view from the container.

Definition at line 174 of file ViewContainer.cpp.

virtual void Konsole::ViewContainer::removeViewWidget ( QWidget *  view)
protectedpure virtual

Performs the task of removing the view widget from the container widget.

Implemented in Konsole::StackedViewContainer, and Konsole::TabbedViewContainer.

IncrementalSearchBar * ViewContainer::searchBar ( )
Returns
the search widget for this view

Definition at line 194 of file ViewContainer.cpp.

virtual void Konsole::ViewContainer::setActiveView ( QWidget *  widget)
pure virtual

Changes the focus to the specified view and updates navigation aids to reflect the change.

Implemented in Konsole::StackedViewContainer, and Konsole::TabbedViewContainer.

void ViewContainer::setFeatures ( Features  features)
virtual

Sets which additional features are enabled in this container.

The default implementation does thing. Sub-classes should re-implement this to hide or show the relevant parts of their UI

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 75 of file ViewContainer.cpp.

void ViewContainer::setNavigationPosition ( NavigationPosition  position)

Sets the position of the navigation widget with respect to the main content area.

Depending on the ViewContainer subclass, not all positions from the NavigationPosition enum may be supported. A list of supported positions can be obtained by calling supportedNavigationPositions()

ViewContainer sub-classes should re-implement the navigationPositionChanged() method to respond to changes of this property.

Definition at line 115 of file ViewContainer.cpp.

void ViewContainer::setNavigationTextMode ( bool  mode)

Sets the navigation text mode If mode is true, use the width of the title; otherwise use the default width calculations.

Definition at line 133 of file ViewContainer.cpp.

void ViewContainer::setNavigationVisibility ( NavigationVisibility  mode)

Definition at line 106 of file ViewContainer.cpp.

virtual void Konsole::ViewContainer::setNewViewMenu ( QMenu *  menu)
inlinevirtual

Sets the menu to be shown when the new view button is clicked.

Only valid if the QuickNewView feature is enabled. The default implementation does nothing.

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 261 of file ViewContainer.h.

virtual void Konsole::ViewContainer::setStyleSheet ( const QString &  styleSheet)
inlinevirtual

Sets the stylesheet for visual appearance.

The default implementation does nothing.

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 172 of file ViewContainer.h.

virtual Features Konsole::ViewContainer::supportedFeatures ( ) const
inlinevirtual

Returns a bitwise-OR of supported extra UI features.

The default implementation returns 0 (no extra features)

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 255 of file ViewContainer.h.

QList< ViewContainer::NavigationPosition > ViewContainer::supportedNavigationPositions ( ) const
virtual

Returns the list of supported navigation positions.

The supported positions will depend upon the type of the navigation widget used by the ViewContainer subclass.

The base implementation returns one item, NavigationPositionTop

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 124 of file ViewContainer.cpp.

void Konsole::ViewContainer::viewAdded ( QWidget *  view,
ViewProperties *  properties 
)
signal

Emitted when a view is added to the container.

ViewProperties * ViewContainer::viewProperties ( QWidget *  view) const

Returns the ViewProperties instance associated with a particular view in the container.

Definition at line 248 of file ViewContainer.cpp.

void Konsole::ViewContainer::viewRemoved ( QWidget *  view)
signal

Emitted when a view is removed from the container.

const QList< QWidget * > ViewContainer::views ( ) const

Returns a list of the contained views.

Definition at line 189 of file ViewContainer.cpp.

QList< QWidget * > ViewContainer::widgetsForItem ( ViewProperties *  item) const
protected

Returns the widgets which are associated with a particular navigation item.

Definition at line 255 of file ViewContainer.cpp.


The documentation for this class was generated from the following files:
  • ViewContainer.h
  • ViewContainer.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

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