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

knode

  • sources
  • kde-4.14
  • kdepim
  • knode
kncollectionview.cpp
Go to the documentation of this file.
1 /*
2  KNode, the KDE newsreader
3  Copyright (c) 2004-2005 Volker Krause <vkrause@kde.org>
4  Copyright (c) 2009 Olivier Trichet <nive@nivalis.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  You should have received a copy of the GNU General Public License
11  along with this program; if not, write to the Free Software Foundation,
12  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
13 */
14 
15 #include "kncollectionview.h"
16 
17 #include "knglobals.h"
18 #include "knconfig.h"
19 #include "knnntpaccount.h"
20 #include "knaccountmanager.h"
21 #include "kngroup.h"
22 #include "kngroupmanager.h"
23 #include "knfolder.h"
24 #include "knfoldermanager.h"
25 #include "kncollectionviewitem.h"
26 #include "settings.h"
27 
28 #include <kiconloader.h>
29 #include <klocale.h>
30 
31 #include <QDropEvent>
32 #include <QPainter>
33 
34 
35 
36 KNCollectionView::KNCollectionView( QWidget *parent ) :
37  FolderTreeWidget( parent ),
38  mActiveItem( 0 ),
39  mDragTargetItem( 0 )
40 {
41  setDragEnabled(true);
42  setDropIndicatorShown( false ); // We draw our own (see paintEvent)
43 
44  // add unread and total columns if necessary
45  loadLayout();
46 
47  readConfig();
48 
49  // load accounts and folders
50  reloadAccounts();
51  reloadFolders();
52 
53  // connect to the account manager
54  KNAccountManager* am = knGlobals.accountManager();
55  connect( am, SIGNAL(accountAdded(KNNntpAccount::Ptr)), SLOT(addAccount(KNNntpAccount::Ptr)) );
56  connect( am, SIGNAL(accountRemoved(KNNntpAccount::Ptr)), SLOT(removeAccount(KNNntpAccount::Ptr)) );
57  connect( am, SIGNAL(accountModified(KNNntpAccount::Ptr)), SLOT(updateAccount(KNNntpAccount::Ptr)) );
58 
59  // connect to the group manager
60  KNGroupManager* gm = knGlobals.groupManager();
61  connect( gm, SIGNAL(groupAdded(KNGroup::Ptr)), SLOT(addGroup(KNGroup::Ptr)) );
62  connect( gm, SIGNAL(groupRemoved(KNGroup::Ptr)), SLOT(removeGroup(KNGroup::Ptr)) );
63  connect( gm, SIGNAL(groupUpdated(KNGroup::Ptr)), SLOT(updateGroup(KNGroup::Ptr)) );
64 
65  // connect to the folder manager
66  KNFolderManager* fm = knGlobals.folderManager();
67  connect( fm, SIGNAL(folderAdded(KNFolder::Ptr)), SLOT(addPendingFolders()) );
68  connect( fm, SIGNAL(folderRemoved(KNFolder::Ptr)), SLOT(removeFolder(KNFolder::Ptr)) );
69  connect( fm, SIGNAL(folderActivated(KNFolder::Ptr)), SLOT(activateFolder(KNFolder::Ptr)) );
70 
71  // Edition of label
72  setEditTriggers( QAbstractItemView::NoEditTriggers );
73 }
74 
75 
76 KNCollectionView::~KNCollectionView()
77 {
78  writeConfig();
79 }
80 
81 
82 void KNCollectionView::loadLayout()
83 {
84  addLabelColumn( i18n("Name") );
85  addUnreadColumn( i18n("Unread") );
86  addTotalColumn( i18n("Total") );
87 
88  restoreLayout( knGlobals.config(), "GroupView" );
89 
90  if ( sortColumn() == -1 ) {
91  sortByColumn( labelColumnIndex(), Qt::AscendingOrder );
92  }
93 }
94 
95 void KNCollectionView::readConfig()
96 {
97  // font
98  setFont( knGlobals.settings()->groupListFont() );
99 }
100 
101 
102 void KNCollectionView::writeConfig()
103 {
104  saveLayout( knGlobals.config(), "GroupView" );
105 }
106 
107 
108 
109 void KNCollectionView::addAccount( KNNntpAccount::Ptr a )
110 {
111  // add account item
112  KNCollectionViewItem* item = new KNCollectionViewItem( this, FolderTreeWidgetItem::News );
113  a->setListItem( item );
114  item->setExpanded( a->wasOpen() );
115 
116  // add groups for this account
117  KNGroup::List groups = knGlobals.groupManager()->groupsOfAccount( a );
118  for ( KNGroup::List::Iterator it = groups.begin(); it != groups.end(); ++it ) {
119  KNCollectionViewItem *gitem = new KNCollectionViewItem( item, FolderTreeWidgetItem::News );
120  (*it)->setListItem( gitem );
121  (*it)->updateListItem();
122  }
123 }
124 
125 
126 void KNCollectionView::removeAccount( KNNntpAccount::Ptr a )
127 {
128  if(!a->listItem())
129  return;
130  KNCollectionViewItem *child = 0;
131  KNCollectionViewItem *aitem = a->listItem();
132  while ( ( child = static_cast<KNCollectionViewItem*>( aitem->takeChild( 0 ) ) ) ) {
133  removeGroup( boost::static_pointer_cast<KNGroup>( child->collection() ) );
134  }
135 
136  delete aitem;
137  a->setListItem(0);
138 }
139 
140 
141 void KNCollectionView::updateAccount( KNNntpAccount::Ptr a )
142 {
143  a->updateListItem();
144 }
145 
146 
147 void KNCollectionView::reloadAccounts()
148 {
149  KNNntpAccount::List list = knGlobals.accountManager()->accounts();
150  for ( KNNntpAccount::List::Iterator it = list.begin(); it != list.end(); ++it ) {
151  removeAccount( *it );
152  addAccount( *it );
153  }
154 }
155 
156 
157 
158 void KNCollectionView::addGroup( KNGroup::Ptr g )
159 {
160  if (!g->account()->listItem())
161  return;
162 
163  KNCollectionViewItem *gitem =
164  new KNCollectionViewItem( g->account()->listItem(), FolderTreeWidgetItem::News );
165  g->setListItem(gitem);
166  updateGroup(g);
167 }
168 
169 
170 void KNCollectionView::removeGroup( KNGroup::Ptr g )
171 {
172  if (!g->listItem())
173  return;
174 
175  KNCollectionViewItem *item = g->listItem();
176  item->setDisabled(true);
177  item->setHidden( true ); // work around bug 248256
178  g->setListItem(0);
179  updateGroup(g);
180  // after deactivating, hiding the item, removing it from the group and updating the group,
181  // we let Qt process any events that may be pending because of those actions or because
182  // the context menu was used to unsubscribe from this group. We do it here rather than
183  // leaving them for later in KNMainWidget::secureProcessEvents(), when events concerning
184  // the group item would be sent to it after it was deleted. Occurs on Mac OS X.
185  qApp->processEvents();
186  // now it should be safe to delete item.
187  delete item;
188 }
189 
190 
191 void KNCollectionView::updateGroup( KNGroup::Ptr g )
192 {
193  g->updateListItem();
194 }
195 
196 
197 
198 void KNCollectionView::addFolder( KNFolder::Ptr f )
199 {
200  KNCollectionViewItem *it;
201 
202  if (!f->parent()) {
203  // root folder
204  it = new KNCollectionViewItem(this, FolderTreeWidgetItem::Local);
205  } else {
206  // make sure the parent folder has already been added
207  if (!f->parent()->listItem())
208  addFolder( boost::static_pointer_cast<KNFolder>( f->parent() ) );
209  // handle special folders
210  FolderTreeWidgetItem::FolderType type = FolderTreeWidgetItem::Other;
211  switch ( f->id() ) {
212  case 1:
213  type = FolderTreeWidgetItem::Drafts; break;
214  case 2:
215  type = FolderTreeWidgetItem::Outbox; break;
216  case 3:
217  type = FolderTreeWidgetItem::SentMail; break;
218  }
219  it = new KNCollectionViewItem( f->parent()->listItem(), FolderTreeWidgetItem::Local, type );
220  }
221  f->setListItem( it );
222  updateFolder( f );
223 }
224 
225 
226 void KNCollectionView::removeFolder( KNFolder::Ptr f)
227 {
228  if(!f->listItem())
229  return;
230  KNCollectionViewItem *child = 0;
231  KNCollectionViewItem *it = f->listItem();
232  while ( ( child = static_cast<KNCollectionViewItem*>( it->takeChild( 0 ) ) ) ) {
233  removeFolder( boost::static_pointer_cast<KNFolder>( child->collection() ) );
234  }
235 
236  f->listItem()->setHidden( true ); // work around bug 248256
237  delete f->listItem();
238  f->setListItem(0);
239 }
240 
241 
242 void KNCollectionView::reloadFolders()
243 {
244  // remove existing folder items
245  removeFolder(knGlobals.folderManager()->root());
246 
247  // add folder items
248  addPendingFolders();
249 }
250 
251 
252 void KNCollectionView::addPendingFolders()
253 {
254  KNFolder::List folders = knGlobals.folderManager()->folders();
255  for ( KNFolder::List::Iterator it = folders.begin(); it != folders.end(); ++it )
256  if ( !(*it)->listItem() )
257  addFolder( (*it) );
258  // now open the folders if they were open in the last session
259  for ( KNFolder::List::Iterator it = folders.begin(); it != folders.end(); ++it ) {
260  if ( (*it)->listItem()) {
261  (*it)->listItem()->setExpanded( (*it)->wasOpen() );
262  }
263  }
264 }
265 
266 
267 void KNCollectionView::activateFolder( KNFolder::Ptr f )
268 {
269  if(f->listItem())
270  setActive( f->listItem() );
271 }
272 
273 
274 void KNCollectionView::updateFolder( KNFolder::Ptr f )
275 {
276  f->updateListItem();
277 }
278 
279 
280 void KNCollectionView::reload()
281 {
282  reloadAccounts();
283  reloadFolders();
284 }
285 
286 void KNCollectionView::setActive( QTreeWidgetItem *i )
287 {
288  if (!i || mActiveItem == i)
289  return;
290 
291  i->setSelected( true );
292  setCurrentItem( i );
293  mActiveItem = i;
294 }
295 
296 
297 void KNCollectionView::nextGroup()
298 {
299  incCurrentFolder();
300  setActive( currentItem() );
301 }
302 
303 
304 void KNCollectionView::prevGroup()
305 {
306  decCurrentFolder();
307  setActive( currentItem() );
308 }
309 
310 
311 void KNCollectionView::decCurrentFolder()
312 {
313  QTreeWidgetItemIterator it( currentItem() );
314  --it;
315  FolderTreeWidgetItem* fti = static_cast<FolderTreeWidgetItem*>( *it );
316  if (fti) {
317  setFocus();
318  setCurrentItem( fti );
319  }
320 }
321 
322 
323 void KNCollectionView::incCurrentFolder()
324 {
325  QTreeWidgetItemIterator it( currentItem() );
326  ++it;
327  FolderTreeWidgetItem* fti = static_cast<FolderTreeWidgetItem*>( *it );
328  if (fti) {
329  setFocus();
330  setCurrentItem( fti );
331  }
332 }
333 
334 
335 void KNCollectionView::selectCurrentFolder()
336 {
337  FolderTreeWidgetItem* fti = static_cast<FolderTreeWidgetItem*>( currentItem() );
338  if (fti) {
339  setActive( fti );
340  }
341 }
342 
343 void KNCollectionView::contextMenuEvent( QContextMenuEvent *event )
344 {
345  QTreeWidgetItem *item = itemAt( event->pos() );
346  if(item) {
347  emit contextMenu( item, event->globalPos() );
348  }
349 }
350 
351 
352 
353 void KNCollectionView::paintEvent( QPaintEvent *event )
354 {
355  FolderTreeWidget::paintEvent( event );
356 
357  if ( mDragTargetItem ) {
358  QRect rect = visualItemRect( mDragTargetItem );
359  if ( rect.isValid() ) {
360  QPainter p( viewport() );
361  QBrush brush = KColorScheme( QPalette::Active, KColorScheme::Selection ).decoration( KColorScheme::HoverColor ).color();
362  p.setPen( QPen( brush, 2 ) );
363  p.drawRect( rect );
364  }
365  }
366 }
367 
368 
369 void KNCollectionView::dragEnterEvent( QDragEnterEvent *event )
370 {
371  if ( event->mimeData() && event->mimeData()->hasFormat( "x-knode-drag/folder" ) ) {
372  event->accept();
373  } else {
374  event->ignore();
375  }
376 }
377 
378 void KNCollectionView::dragLeaveEvent( QDragLeaveEvent *event )
379 {
380  FolderTreeWidget::dragLeaveEvent( event );
381 
382  mDragTargetItem = 0;
383  viewport()->update(); // repaint
384 }
385 
386 void KNCollectionView::dragMoveEvent( QDragMoveEvent *event )
387 {
388  // Needed for auto-scrolling
389  FolderTreeWidget::dragMoveEvent( event );
390 
391  handleDragNDropEvent( event, false );
392 }
393 
394 void KNCollectionView::dropEvent( QDropEvent *event )
395 {
396  handleDragNDropEvent( event, true );
397 
398  mDragTargetItem = 0;
399  viewport()->update(); // repaint
400 }
401 
402 void KNCollectionView::handleDragNDropEvent( QDropEvent *event, bool enforceDrop )
403 {
404  QTreeWidgetItem *item = itemAt( event->pos() );
405  KNCollectionViewItem *fti = static_cast<KNCollectionViewItem*>( item );
406  bool accepted = false;
407  if ( fti && fti->collection() && fti->collection()->type()==KNCollection::CTfolder ) {
408  const QMimeData *md = event->mimeData();
409  if( md && md->hasFormat( "x-knode-drag/folder" ) ) {
410  KNFolder::Ptr dest = boost::static_pointer_cast<KNFolder>( fti->collection() );
411  KNFolderManager *folderManager = KNGlobals::self()->folderManager();
412  if ( !enforceDrop ) {
413  // Notify that the move is possible.
414  accepted = folderManager->canMoveFolder( folderManager->currentFolder(), dest );
415  } else {
416  // Informs whether the move succeeded.
417  accepted = folderManager->moveFolder( folderManager->currentFolder(), dest );
418  }
419  }
420  /* TODO: redo drag and drop of articles.
421  else if ( md && md->hasFormat( "message/news" ) ) {
422  if ( !static_cast<KNFolder*>( fti->collection() )->isRootFolder() ) { // don't drop articles on the root folder
423  if ( !enforceDrop ) {
424  accepted = true;
425  } else if(f_olManager->currentFolder()) {
426  if (e->dropAction() == Qt::MoveAction) {
427  KNLocalArticle::List l;
428  getSelectedArticles(l);
429  a_rtManager->moveIntoFolder(l, dest);
430  accepted = true;
431  } else {
432  KNArticle::List l;
433  getSelectedArticles(l);
434  a_rtManager->copyIntoFolder(l, dest);
435  accepted = true;
436  }
437  }
438  else if(g_rpManager->currentGroup()) {
439  KNArticle::List l;
440  getSelectedArticles(l);
441  a_rtManager->copyIntoFolder(l, dest);
442  accepted = true;
443  }
444  }
445  }
446  */
447  }
448 
449  // Trigger an update of the target item (drawing of target's borders)
450  bool repaintTarget = ( mDragTargetItem == item ) /* target changes */
451  || ( !accepted && mDragTargetItem ); /* just entered an invalid target */
452  mDragTargetItem = accepted ? item : 0;
453  if ( repaintTarget ) {
454  viewport()->update();
455  }
456 
457  event->setAccepted( accepted );
458 }
459 
460 QStringList KNCollectionView::mimeTypes() const
461 {
462  QStringList l;
463  l << "x-knode-drag/folder";
464  return l;
465 }
466 
467 void KNCollectionView::startDrag( Qt::DropActions supportedActions )
468 {
469  Q_UNUSED( supportedActions );
470 
471  KNCollectionViewItem *item = static_cast<KNCollectionViewItem*>( currentItem() );
472  // Only folders can be dragged
473  if ( !item || !item->collection() || item->collection()->type()!=KNCollection::CTfolder ) {
474  return;
475  }
476 
477  KNFolder::Ptr folder = boost::static_pointer_cast<KNFolder>( item->collection() );
478 
479  // Cannot drag special folders
480  if ( folder->isRootFolder() || folder->isStandardFolder() ) {
481  return;
482  }
483 
484  QMimeData *mimeData = new QMimeData();
485  const QByteArray id( QString::number( folder->id() ).toLatin1() );
486  mimeData->setData( "x-knode-drag/folder", id );
487 
488  QDrag *drag = new QDrag( this );
489  drag->setMimeData( mimeData );
490  drag->setPixmap( SmallIcon( "folder" ) );
491 
492  drag->exec( Qt::MoveAction );
493 }
494 
495 
QObject::child
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
KNCollectionView::selectCurrentFolder
void selectCurrentFolder()
Definition: kncollectionview.cpp:335
KNCollectionView::removeAccount
void removeAccount(KNNntpAccount::Ptr a)
Definition: kncollectionview.cpp:126
QWidget
QTreeWidget::sortColumn
int sortColumn() const
QDropEvent::mimeData
const QMimeData * mimeData() const
KPIM::FolderTreeWidget::addTotalColumn
int addTotalColumn(const QString &headerLabel)
Adds a special "Total" column to this view and returns its logical index.
Definition: foldertreewidget.cpp:261
KNCollectionView::contextMenu
void contextMenu(QTreeWidgetItem *item, const QPoint &position)
This signal is emitted when a context menu should be displayed for item as global position position...
KNCollectionView::addAccount
void addAccount(KNNntpAccount::Ptr a)
Definition: kncollectionview.cpp:109
KNCollectionView::dropEvent
virtual void dropEvent(QDropEvent *event)
Handles actual droping of articles or folder.
Definition: kncollectionview.cpp:394
QDrag::setMimeData
void setMimeData(QMimeData *data)
QByteArray
KPIM::FolderTreeWidgetItem
A folder tree node to be used with FolderTreeWidget.
Definition: foldertreewidget.h:225
KPIM::FolderTreeWidget
A tree widget useful for displaying a tree of folders containing messages.
Definition: foldertreewidget.h:73
KNCollectionView::addPendingFolders
void addPendingFolders()
Definition: kncollectionview.cpp:252
knfolder.h
QDragMoveEvent
KNCollectionView::reload
void reload()
Definition: kncollectionview.cpp:280
KNCollectionView::paintEvent
virtual void paintEvent(QPaintEvent *event)
Definition: kncollectionview.cpp:353
QMimeData::hasFormat
virtual bool hasFormat(const QString &mimeType) const
QDrag::setPixmap
void setPixmap(const QPixmap &pixmap)
QTreeWidgetItemIterator
QDropEvent::pos
const QPoint & pos() const
knaccountmanager.h
QAbstractScrollArea::viewport
QWidget * viewport() const
QBrush
KNGlobals::self
static KNGlobals * self()
Return the KNGlobals instance.
Definition: knglobals.cpp:72
QTreeView::sortByColumn
void sortByColumn(int column, Qt::SortOrder order)
kngroupmanager.h
QContextMenuEvent::globalPos
const QPoint & globalPos() const
KNFolder::Ptr
boost::shared_ptr< KNFolder > Ptr
Shared pointer to a KNFolder.
Definition: knfolder.h:38
kngroup.h
KNNntpAccount::Ptr
boost::shared_ptr< KNNntpAccount > Ptr
Shared pointer to a KNNntpAccount.
Definition: knnntpaccount.h:62
QMimeData
KPIM::FolderTreeWidget::addUnreadColumn
int addUnreadColumn(const QString &headerLabel)
Adds a special "Unread" column to this view and returns its logical index.
Definition: foldertreewidget.cpp:275
QWidget::update
void update()
KNCollectionView::decCurrentFolder
void decCurrentFolder()
Definition: kncollectionview.cpp:311
knnntpaccount.h
KNCollectionViewItem::collection
KNCollection::Ptr collection() const
Returns the collection this item represents.
Definition: kncollectionviewitem.h:46
QBrush::color
const QColor & color() const
QDrag::exec
Qt::DropAction exec(QFlags< Qt::DropAction > supportedActions)
QPainter::drawRect
void drawRect(const QRectF &rectangle)
QRect
KNCollectionView::reloadAccounts
void reloadAccounts()
Definition: kncollectionview.cpp:147
QString::number
QString number(int n, int base)
KPIM::FolderTreeWidgetItem::FolderType
FolderType
Folder type information Please note that this list should be kept in the order of items that one want...
Definition: foldertreewidget.h:245
QContextMenuEvent
QPainter::setPen
void setPen(const QColor &color)
QWidget::setFocus
void setFocus()
KNCollectionView::dragLeaveEvent
virtual void dragLeaveEvent(QDragLeaveEvent *event)
Reimplemented to hide the drop indicator when the drag leave the view.
Definition: kncollectionview.cpp:378
QDropEvent
KPIM::TreeWidget::restoreLayout
bool restoreLayout(KConfigGroup &group, const QString &keyName=QString())
Attempts to restore the layout of this tree from the specified key of the specified KConfigGroup...
Definition: treewidget.cpp:91
QPainter
QTreeWidget::mimeData
virtual QMimeData * mimeData(const QList< QTreeWidgetItem * > items) const
KNCollectionView::removeGroup
void removeGroup(KNGroup::Ptr g)
Definition: kncollectionview.cpp:170
QDrag
QTreeWidget::itemAt
QTreeWidgetItem * itemAt(const QPoint &p) const
QAbstractItemView::setEditTriggers
void setEditTriggers(QFlags< QAbstractItemView::EditTrigger > triggers)
QList::Iterator
typedef Iterator
kncollectionview.h
KNCollectionView::dragEnterEvent
virtual void dragEnterEvent(QDragEnterEvent *event)
Reimplement to only accept MIME types which are accepted in dropEvent.
Definition: kncollectionview.cpp:369
QTreeWidget::currentItem
QTreeWidgetItem * currentItem() const
QList
KNCollectionView::setActive
void setActive(QTreeWidgetItem *item)
Selects item and set it the current item.
Definition: kncollectionview.cpp:286
kncollectionviewitem.h
KNFolderManager
Folder manager.
Definition: knfoldermanager.h:28
KNCollectionView::startDrag
virtual void startDrag(Qt::DropActions supportedActions)
Reimplemented to perform the actual drag operations of folders.
Definition: kncollectionview.cpp:467
KNCollectionView::handleDragNDropEvent
void handleDragNDropEvent(QDropEvent *event, bool enforceDrop)
Called by dragMoveEvent() and dropEvent().
Definition: kncollectionview.cpp:402
KPIM::TreeWidget::saveLayout
bool saveLayout(KConfigGroup &group, const QString &keyName=QString()) const
Stores the layout of this tree view to the specified KConfigGroup.
Definition: treewidget.cpp:72
QStringList
QWidget::rect
QRect rect() const
KNCollectionView::~KNCollectionView
~KNCollectionView()
Definition: kncollectionview.cpp:76
QTreeWidgetItem::setHidden
void setHidden(bool hide)
QList::end
iterator end()
KNCollectionView::dragMoveEvent
virtual void dragMoveEvent(QDragMoveEvent *event)
Reimplemented to accept the event only when the target folder can be dropped articles or folders...
Definition: kncollectionview.cpp:386
QWidget::setFont
void setFont(const QFont &)
QRect::isValid
bool isValid() const
QDragLeaveEvent
KNCollectionView::addFolder
void addFolder(KNFolder::Ptr f)
Definition: kncollectionview.cpp:198
KNCollectionView::incCurrentFolder
void incCurrentFolder()
Definition: kncollectionview.cpp:323
KNFolderManager::canMoveFolder
bool canMoveFolder(KNFolder::Ptr f, KNFolder::Ptr p)
Returns true if the folder f can be moved under a new parent p.
Definition: knfoldermanager.cpp:199
knglobals.h
QTreeWidget::setCurrentItem
void setCurrentItem(QTreeWidgetItem *item)
KNCollectionView::prevGroup
void prevGroup()
Definition: kncollectionview.cpp:304
KNCollectionView::activateFolder
void activateFolder(KNFolder::Ptr f)
Definition: kncollectionview.cpp:267
KNCollectionView::reloadFolders
void reloadFolders()
Definition: kncollectionview.cpp:242
QTreeWidgetItem::setExpanded
void setExpanded(bool expand)
QContextMenuEvent::pos
const QPoint & pos() const
KNCollectionView::readConfig
void readConfig()
Definition: kncollectionview.cpp:95
knfoldermanager.h
QDragEnterEvent
settings.h
QTreeWidgetItem
QTreeWidget::visualItemRect
QRect visualItemRect(const QTreeWidgetItem *item) const
QTreeWidgetItem::setDisabled
void setDisabled(bool disabled)
Qt::DropActions
typedef DropActions
KNCollectionView::updateGroup
void updateGroup(KNGroup::Ptr g)
Definition: kncollectionview.cpp:191
QTreeWidgetItem::setSelected
void setSelected(bool select)
KNCollectionView::updateAccount
void updateAccount(KNNntpAccount::Ptr a)
Definition: kncollectionview.cpp:141
KNCollection::CTfolder
Definition: kncollection.h:36
QPen
KNCollectionView::contextMenuEvent
virtual void contextMenuEvent(QContextMenuEvent *event)
Emits the signal contextMenu() to display a context menu on items of the view.
Definition: kncollectionview.cpp:343
KNFolder
Representation of a folder.
Definition: knfolder.h:30
KNGlobals::folderManager
KNFolderManager * folderManager()
Returns the folder manager.
Definition: knglobals.cpp:146
KNCollectionView::mimeTypes
virtual QStringList mimeTypes() const
Returns the "x-knode-drag/folder" mime-type for drag&droping of folders within this view...
Definition: kncollectionview.cpp:460
knconfig.h
QMimeData::setData
void setData(const QString &mimeType, const QByteArray &data)
KNAccountManager
Account manager.
Definition: knaccountmanager.h:33
KNCollectionView::KNCollectionView
KNCollectionView(QWidget *parent)
Definition: kncollectionview.cpp:36
QPaintEvent
KNCollectionView::writeConfig
void writeConfig()
Definition: kncollectionview.cpp:102
KNCollectionViewItem
Folder tree item.
Definition: kncollectionviewitem.h:25
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
knGlobals
#define knGlobals
Keep compatibility with the old way.
Definition: knglobals.h:28
KPIM::FolderTreeWidget::labelColumnIndex
int labelColumnIndex() const
Returns the logical index of the "Label" column or -1 if such a column has not been added (yet)...
Definition: foldertreewidget.h:108
KNGroupManager
Group manager.
Definition: kngroupmanager.h:83
KNCollectionView::removeFolder
void removeFolder(KNFolder::Ptr f)
Definition: kncollectionview.cpp:226
QList::begin
iterator begin()
KNCollectionView::nextGroup
void nextGroup()
Definition: kncollectionview.cpp:297
QAbstractItemView::setDropIndicatorShown
void setDropIndicatorShown(bool enable)
KNCollectionView::addGroup
void addGroup(KNGroup::Ptr g)
Definition: kncollectionview.cpp:158
QAbstractItemView::setDragEnabled
void setDragEnabled(bool enable)
KNGroup::Ptr
boost::shared_ptr< KNGroup > Ptr
Shared pointer to a KNGroup.
Definition: kngroup.h:47
QTreeWidgetItem::takeChild
QTreeWidgetItem * takeChild(int index)
KNCollectionView::updateFolder
void updateFolder(KNFolder::Ptr f)
Definition: kncollectionview.cpp:274
KPIM::FolderTreeWidget::addLabelColumn
int addLabelColumn(const QString &headerLabel)
Adds a special "Label" column to this view and returns its logical index.
Definition: foldertreewidget.cpp:244
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

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