• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

kjots

Bookshelf Class Reference

#include <bookshelf.h>

Inheritance diagram for Bookshelf:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 38 of file bookshelf.h.


Public Slots

void onHeaderClick (int)
void nextBook ()
void prevBook ()
void nextPage ()
void prevPage ()

Public Member Functions

 Bookshelf (QWidget *)
void DelayedInitialization (KActionCollection *)
void prepareForExit (void)
void jumpToId (quint64)
void jumpToEntry (QTreeWidgetItem *)
KJotsEntry * entryFromId (quint64)
KJotsEntry * currentEntry (void)
KJotsPage * currentPage (void)
KJotsBook * currentBook (void)
KJotsBook * currentTopLevelBook (void)
QList< KJotsEntry * > selected (void)
void remove (QTreeWidgetItem *)
QString currentCaption (const QString &)
Qt::DropActions supportedDropActions () const
QStringList mimeTypes () const
QMimeData * mimeData (const QList< QTreeWidgetItem * >) const
bool dropMimeData (QTreeWidgetItem *, int, const QMimeData *, Qt::DropAction)

Protected Slots

void entryRenamed (QTreeWidgetItem *, int)
void setContextMenuOptions ()
void itemWasExpanded (QTreeWidgetItem *)
void itemWasCollapsed (QTreeWidgetItem *)
void copyLinkAddress ()
void changeColor ()

Protected Member Functions

void loadBooks (void)
void sortBook (QTreeWidgetItem *)
virtual void dragEnterEvent (QDragEnterEvent *)
virtual void dragMoveEvent (QDragMoveEvent *)

Protected Attributes

KActionCollection * pageActionCollection
KActionCollection * bookActionCollection
KActionCollection * multiActionCollection
Qt::SortOrder sortOrder

Constructor & Destructor Documentation

Bookshelf::Bookshelf ( QWidget *  parent  )  [explicit]

Definition at line 48 of file bookshelf.cpp.


Member Function Documentation

void Bookshelf::DelayedInitialization ( KActionCollection *  actionCollection  ) 

Definition at line 70 of file bookshelf.cpp.

void Bookshelf::prepareForExit ( void   ) 

Runs just before KJots is closed. Save your stuff!

Definition at line 195 of file bookshelf.cpp.

void Bookshelf::jumpToId ( quint64  id  ) 

Makes the given ID the new selection in the bookshelf.

Parameters:
id The ID to select.

Definition at line 240 of file bookshelf.cpp.

void Bookshelf::jumpToEntry ( QTreeWidgetItem *  item  ) 

Makes the given entry the new selection in the bookshelf.

Parameters:
item The entry to select.

Definition at line 252 of file bookshelf.cpp.

KJotsEntry * Bookshelf::entryFromId ( quint64  id  ) 

Returns a pointer to the KJotsEntry with the given ID or 0 if none matches.

Parameters:
id The ID to look for.
Todo:
Should we optimize this by using a container?

Definition at line 221 of file bookshelf.cpp.

KJotsEntry * Bookshelf::currentEntry ( void   ) 

Returns a pointer to the currently selected page.

Definition at line 508 of file bookshelf.cpp.

KJotsPage * Bookshelf::currentPage ( void   ) 

Returns a pointer to the currently selected page.

Definition at line 522 of file bookshelf.cpp.

KJotsBook * Bookshelf::currentBook ( void   ) 

Returns a pointer to the currently selected book, or the book that owns the currently selected page.

Definition at line 538 of file bookshelf.cpp.

KJotsBook * Bookshelf::currentTopLevelBook ( void   ) 

Returns a pointer to the toplevel book that owns the currently selected book or page.

Definition at line 561 of file bookshelf.cpp.

QList< KJotsEntry * > Bookshelf::selected ( void   ) 

Return everything selected, but don't let a page of a book and a book both be in the list because then there would be duplication.

Definition at line 617 of file bookshelf.cpp.

void Bookshelf::remove ( QTreeWidgetItem *  item  ) 

Remove the given entry from the bookshelf and delete it if necessary.

Definition at line 266 of file bookshelf.cpp.

QString Bookshelf::currentCaption ( const QString &  sep  ) 

Returns a representation of the current selection.

Definition at line 641 of file bookshelf.cpp.

Qt::DropActions Bookshelf::supportedDropActions (  )  const

Indicate the drop types we handle.

Definition at line 287 of file bookshelf.cpp.

QStringList Bookshelf::mimeTypes (  )  const

Indicate the mime types we handle.

Definition at line 295 of file bookshelf.cpp.

QMimeData * Bookshelf::mimeData ( const QList< QTreeWidgetItem * >  items  )  const

Exports dropped data.

Definition at line 335 of file bookshelf.cpp.

bool Bookshelf::dropMimeData ( QTreeWidgetItem *  parent,
int  index,
const QMimeData *  data,
Qt::DropAction  action 
)

Imports dropped data.

Reimplemented from QTreeWidget.

Definition at line 363 of file bookshelf.cpp.

void Bookshelf::onHeaderClick ( int   )  [slot]

Definition at line 791 of file bookshelf.cpp.

void Bookshelf::nextBook (  )  [slot]

Moves to the next book after the current selection.

Definition at line 688 of file bookshelf.cpp.

void Bookshelf::prevBook (  )  [slot]

Moves to the previous book before the current selection.

Definition at line 711 of file bookshelf.cpp.

void Bookshelf::nextPage (  )  [slot]

Moves to the next page after the current selection.

Definition at line 741 of file bookshelf.cpp.

void Bookshelf::prevPage (  )  [slot]

Moves to the previous page before the current selection.

Definition at line 764 of file bookshelf.cpp.

void Bookshelf::loadBooks ( void   )  [protected]

Loads all the books it can find in the appdata directory.

Warning:
Needless to say: this should only ever be called once. For reasons surpassing understanding, QTreeWidgetItems do not behave well when you construct a tree without first attaching them to a QTreeWidget. Hopefully, this will be fixed in a future version of Qt. Until then, we attach the books and create them first, then remove them, then reattach them in the correct order.

Definition at line 135 of file bookshelf.cpp.

void Bookshelf::sortBook ( QTreeWidgetItem *  book  )  [protected]

Definition at line 806 of file bookshelf.cpp.

void Bookshelf::dragEnterEvent ( QDragEnterEvent *  event  )  [protected, virtual]

Definition at line 302 of file bookshelf.cpp.

void Bookshelf::dragMoveEvent ( QDragMoveEvent *  event  )  [protected, virtual]

Definition at line 313 of file bookshelf.cpp.

void Bookshelf::entryRenamed ( QTreeWidgetItem *  item,
int   
) [protected, slot]

Definition at line 461 of file bookshelf.cpp.

void Bookshelf::setContextMenuOptions (  )  [protected, slot]

Definition at line 471 of file bookshelf.cpp.

void Bookshelf::itemWasExpanded ( QTreeWidgetItem *  item  )  [protected, slot]

Called when a book is opened/expanded/whatever.

Definition at line 575 of file bookshelf.cpp.

void Bookshelf::itemWasCollapsed ( QTreeWidgetItem *  item  )  [protected, slot]

Called when a book is closed/collapsed/whatever.

Definition at line 586 of file bookshelf.cpp.

void Bookshelf::copyLinkAddress (  )  [protected, slot]

Called when selected from the context menu.

Definition at line 597 of file bookshelf.cpp.

void Bookshelf::changeColor (  )  [protected, slot]

Definition at line 667 of file bookshelf.cpp.


Member Data Documentation

KActionCollection* Bookshelf::pageActionCollection [protected]

Definition at line 80 of file bookshelf.h.

KActionCollection* Bookshelf::bookActionCollection [protected]

Definition at line 81 of file bookshelf.h.

KActionCollection* Bookshelf::multiActionCollection [protected]

Definition at line 82 of file bookshelf.h.

Qt::SortOrder Bookshelf::sortOrder [protected]

Definition at line 83 of file bookshelf.h.


The documentation for this class was generated from the following files:
  • bookshelf.h
  • bookshelf.cpp

kjots

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

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdelirc
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • kjots
  • klaptopdaemon
  • kmilo
  • ksim
  • ktimer
  • kwallet
  • superkaramba
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal