• 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.12
  • kdenetwork
  • kopete
  • kopete
  • config
  • appearance
  • layout
TokenDropTarget.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (c) 2009 Thomas Lübking <thomas.luebking@web.de> *
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 TOKENDROPTARGET_H
21 #define TOKENDROPTARGET_H
22 
23 #include <QWidget>
24 
25 class QBoxLayout;
26 class QHBoxLayout;
27 class QDropEvent;
28 class Token;
29 class TokenDragger;
30 class TokenFactory;
31 
32 class TokenDropTarget : public QWidget
33 {
34  Q_OBJECT
35 public:
36  explicit TokenDropTarget( const QString &mimeType, QWidget *parent = 0);
37 
38  QWidget *childAt( const QPoint &pos ) const;
39  void clear();
40  virtual inline int count() const { return count( -1 ); }
41  virtual int count ( int row ) const;
42  void insertToken( Token*, int row = -1, int col = -1 ); // -1 -> append to last row
43  int row ( Token* ) const;
44  int rows() const;
45  inline uint rowLimit() const { return m_limits[1]; }
46  inline void setRowLimit( uint r ) { m_limits[1] = r; }
47  void setCustomTokenFactory( TokenFactory * factory );
48  QList< Token *> drags( int row = -1 );
49 
50 // inline uint columnLimit() const { return m_limits[0]; }
51 // inline void setColumnLimit( uint c ) { m_limits[0] = c; }
52 signals:
53  void changed();
54  void focussed( QWidget* );
55 
56 protected:
57  bool eventFilter( QObject *, QEvent * );
58  QBoxLayout *rowBox( QWidget *w, QPoint *idx = 0 ) const;
59  QBoxLayout *rowBox( const QPoint &pt ) const;
60 protected:
61  friend class TokenDragger;
62  void deleteEmptyRows();
63 
64 private:
65  bool accept( QDropEvent* );
66  QHBoxLayout *appendRow();
67  void drop( Token*, const QPoint &pos = QPoint(0,0) );
68 
69 private:
70  uint m_limits[2];
71  QString m_mimeType;
72  TokenDragger *m_tokenDragger;
73  TokenFactory *m_tokenFactory;
74 };
75 
76 #endif
TokenDropTarget::clear
void clear()
Definition: TokenDropTarget.cpp:186
TokenDropTarget::setCustomTokenFactory
void setCustomTokenFactory(TokenFactory *factory)
Definition: TokenDropTarget.cpp:425
QWidget
TokenDropTarget::childAt
QWidget * childAt(const QPoint &pos) const
Definition: TokenDropTarget.cpp:174
TokenDropTarget::eventFilter
bool eventFilter(QObject *, QEvent *)
Definition: TokenDropTarget.cpp:303
TokenDropTarget
Definition: TokenDropTarget.h:32
QObject
TokenDropTarget::count
virtual int count() const
Definition: TokenDropTarget.h:40
TokenDropTarget::rowBox
QBoxLayout * rowBox(QWidget *w, QPoint *idx=0) const
Definition: TokenDropTarget.cpp:381
TokenDropTarget::TokenDragger
friend class TokenDragger
Definition: TokenDropTarget.h:61
TokenDropTarget::focussed
void focussed(QWidget *)
TokenDropTarget::deleteEmptyRows
void deleteEmptyRows()
Definition: TokenDropTarget.cpp:223
TokenDropTarget::row
int row(Token *) const
Definition: TokenDropTarget.cpp:363
TokenDropTarget::setRowLimit
void setRowLimit(uint r)
Definition: TokenDropTarget.h:46
TokenDropTarget::rows
int rows() const
Definition: TokenDropTarget.cpp:375
TokenDropTarget::TokenDropTarget
TokenDropTarget(const QString &mimeType, QWidget *parent=0)
Definition: TokenDropTarget.cpp:125
TokenDropTarget::insertToken
void insertToken(Token *, int row=-1, int col=-1)
Definition: TokenDropTarget.cpp:346
TokenFactory
Definition: Token.h:29
Token
Definition: Token.h:38
TokenDropTarget::drags
QList< Token * > drags(int row=-1)
Definition: TokenDropTarget.cpp:240
TokenDropTarget::changed
void changed()
TokenDropTarget::rowLimit
uint rowLimit() const
Definition: TokenDropTarget.h:45
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:41 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