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

kalarm

  • sources
  • kde-4.14
  • kdepim
  • kalarm
birthdaymodel.h
Go to the documentation of this file.
1 /*
2  * birthdaymodel.h - model class for birthdays from address book
3  * Program: kalarm
4  * Copyright © 2009 by Tobias Koenig <tokoe@kde.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  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef BIRTHDAYMODEL_H
22 #define BIRTHDAYMODEL_H
23 
24 #include <akonadi/contact/contactstreemodel.h>
25 
26 #include <QSortFilterProxyModel>
27 
28 namespace Akonadi
29 {
30  class ChangeRecorder;
31 }
32 
39 class BirthdayModel : public Akonadi::ContactsTreeModel
40 {
41  Q_OBJECT
42  public:
43  enum { // data columns
44  NameColumn, DateColumn,
45  ColumnCount
46  };
47 
51  ~BirthdayModel();
52 
56  static BirthdayModel* instance();
57 
58  virtual QVariant entityData(const Akonadi::Item&, int column, int role = Qt::DisplayRole) const;
59  virtual QVariant entityData(const Akonadi::Collection& collection, int column, int role = Qt::DisplayRole) const
60  { return Akonadi::ContactsTreeModel::entityData(collection, column, role); }
61 
62  private:
63  explicit BirthdayModel(Akonadi::ChangeRecorder* recorder);
64 
65  static BirthdayModel* mInstance;
66 };
67 
68 
69 class BirthdaySortModel : public QSortFilterProxyModel
70 {
71  Q_OBJECT
72  public:
73  explicit BirthdaySortModel(QObject* parent = 0);
74 
75  void setPrefixSuffix(const QString& prefix, const QString& suffix);
76 
77  protected:
78  virtual bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const;
79 
80  private:
81  QStringList mContactsWithAlarm;
82  QString mPrefix;
83  QString mSuffix;
84 };
85 
86 #endif
87 
88 // vim: et sw=4:
QModelIndex
BirthdaySortModel::setPrefixSuffix
void setPrefixSuffix(const QString &prefix, const QString &suffix)
Definition: birthdaymodel.cpp:93
BirthdayModel::entityData
virtual QVariant entityData(const Akonadi::Collection &collection, int column, int role=Qt::DisplayRole) const
Definition: birthdaymodel.h:59
BirthdayModel::DateColumn
Definition: birthdaymodel.h:44
BirthdaySortModel::BirthdaySortModel
BirthdaySortModel(QObject *parent=0)
Definition: birthdaymodel.cpp:88
BirthdaySortModel
Definition: birthdaymodel.h:69
BirthdayModel
Provides the global model for all contacts.
Definition: birthdaymodel.h:39
BirthdayModel::instance
static BirthdayModel * instance()
Returns the global contact model instance.
Definition: birthdaymodel.cpp:53
BirthdaySortModel::filterAcceptsRow
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
Definition: birthdaymodel.cpp:113
QObject
QString
BirthdayModel::entityData
virtual QVariant entityData(const Akonadi::Item &, int column, int role=Qt::DisplayRole) const
Definition: birthdaymodel.cpp:76
QStringList
QSortFilterProxyModel
BirthdayModel::NameColumn
Definition: birthdaymodel.h:44
BirthdayModel::ColumnCount
Definition: birthdaymodel.h:45
BirthdayModel::~BirthdayModel
~BirthdayModel()
Destroys the global contact model.
Definition: birthdaymodel.cpp:47
QObject::parent
QObject * parent() const
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalarm

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

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