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

kleopatra

Kleo::AbstractKeyListModel

Kleo::AbstractKeyListModel Class Reference

#include <keylistmodel.h>

Inheritance diagram for Kleo::AbstractKeyListModel:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 49 of file keylistmodel.h.


Public Types

enum  Columns {
  PrettyName, PrettyEMail, ValidFrom, ValidUntil,
  TechnicalDetails, Fingerprint, NumColumns, Icon = PrettyName
}

Public Slots

QModelIndex addKey (const GpgME::Key &key)
QList< QModelIndex > addKeys (const std::vector< GpgME::Key > &keys)
void clear ()
void removeKey (const GpgME::Key &key)
void setKeys (const std::vector< GpgME::Key > &keys)

Signals

void rowAboutToBeMoved (const QModelIndex &old_parent, int old_row)
void rowMoved (const QModelIndex &new_parent, int new_row)

Public Member Functions

 AbstractKeyListModel (QObject *parent=0)
int columnCount (const QModelIndex &pidx) const
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
QVariant headerData (int section, Qt::Orientation o, int role=Qt::DisplayRole) const
QModelIndex index (const GpgME::Key &key, int col) const
QModelIndex index (const GpgME::Key &key) const
QList< QModelIndex > indexes (const std::vector< GpgME::Key > &keys) const
GpgME::Key key (const QModelIndex &idx) const
std::vector< GpgME::Key > keys (const QList< QModelIndex > &indexes) const
void setToolTipOptions (int opts)
int toolTipOptions () const
 ~AbstractKeyListModel ()

Static Public Member Functions

static AbstractKeyListModel * createFlatKeyListModel (QObject *parent=0)
static AbstractKeyListModel * createHierarchicalKeyListModel (QObject *parent=0)

Member Enumeration Documentation

enum Kleo::AbstractKeyListModel::Columns

Enumerator:
PrettyName 
PrettyEMail 
ValidFrom 
ValidUntil 
TechnicalDetails 
Fingerprint 
NumColumns 
Icon 

Definition at line 58 of file keylistmodel.h.


Constructor & Destructor Documentation

AbstractKeyListModel::AbstractKeyListModel ( QObject *  parent = 0  )  [explicit]

Definition at line 82 of file keylistmodel.cpp.

AbstractKeyListModel::~AbstractKeyListModel (  ) 

Definition at line 88 of file keylistmodel.cpp.


Member Function Documentation

QModelIndex Kleo::AbstractKeyListModel::addKey ( const GpgME::Key &  key  )  [slot]

QList<QModelIndex> Kleo::AbstractKeyListModel::addKeys ( const std::vector< GpgME::Key > &  keys  )  [slot]

void AbstractKeyListModel::clear (  )  [slot]

Definition at line 161 of file keylistmodel.cpp.

int AbstractKeyListModel::columnCount ( const QModelIndex &  pidx  )  const

Definition at line 166 of file keylistmodel.cpp.

AbstractKeyListModel * AbstractKeyListModel::createFlatKeyListModel ( QObject *  parent = 0  )  [static]

Definition at line 779 of file keylistmodel.cpp.

AbstractKeyListModel * AbstractKeyListModel::createHierarchicalKeyListModel ( QObject *  parent = 0  )  [static]

Definition at line 788 of file keylistmodel.cpp.

QVariant AbstractKeyListModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const

Definition at line 199 of file keylistmodel.cpp.

QVariant AbstractKeyListModel::headerData ( int  section,
Qt::Orientation  o,
int  role = Qt::DisplayRole 
) const

Definition at line 170 of file keylistmodel.cpp.

QModelIndex Kleo::AbstractKeyListModel::index ( const GpgME::Key &  key,
int  col 
) const

QModelIndex Kleo::AbstractKeyListModel::index ( const GpgME::Key &  key  )  const [inline, virtual]

Implements Kleo::KeyListModelInterface.

Definition at line 83 of file keylistmodel.h.

QList<QModelIndex> Kleo::AbstractKeyListModel::indexes ( const std::vector< GpgME::Key > &  keys  )  const [virtual]

Implements Kleo::KeyListModelInterface.

Key AbstractKeyListModel::key ( const QModelIndex &  idx  )  const [virtual]

Implements Kleo::KeyListModelInterface.

Definition at line 100 of file keylistmodel.cpp.

std::vector< Key > AbstractKeyListModel::keys ( const QList< QModelIndex > &  indexes  )  const [virtual]

Implements Kleo::KeyListModelInterface.

Definition at line 107 of file keylistmodel.cpp.

void Kleo::AbstractKeyListModel::removeKey ( const GpgME::Key &  key  )  [slot]

AbstractKeyListModel::rowAboutToBeMoved ( const QModelIndex &  old_parent,
int  old_row 
) [signal]

Emitted before the removal of a row from that model. It will later be added to the model again, in reponse to which rowMoved() will be emitted. If multiple rows are moved in one go, multiple rowAboutToBeMoved() signals are emitted before the corresponding number of rowMoved() signals is emitted - in reverse order.

This works around the absence of move semantics in QAbstractItemModel. Clients can maintain a stack to perform the QModelIndex-mapping themselves, or, e.g., to preserve the selection status of the row:

  std::vector<bool> mMovingRowWasSelected; // transient, used when rows are moved
  // ...
  void slotRowAboutToBeMoved( const QModelIndex & p, int row ) {
      mMovingRowWasSelected.push_back( selectionModel()->isSelected( model()->index( row, 0, p ) ) );
  }
  void slotRowMoved( const QModelIndex & p, int row ) {
      const bool wasSelected = mMovingRowWasSelected.back();
      mMovingRowWasSelected.pop_back();
      if ( wasSelected )
          selectionModel()->select( model()->index( row, 0, p ), Select|Rows );
  }

A similar mechanism could be used to preserve the current item during moves.

AbstractKeyListModel::rowMoved ( const QModelIndex &  new_parent,
int  new_parent 
) [signal]

See rowAboutToBeMoved()

void Kleo::AbstractKeyListModel::setKeys ( const std::vector< GpgME::Key > &  keys  )  [slot]

void AbstractKeyListModel::setToolTipOptions ( int  opts  ) 

Definition at line 90 of file keylistmodel.cpp.

int AbstractKeyListModel::toolTipOptions (  )  const

defines which information is displayed in tooltips see Kleo::Formatting::ToolTipOption

Definition at line 95 of file keylistmodel.cpp.


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

kleopatra

Skip menu "kleopatra"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim 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