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

Konsole

Konsole::ViewContainer

Konsole::ViewContainer Class Reference

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

#include <ViewContainer.h>

Inheritance diagram for Konsole::ViewContainer:

Inheritance graph
[legend]

List of all members.


Public Types

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

Signals

void activeViewChanged (QWidget *view)
void closeRequest (QWidget *activeView)
void destroyed (ViewContainer *container)
void duplicateRequest (ViewProperties *properties)
void empty (ViewContainer *container)
void moveViewRequest (int index, int id, bool &success)
void newViewRequest ()
void viewAdded (QWidget *view, ViewProperties *properties)
void viewRemoved (QWidget *view)

Public Member Functions

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)
NavigationDisplayMode navigationDisplayMode () const
NavigationPosition navigationPosition () const
void removeView (QWidget *view)
IncrementalSearchBar * searchBar ()
virtual void setActiveView (QWidget *widget)=0
virtual void setFeatures (Features features)
void setNavigationDisplayMode (NavigationDisplayMode mode)
void setNavigationPosition (NavigationPosition position)
virtual void setNewViewMenu (QMenu *menu)
virtual Features supportedFeatures () const
virtual QList< NavigationPosition > supportedNavigationPositions () const
 ViewContainer (NavigationPosition position, QObject *parent)
ViewProperties * viewProperties (QWidget *view)
const QList< QWidget * > views ()
virtual ~ViewContainer ()

Protected Member Functions

virtual void addViewWidget (QWidget *view, int index)=0
virtual void moveViewWidget (int fromIndex, int toIndex)
virtual void navigationDisplayModeChanged (NavigationDisplayMode)
virtual void navigationPositionChanged (NavigationPosition)
virtual void removeViewWidget (QWidget *view)=0
QList< QWidget * > widgetsForItem (ViewProperties *item) const

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 72 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 232 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 213 of file ViewContainer.h.

enum Konsole::ViewContainer::NavigationDisplayMode

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

Enumerator:
AlwaysShowNavigation  Always show the navigation widget.

AlwaysHideNavigation  Always hide the navigation widget.

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

Definition at line 116 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 82 of file ViewContainer.h.


Constructor & Destructor Documentation

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

Constructs a new view container with the specified parent.

Parameters:
position The initial position of the navigation widget
parent The parent object of the container

Definition at line 61 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 69 of file ViewContainer.cpp.


Member Function Documentation

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 226 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::TabbedViewContainer, Konsole::StackedViewContainer, and Konsole::ListViewContainer.

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 137 of file ViewContainer.cpp.

virtual void Konsole::ViewContainer::addViewWidget ( QWidget *  view,
int  index 
) [protected, pure virtual]

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

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

void Konsole::ViewContainer::closeRequest ( QWidget *  activeView  )  [signal]

Emitted when the user requests to close a view.

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

Returns the widget which contains the view widgets.

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

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

Emitted when the container is deleted.

void Konsole::ViewContainer::duplicateRequest ( ViewProperties *  properties  )  [signal]

Emitted when the user requests to duplicate a view.

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 85 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 87 of file ViewContainer.cpp.

void Konsole::ViewContainer::moveViewRequest ( int  index,
int  id,
bool &  success 
) [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:
index Index 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.
id The identifier of the view.
success The slot handling this signal should set this to true if the new view was successfully created.

void ViewContainer::moveViewWidget ( int  fromIndex,
int  toIndex 
) [protected, virtual]

Rearranges the order of widgets in the container.

Parameters:
fromIndex Current index of the widget to move
toIndex New index for the widget

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 82 of file ViewContainer.cpp.

ViewContainer::NavigationDisplayMode ViewContainer::navigationDisplayMode (  )  const

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

Definition at line 133 of file ViewContainer.cpp.

virtual void Konsole::ViewContainer::navigationDisplayModeChanged ( NavigationDisplayMode   )  [inline, protected, virtual]

Called when the navigation display mode changes.

See setNavigationDisplayMode

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 313 of file ViewContainer.h.

ViewContainer::NavigationPosition ViewContainer::navigationPosition (  )  const

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

Definition at line 116 of file ViewContainer.cpp.

virtual void Konsole::ViewContainer::navigationPositionChanged ( NavigationPosition   )  [inline, protected, virtual]

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 320 of file ViewContainer.h.

void Konsole::ViewContainer::newViewRequest (  )  [signal]

Emitted when the user requests to open a new view.

void ViewContainer::removeView ( QWidget *  view  ) 

Removes a view from the container.

Definition at line 173 of file ViewContainer.cpp.

virtual void Konsole::ViewContainer::removeViewWidget ( QWidget *  view  )  [protected, pure virtual]

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

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

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::TabbedViewContainer, Konsole::StackedViewContainer, and Konsole::ListViewContainer.

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 83 of file ViewContainer.cpp.

void ViewContainer::setNavigationDisplayMode ( NavigationDisplayMode  mode  ) 

Definition at line 111 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 120 of file ViewContainer.cpp.

virtual void Konsole::ViewContainer::setNewViewMenu ( QMenu *  menu  )  [inline, virtual]

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 256 of file ViewContainer.h.

virtual Features Konsole::ViewContainer::supportedFeatures (  )  const [inline, virtual]

Returns a bitwise-OR of supported extra UI features.

The default implementation returns 0 (no extra features)

Reimplemented in Konsole::TabbedViewContainer.

Definition at line 251 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 129 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  ) 

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

Definition at line 243 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 (  ) 

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 250 of file ViewContainer.cpp.


The documentation for this class was generated from the following files:
  • ViewContainer.h
  • ViewContainer.cpp

Konsole

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

API Reference

Skip menu "API Reference"
  • Konsole
  • Libraries
  •   libkonq
Generated for API Reference by doxygen 1.5.7
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