• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
kiconview.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Torben Weis <weis@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 #ifndef KICONVIEW_H
19 #define KICONVIEW_H
20 
21 #include <tqcursor.h>
22 #include <tqiconview.h>
23 
24 #include <tdelibs_export.h>
25 
42 class TDEUI_EXPORT TDEIconView : public TQIconView
43 {
44  friend class TDEIconViewItem;
45  Q_OBJECT
46  TQ_ENUMS( Mode )
47  TQ_PROPERTY( Mode mode READ mode WRITE setMode )
48 
49 public:
50  TDEIconView( TQWidget *parent = 0, const char *name = 0, WFlags f = 0 );
51 
52  ~TDEIconView();
53 
62  enum Mode { Execute, Select };
63 
73  void setMode( Mode m );
74 
78  Mode mode() const;
79 
83  virtual void setFont( const TQFont & );
84 
92  void setIconTextHeight( int n );
93 
98  int iconTextHeight() const;
99 
103  virtual void takeItem( TQIconViewItem * item );
104 
105 signals:
106 
116  void executed( TQIconViewItem *item );
117 
128  void executed( TQIconViewItem *item, const TQPoint &pos );
129 
138  void held( TQIconViewItem *item );
139 
153  void doubleClicked( TQIconViewItem *item, const TQPoint &pos );
154 
155 protected slots:
156  void slotOnItem( TQIconViewItem *item );
157  void slotOnViewport();
158  void slotSettingsChanged(int);
159 
163  void slotAutoSelect();
164 
165 protected:
166  void emitExecute( TQIconViewItem *item, const TQPoint &pos );
167  void updateDragHoldItem( TQDropEvent *e );
168 
169  virtual void focusOutEvent( TQFocusEvent *fe );
170  virtual void leaveEvent( TQEvent *e );
171  virtual void contentsMousePressEvent( TQMouseEvent *e );
172  virtual void contentsMouseDoubleClickEvent ( TQMouseEvent * e );
173  virtual void contentsMouseReleaseEvent( TQMouseEvent *e );
174  virtual void contentsDragEnterEvent( TQDragEnterEvent *e );
175  virtual void contentsDragLeaveEvent( TQDragLeaveEvent *e );
176  virtual void contentsDragMoveEvent( TQDragMoveEvent *e );
177  virtual void contentsDropEvent( TQDropEvent* e );
178  virtual void wheelEvent( TQWheelEvent *e );
179 
186  void cancelPendingHeldSignal();
187 
188 private slots:
189  void slotMouseButtonClicked( int btn, TQIconViewItem *item, const TQPoint &pos );
190  void slotDragHoldTimeout();
191 
192 private:
196  TQFontMetrics *itemFontMetrics() const;
200  TQPixmap selectedIconPixmap( TQPixmap *pix, const TQColor &col ) const;
201 
202  bool m_bUseSingle;
203  bool m_bChangeCursorOverItem;
204 
205  TQIconViewItem* m_pCurrentItem;
206 
207  TQTimer* m_pAutoSelect;
208  int m_autoSelectDelay;
209 
210 protected:
211  virtual void virtual_hook( int id, void* data );
212 private:
213  class TDEIconViewPrivate;
214  TDEIconViewPrivate *d;
215 };
216 
217 class KWordWrap;
226 class TDEUI_EXPORT TDEIconViewItem : public TQIconViewItem
227 {
228 public:
229  // Need to redefine all the constructors - I want Java !
230  TDEIconViewItem( TQIconView *parent )
231  : TQIconViewItem( parent ) { init(); } // We need to call it because the parent ctor won't call our reimplementation :(((
232  TDEIconViewItem( TQIconView *parent, TQIconViewItem *after )
233  : TQIconViewItem( parent, after ) { init(); }
234  TDEIconViewItem( TQIconView *parent, const TQString &text )
235  : TQIconViewItem( parent, text ) { init(); }
236  TDEIconViewItem( TQIconView *parent, TQIconViewItem *after, const TQString &text )
237  : TQIconViewItem( parent, after, text ) { init(); }
238  TDEIconViewItem( TQIconView *parent, const TQString &text, const TQPixmap &icon )
239  : TQIconViewItem( parent, text, icon ) { init(); }
240  TDEIconViewItem( TQIconView *parent, TQIconViewItem *after, const TQString &text, const TQPixmap &icon )
241  : TQIconViewItem( parent, after, text, icon ) { init(); }
242  TDEIconViewItem( TQIconView *parent, const TQString &text, const TQPicture &picture )
243  : TQIconViewItem( parent, text, picture ) { init(); }
244  TDEIconViewItem( TQIconView *parent, TQIconViewItem *after, const TQString &text, const TQPicture &picture )
245  : TQIconViewItem( parent, after, text, picture ) { init(); }
246  virtual ~TDEIconViewItem();
247 
259  void setPixmapSize( const TQSize& size );
260 
265  TQSize pixmapSize() const;
266 
267 protected:
268  void init();
269  virtual void calcRect( const TQString& text_ = TQString::null );
270  virtual void paintItem( TQPainter *p, const TQColorGroup &c );
271  KWordWrap *wordWrap();
272  void paintPixmap( TQPainter *p, const TQColorGroup &c );
273  void paintText( TQPainter *p, const TQColorGroup &c );
274 
275 private:
276  KWordWrap* m_wordWrap;
277  struct TDEIconViewItemPrivate;
278  TDEIconViewItemPrivate *d;
279 };
280 
281 #endif
TDEIconView
A variant of TQIconView that honors KDE's system-wide settings.
Definition: kiconview.h:42
TDEIconView::Mode
Mode
TDEIconView has two different operating modes.
Definition: kiconview.h:62
KWordWrap
Word-wrap algorithm that takes into account beautifulness ;)
Definition: kwordwrap.h:48
TDEIconViewItem
A variant of TQIconViewItem that wraps words better.
Definition: kiconview.h:226

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.8
This website is maintained by Timothy Pearson.