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

kopete/kopete

  • sources
  • kde-4.14
  • kdenetwork
  • kopete
  • kopete
  • config
  • appearance
  • layout
TokenWithLayout.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (c) 2009 Nikolaj Hald Nielsen <nhnFreespirit@gmail.com> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
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 General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * 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 TOKENWITHLAYOUT_H
21 #define TOKENWITHLAYOUT_H
22 
23 #include <Token.h>
24 
25 class QMenu;
26 
27 class TokenWithLayoutFactory : public TokenFactory
28 {
29 public:
30  virtual Token * createToken( const QString &text, const QString &iconName, int value, QWidget *parent = 0 );
31 };
32 
38 class TokenWithLayout : public Token
39 {
40  Q_OBJECT
41 public:
42  TokenWithLayout( const QString &text, const QString &iconName, int value, QWidget *parent = 0 );
43  ~TokenWithLayout();
44 
45  Qt::Alignment alignment();
46  void setAlignment( Qt::Alignment alignment );
47 
48  bool bold() const;
49  bool italic() const;
50  inline qreal size() const { return width(); }
51  qreal width() const;
52  inline bool widthForced() const { return m_widthForced; }
53  inline QString prefix() const { return m_prefix; }
54  inline QString suffix() const { return m_suffix; }
55 
56 public slots:
57  void setAlignLeft( bool );
58  void setAlignCenter( bool );
59  void setAlignRight( bool );
60  void setBold( bool bold );
61  void setItalic( bool italic );
62  void setPrefix( const QString& );
63  void setSuffix( const QString& );
64  void setWidth( int width );
65  void setWidthForced( bool );
66 
67 protected:
68  virtual void fillMenu( QMenu * menu );
69  virtual void menuExecuted( const QAction* action );
70  virtual void contextMenuEvent( QContextMenuEvent * event );
71 
72 private:
73 
74  Qt::Alignment m_alignment;
75  bool m_bold;
76  bool m_italic;
77  bool m_widthForced;
78  qreal m_width;
79  QString m_prefix, m_suffix;
80 
81 };
82 
83 #endif
QWidget
TokenWithLayout::setAlignCenter
void setAlignCenter(bool)
Definition: TokenWithLayout.cpp:202
TokenWithLayout
An extended Token with controls for layouting the token and getting layout values for use outside the...
Definition: TokenWithLayout.h:38
TokenWithLayout::TokenWithLayout
TokenWithLayout(const QString &text, const QString &iconName, int value, QWidget *parent=0)
Definition: TokenWithLayout.cpp:47
TokenWithLayout::setBold
void setBold(bool bold)
Definition: TokenWithLayout.cpp:219
TokenWithLayout::width
qreal width() const
Definition: TokenWithLayout.cpp:263
Token::value
int value() const
Definition: Token.cpp:83
Qt::Alignment
typedef Alignment
TokenWithLayout::bold
bool bold() const
Definition: TokenWithLayout.cpp:214
TokenWithLayout::fillMenu
virtual void fillMenu(QMenu *menu)
Definition: TokenWithLayout.cpp:63
QContextMenuEvent
TokenWithLayout::setWidth
void setWidth(int width)
Definition: TokenWithLayout.cpp:249
TokenWithLayout::alignment
Qt::Alignment alignment()
Definition: TokenWithLayout.cpp:181
TokenWithLayoutFactory
Definition: TokenWithLayout.h:27
TokenWithLayout::setWidthForced
void setWidthForced(bool)
Definition: TokenWithLayout.cpp:258
QString
TokenWithLayout::prefix
QString prefix() const
Definition: TokenWithLayout.h:53
TokenWithLayout::widthForced
bool widthForced() const
Definition: TokenWithLayout.h:52
QMenu
TokenWithLayout::setItalic
void setItalic(bool italic)
Definition: TokenWithLayout.cpp:273
TokenWithLayout::contextMenuEvent
virtual void contextMenuEvent(QContextMenuEvent *event)
Definition: TokenWithLayout.cpp:166
TokenWithLayout::italic
bool italic() const
Definition: TokenWithLayout.cpp:268
TokenWithLayout::setAlignRight
void setAlignRight(bool)
Definition: TokenWithLayout.cpp:208
TokenWithLayoutFactory::createToken
virtual Token * createToken(const QString &text, const QString &iconName, int value, QWidget *parent=0)
Definition: TokenWithLayout.cpp:42
TokenWithLayout::~TokenWithLayout
~TokenWithLayout()
Definition: TokenWithLayout.cpp:59
QAction
TokenWithLayout::setSuffix
void setSuffix(const QString &)
Definition: TokenWithLayout.cpp:240
TokenWithLayout::menuExecuted
virtual void menuExecuted(const QAction *action)
Definition: TokenWithLayout.cpp:152
TokenWithLayout::setPrefix
void setPrefix(const QString &)
Definition: TokenWithLayout.cpp:231
TokenFactory
Definition: Token.h:29
Token
Definition: Token.h:38
QObject::parent
QObject * parent() const
TokenWithLayout::setAlignment
void setAlignment(Qt::Alignment alignment)
Definition: TokenWithLayout.cpp:186
QWidget::event
virtual bool event(QEvent *event)
Token::iconName
QString iconName() const
Definition: Token.cpp:94
TokenWithLayout::size
qreal size() const
Definition: TokenWithLayout.h:50
TokenWithLayout::suffix
QString suffix() const
Definition: TokenWithLayout.h:54
TokenWithLayout::setAlignLeft
void setAlignLeft(bool)
Definition: TokenWithLayout.cpp:196
Token.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/kopete

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

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

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