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

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • libs
  • kasten
  • gui
  • shell
tabbedviews_p.h
Go to the documentation of this file.
1 /*
2  This file is part of the Kasten Framework, made within the KDE community.
3 
4  Copyright 2007,2009 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef TABBEDVIEWS_P_H
24 #define TABBEDVIEWS_P_H
25 
26 // lib
27 #include "abstractgroupedviews_p.h"
28 #include "tabbedviews.h"
29 #include "viewareabox.h"
30 #include "viewbox.h"
31 #include <abstractview.h>
32 // KDE
33 #include <KTabWidget>
34 
35 
36 namespace Kasten2
37 {
38 
39 class TabbedViewsPrivate : public AbstractGroupedViewsPrivate
40 {
41  public:
42  explicit TabbedViewsPrivate( TabbedViews* parent );
43 
44  virtual ~TabbedViewsPrivate();
45 
46  public:
47  void init();
48 
49  public: // AbstractViewArea API
50  void setFocus();
51  QWidget* widget() const;
52  bool hasFocus() const;
53 
54  public: // AbstractGroupedViews API
55  void addViews( const QList<AbstractView*>& views );
56  void removeViews( const QList<AbstractView*>& views );
57  void setViewFocus( AbstractView *view );
58 
59  QList<AbstractView*> viewList() const;
60  int viewCount() const;
61  AbstractView* viewFocus() const;
62 
63  public: // If::ToolInlineViewable API
64  void setCurrentToolInlineView( AbstractToolInlineView* view );
65 
66  public:
67  int indexOf( AbstractView* view ) const;
68 
69  public: // Q_SLOTS:
70  void onCurrentChanged( int index );
71  void onCloseRequest( QWidget* widget );
72  void onTitleChanged( const QString &newTitle );
73 // void onModifiedChanged( Kasten2::AbstractDocument::SyncStates newStates );
74  void onViewFocusChanged( bool focusChanged );
75  void onMouseMiddleClick();
76  void onDragMoveEvent( const QDragMoveEvent* event, bool& accept );
77  void onDropEvent( QDropEvent* event );
78 
79  protected:
80  Q_DECLARE_PUBLIC( TabbedViews )
81 
82  protected:
83  ViewAreaBox* mViewAreaBox;
84  KTabWidget* mTabWidget;
85 
86  AbstractView* mCurrentView;
87 };
88 
89 
90 inline QWidget* TabbedViewsPrivate::widget() const { return mViewAreaBox; }
91 inline int TabbedViewsPrivate::viewCount() const { return mTabWidget->count(); }
92 
93 inline AbstractView* TabbedViewsPrivate::viewFocus() const
94 {
95  const ViewBox* viewBox = static_cast<const ViewBox*>( mTabWidget->currentWidget() );
96  return viewBox ? viewBox->view() : 0;
97 }
98 
99 inline bool TabbedViewsPrivate::hasFocus() const
100 {
101  return mCurrentView ? mCurrentView->hasFocus() : false;
102 }
103 
104 
105 inline void TabbedViewsPrivate::setViewFocus( AbstractView *view )
106 {
107  const int index = indexOf( view );
108  mTabWidget->setCurrentIndex( index );
109 }
110 
111 inline void TabbedViewsPrivate::setFocus()
112 {
113  if( mCurrentView )
114  mCurrentView->setFocus();
115  // TODO: would ensure the bottomwidget gets focus if there is one. Just, it didn't work at all
116 // mViewAreaBox->setFocus();
117 }
118 
119 }
120 
121 #endif
Kasten2::AbstractView
Definition: abstractview.h:38
Kasten2::TabbedViewsPrivate::viewCount
int viewCount() const
Definition: tabbedviews_p.h:91
Kasten2::AbstractView::setFocus
virtual void setFocus()=0
Kasten2::ViewBox::view
AbstractView * view() const
Definition: viewbox.cpp:48
Kasten2::TabbedViewsPrivate::onCloseRequest
void onCloseRequest(QWidget *widget)
Kasten2::TabbedViewsPrivate::addViews
void addViews(const QList< AbstractView * > &views)
Kasten2::AbstractToolInlineView
Definition: abstracttoolinlineview.h:39
abstractview.h
QWidget
Kasten2::TabbedViewsPrivate::mTabWidget
KTabWidget * mTabWidget
Definition: tabbedviews_p.h:84
Kasten2::ViewAreaBox
Definition: viewareabox.h:35
Kasten2::TabbedViewsPrivate::onMouseMiddleClick
void onMouseMiddleClick()
Kasten2::AbstractView::hasFocus
virtual bool hasFocus() const =0
Kasten2::TabbedViewsPrivate::hasFocus
bool hasFocus() const
Definition: tabbedviews_p.h:99
Kasten2::TabbedViewsPrivate::onViewFocusChanged
void onViewFocusChanged(bool focusChanged)
Kasten2::TabbedViewsPrivate::viewList
QList< AbstractView * > viewList() const
Kasten2::TabbedViewsPrivate::onCurrentChanged
void onCurrentChanged(int index)
Kasten2::TabbedViewsPrivate
Definition: tabbedviews_p.h:39
Kasten2::TabbedViewsPrivate::widget
QWidget * widget() const
Definition: tabbedviews_p.h:90
Kasten2::TabbedViewsPrivate::mViewAreaBox
ViewAreaBox * mViewAreaBox
Definition: tabbedviews_p.h:83
viewbox.h
Kasten2::TabbedViews
Definition: tabbedviews.h:41
Kasten2::TabbedViewsPrivate::~TabbedViewsPrivate
virtual ~TabbedViewsPrivate()
Kasten2::TabbedViewsPrivate::onTitleChanged
void onTitleChanged(const QString &newTitle)
Kasten2::TabbedViewsPrivate::removeViews
void removeViews(const QList< AbstractView * > &views)
Kasten2::TabbedViewsPrivate::setViewFocus
void setViewFocus(AbstractView *view)
Definition: tabbedviews_p.h:105
viewareabox.h
Kasten2::TabbedViewsPrivate::setFocus
void setFocus()
Definition: tabbedviews_p.h:111
Kasten2::TabbedViewsPrivate::mCurrentView
AbstractView * mCurrentView
Definition: tabbedviews_p.h:86
Kasten2::TabbedViewsPrivate::onDropEvent
void onDropEvent(QDropEvent *event)
tabbedviews.h
Kasten2::TabbedViewsPrivate::init
void init()
Kasten2::TabbedViewsPrivate::onDragMoveEvent
void onDragMoveEvent(const QDragMoveEvent *event, bool &accept)
Kasten2::ViewBox
Definition: viewbox.h:36
Kasten2::TabbedViewsPrivate::setCurrentToolInlineView
void setCurrentToolInlineView(AbstractToolInlineView *view)
Kasten2::TabbedViewsPrivate::indexOf
int indexOf(AbstractView *view) const
Kasten2::TabbedViewsPrivate::viewFocus
AbstractView * viewFocus() const
Definition: tabbedviews_p.h:93
Kasten2::AbstractGroupedViewsPrivate
Definition: abstractgroupedviews_p.h:34
Kasten2::TabbedViewsPrivate::TabbedViewsPrivate
TabbedViewsPrivate(TabbedViews *parent)
QList
Definition: bookmarkable.h:29
abstractgroupedviews_p.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

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

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

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