• 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
ViewContainerTabBar.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 VIEWCONTAINERTABBAR_H
23 #define VIEWCONTAINERTABBAR_H
24 
25 // KDE
26 #include <KTabBar>
27 
28 class QLabel;
29 
30 namespace Konsole
31 {
32 class TabbedViewContainer;
33 
34 class ViewContainerTabBar : public KTabBar
35 {
36  Q_OBJECT
37 
38 public:
39  ViewContainerTabBar(QWidget* parent, TabbedViewContainer* container);
40 
41  // returns a pixmap image of a tab for use with QDrag
42  QPixmap dragDropPixmap(int tab);
43 
44  // set the mimetype of which the tabbar support d&d
45  void setSupportedMimeType(const QString& mimeType);
46 
47  // return associated tabbed container
48  TabbedViewContainer* connectedTabbedViewContainer();
49 
50 signals:
51  void querySourceIndex(const QDropEvent* event, int& sourceIndex) const;
52  void moveViewRequest(int index, const QDropEvent* event, bool& success, TabbedViewContainer* sourceTabbedContainer);
53 
54 protected:
55  virtual void dragEnterEvent(QDragEnterEvent* event);
56  virtual void dragLeaveEvent(QDragLeaveEvent* event);
57  virtual void dragMoveEvent(QDragMoveEvent* event);
58  virtual void dropEvent(QDropEvent* event);
59 
60 private:
61  // show the indicator arrow which shows where a dropped tab will
62  // be inserted at 'index'
63  void setDropIndicator(int index, bool drawDisabled = false);
64 
65  // returns the index at which a tab will be inserted if the mouse
66  // in a drag-drop operation is released at 'pos'
67  int dropIndex(const QPoint& pos) const;
68 
69  // returns true if the tab to be dropped in a drag-drop operation
70  // is the same as the tab at the drop location
71  bool proposedDropIsSameTab(const QDropEvent* event) const;
72 
73  QLabel* _dropIndicator;
74  int _dropIndicatorIndex;
75  bool _drawIndicatorDisabled;
76  QString _supportedMimeType;
77  TabbedViewContainer* _connectedContainer;
78 };
79 }
80 
81 #endif // VIEWCONTAINERTABBAR_H
QWidget
Konsole::ViewContainerTabBar::ViewContainerTabBar
ViewContainerTabBar(QWidget *parent, TabbedViewContainer *container)
Definition: ViewContainerTabBar.cpp:39
Konsole::TabbedViewContainer
An alternative tabbed view container which uses a QTabBar and QStackedWidget combination for navigati...
Definition: ViewContainer.h:361
QDragMoveEvent
QPoint
Konsole::ViewContainerTabBar::setSupportedMimeType
void setSupportedMimeType(const QString &mimeType)
Definition: ViewContainerTabBar.cpp:167
Konsole::ViewContainerTabBar::dragDropPixmap
QPixmap dragDropPixmap(int tab)
Definition: ViewContainerTabBar.cpp:207
Konsole::ViewContainerTabBar::dragEnterEvent
virtual void dragEnterEvent(QDragEnterEvent *event)
Definition: ViewContainerTabBar.cpp:57
Konsole::ViewContainerTabBar::connectedTabbedViewContainer
TabbedViewContainer * connectedTabbedViewContainer()
Definition: ViewContainerTabBar.cpp:117
QDropEvent
KTabBar
Konsole::ViewContainerTabBar::dragLeaveEvent
virtual void dragLeaveEvent(QDragLeaveEvent *event)
Definition: ViewContainerTabBar.cpp:64
QString
Konsole::ViewContainerTabBar
Definition: ViewContainerTabBar.h:34
Konsole::ViewContainerTabBar::dragMoveEvent
virtual void dragMoveEvent(QDragMoveEvent *event)
Definition: ViewContainerTabBar.cpp:69
QPixmap
Konsole::ViewContainerTabBar::moveViewRequest
void moveViewRequest(int index, const QDropEvent *event, bool &success, TabbedViewContainer *sourceTabbedContainer)
QDragLeaveEvent
QDragEnterEvent
Konsole::ViewContainerTabBar::querySourceIndex
void querySourceIndex(const QDropEvent *event, int &sourceIndex) const
QLabel
Konsole::ViewContainerTabBar::dropEvent
virtual void dropEvent(QDropEvent *event)
Definition: ViewContainerTabBar.cpp:83
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