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

liblancelot

  • sources
  • kde-4.14
  • workspace
  • kdeplasma-addons
  • libs
  • lancelot
  • layouts
FlipLayout.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007, 2008, 2009, 2010 Ivan Cukic <ivan.cukic(at)kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser/Library General Public License version 2,
6  * or (at your option) any later version, as published by the Free
7  * Software Foundation
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser/Library General Public License for more details
13  *
14  * You should have received a copy of the GNU Lesser/Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef LANCELOT_FLIP_LAYOUT_H
21 #define LANCELOT_FLIP_LAYOUT_H
22 
23 #include <QGraphicsLayout>
24 #include <QGraphicsLayoutItem>
25 
26 #include <Plasma/Plasma>
27 
28 #include <lancelot/lancelot_export.h>
29 
30 namespace Lancelot
31 {
32 
33 class LANCELOT_EXPORT FlipLayoutManager {
34 public:
39  void setGlobalFlip(Plasma::Flip flip);
40 
44  Plasma::Flip globalFlip() const;
45 
51  void setFlip(const QGraphicsLayout * layout, Plasma::Flip flip);
52 
57  void setUseGlobalFlip(const QGraphicsLayout * layout);
58 
64  Plasma::Flip flip(const QGraphicsLayout * layout) const;
65 
69  static FlipLayoutManager * self();
70 
74  void setGeometry(QGraphicsLayout * layout) const;
75 
76 private:
77  FlipLayoutManager();
78  ~FlipLayoutManager();
79  static FlipLayoutManager * m_instance;
80 
81  class Private;
82  Private * const d;
83 };
84 
85 template <typename SuperLayout>
86 class FlipLayout : public SuperLayout {
87 public:
88  FlipLayout(QGraphicsLayoutItem * parent = NULL)
89  : SuperLayout(parent)
90  {
91 
92  }
93 
94  void setFlip(Plasma::Flip flip)
95  {
96  FlipLayoutManager::self()->setFlip(this, flip);
97  }
98 
99  void setUseGlobalFlip()
100  {
101  FlipLayoutManager::self()->setUseGlobalFlip(this);
102  }
103 
104  Plasma::Flip flip() const
105  {
106  return FlipLayoutManager::self()->flip(this);
107  }
108 
109  L_Override void setGeometry(const QRectF & rect)
110  {
111  SuperLayout::setGeometry(rect);
112  FlipLayoutManager::self()->setGeometry(this);
113  }
114 
115 };
116 
117 } // namespace Lancelot
118 
119 #endif /* LANCELOT_FLIP_LAYOUT_H */
120 
SuperLayout
Lancelot::FlipLayoutManager::self
static FlipLayoutManager * self()
Definition: FlipLayout.cpp:49
Lancelot::FlipLayout
Definition: FlipLayout.h:86
L_Override
#define L_Override
Definition: lancelot_export.h:41
lancelot_export.h
Lancelot::FlipLayoutManager::flip
Plasma::Flip flip(const QGraphicsLayout *layout) const
Definition: FlipLayout.cpp:85
LANCELOT_EXPORT
#define LANCELOT_EXPORT
Definition: lancelot_export.h:32
Lancelot::FlipLayout::setGeometry
L_Override void setGeometry(const QRectF &rect)
Definition: FlipLayout.h:109
Lancelot::FlipLayoutManager::setUseGlobalFlip
void setUseGlobalFlip(const QGraphicsLayout *layout)
Makes the specified layout to use the global flip.
Definition: FlipLayout.cpp:78
Lancelot::FlipLayout::FlipLayout
FlipLayout(QGraphicsLayoutItem *parent=NULL)
Definition: FlipLayout.h:88
Lancelot::FlipLayoutManager::setFlip
void setFlip(const QGraphicsLayout *layout, Plasma::Flip flip)
Sets the flip for a specified layout.
Definition: FlipLayout.cpp:67
Lancelot::FlipLayout::setFlip
void setFlip(Plasma::Flip flip)
Definition: FlipLayout.h:94
QRectF
Lancelot::FlipLayout::setUseGlobalFlip
void setUseGlobalFlip()
Definition: FlipLayout.h:99
QGraphicsLayout
Lancelot::FlipLayoutManager::setGeometry
void setGeometry(QGraphicsLayout *layout) const
Implementation of the actual flipping.
Definition: FlipLayout.cpp:96
Lancelot::FlipLayout::flip
Plasma::Flip flip() const
Definition: FlipLayout.h:104
Lancelot::FlipLayoutManager
Definition: FlipLayout.h:33
QGraphicsLayoutItem
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:43:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

liblancelot

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

workspace API Reference

Skip menu "workspace API Reference"
  • kdeplasma-addons
  •       GroupingDesktop
  •     liblancelot

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