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

Konsole

  • kde-4.14
  • applications
  • konsole
  • src
ViewSplitter.h
Go to the documentation of this file.
1 /*
2  This file is part of the Konsole Terminal.
3 
4  Copyright 2006-2008 Robert Knight <robertknight@gmail.com>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  02110-1301 USA.
20 */
21 
22 #ifndef VIEWSPLITTER_H
23 #define VIEWSPLITTER_H
24 
25 // Qt
26 #include <QtCore/QList>
27 #include <QSplitter>
28 
29 class QFocusEvent;
30 
31 namespace Konsole
32 {
33 class ViewContainer;
34 
47 class ViewSplitter : public QSplitter
48 {
49  Q_OBJECT
50 
51 public:
52  explicit ViewSplitter(QWidget* parent = 0);
53 
69  void addContainer(ViewContainer* container , Qt::Orientation orientation);
70 
72  void removeContainer(ViewContainer* container);
73 
75  ViewSplitter* activeSplitter();
76 
88  ViewContainer* activeContainer() const;
89 
93  void setActiveContainer(ViewContainer* container);
94 
98  QList<ViewContainer*> containers() const {
99  return _containers;
100  }
101 
105  void activateNextContainer();
106 
116  void adjustContainerSize(ViewContainer* container , int percentage);
117 
121  void activatePreviousContainer();
122 
138  void setRecursiveSplitting(bool recursive);
139 
144  bool recursiveSplitting() const;
145 
146 signals:
148  void empty(ViewSplitter* splitter);
149 
157  void allContainersEmpty();
158 
159 protected:
160  //virtual void focusEvent(QFocusEvent* event);
161 
162 private:
163  // Adds container to splitter's internal list and
164  // connects signals and slots
165  void registerContainer(ViewContainer* container);
166  // Removes container from splitter's internal list and
167  // removes signals and slots
168  void unregisterContainer(ViewContainer* container);
169 
170  void updateSizes();
171 
172 private slots:
173  // Called to indicate that a child ViewContainer has been deleted
174  void containerDestroyed(ViewContainer* container);
175 
176  // Called to indicate that a child ViewContainer is empty
177  void containerEmpty(ViewContainer* container);
178 
179  // Called to indicate that a child ViewSplitter is empty
180  // (ie. all child widgets have been deleted)
181  void childEmpty(ViewSplitter* splitter);
182 
183 private:
184  QList<ViewContainer*> _containers;
185  bool _recursiveSplitting;
186 };
187 }
188 #endif //VIEWSPLITTER_H
189 
Konsole::ViewSplitter::setRecursiveSplitting
void setRecursiveSplitting(bool recursive)
Specifies whether the view may be split recursively.
Definition: ViewSplitter.cpp:115
QWidget
Konsole::ViewSplitter::activeContainer
ViewContainer * activeContainer() const
Returns the container which currently has the focus or 0 if none of the immediate child containers ha...
Definition: ViewSplitter.cpp:229
Konsole::ViewSplitter::activeSplitter
ViewSplitter * activeSplitter()
Returns the child ViewSplitter widget which currently has the focus.
Definition: ViewSplitter.cpp:70
Konsole::ViewSplitter::setActiveContainer
void setActiveContainer(ViewContainer *container)
Gives the focus to the active view in the specified container.
Definition: ViewSplitter.cpp:221
Konsole::ViewSplitter::activatePreviousContainer
void activatePreviousContainer()
Gives the focus to the active view in the previous container.
Definition: ViewSplitter.cpp:207
Konsole::ViewSplitter::recursiveSplitting
bool recursiveSplitting() const
Returns whether the view may be split recursively.
Definition: ViewSplitter.cpp:119
Konsole::ViewSplitter::containers
QList< ViewContainer * > containers() const
Returns a list of the containers held by this splitter.
Definition: ViewSplitter.h:98
QSplitter::orientation
Qt::Orientation orientation() const
Konsole::ViewContainer
An interface for container widgets which can hold one or more views.
Definition: ViewContainer.h:64
Konsole::ViewSplitter
A splitter which holds a number of ViewContainer objects and allows the user to control the size of e...
Definition: ViewSplitter.h:47
Konsole::ViewSplitter::allContainersEmpty
void allContainersEmpty()
Signal emitted when the containers held by this splitter become empty, this differs from the empty() ...
Konsole::ViewSplitter::removeContainer
void removeContainer(ViewContainer *container)
Removes a container from the splitter.
Definition: ViewSplitter.cpp:124
Konsole::ViewSplitter::ViewSplitter
ViewSplitter(QWidget *parent=0)
Definition: ViewSplitter.cpp:33
QList
Konsole::ViewSplitter::activateNextContainer
void activateNextContainer()
Gives the focus to the active view in the next container.
Definition: ViewSplitter.cpp:190
Konsole::ViewSplitter::addContainer
void addContainer(ViewContainer *container, Qt::Orientation orientation)
Locates the child ViewSplitter widget which currently has the focus and inserts the container into it...
Definition: ViewSplitter.cpp:131
Konsole::ViewSplitter::empty
void empty(ViewSplitter *splitter)
Signal emitted when the last child widget is removed from the splitter.
QSplitter
Konsole::ViewSplitter::adjustContainerSize
void adjustContainerSize(ViewContainer *container, int percentage)
Changes the size of the specified container by a given percentage.
Definition: ViewSplitter.cpp:47
QObject::parent
QObject * parent() const
QFocusEvent
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 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