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

kalarm

  • sources
  • kde-4.12
  • 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  class Session;
32 }
33 
40 class BirthdayModel : public Akonadi::ContactsTreeModel
41 {
42  Q_OBJECT
43  public:
44  enum { // data columns
45  NameColumn, DateColumn,
46  ColumnCount
47  };
48 
52  ~BirthdayModel();
53 
57  static BirthdayModel* instance();
58 
59  virtual QVariant entityData(const Akonadi::Item&, int column, int role = Qt::DisplayRole) const;
60  virtual QVariant entityData(const Akonadi::Collection& collection, int column, int role = Qt::DisplayRole) const
61  { return Akonadi::ContactsTreeModel::entityData(collection, column, role); }
62 
63  private:
64  explicit BirthdayModel(Akonadi::ChangeRecorder* recorder);
65 
66  static BirthdayModel* mInstance;
67 };
68 
69 
70 class BirthdaySortModel : public QSortFilterProxyModel
71 {
72  Q_OBJECT
73  public:
74  explicit BirthdaySortModel(QObject* parent = 0);
75 
76  void setPrefixSuffix(const QString& prefix, const QString& suffix);
77 
78  protected:
79  virtual bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const;
80 
81  private:
82  QStringList mContactsWithAlarm;
83  QString mPrefix;
84  QString mSuffix;
85 };
86 
87 #endif
88 
89 // vim: et sw=4:
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:60
BirthdayModel::DateColumn
Definition: birthdaymodel.h:45
BirthdaySortModel::BirthdaySortModel
BirthdaySortModel(QObject *parent=0)
Definition: birthdaymodel.cpp:88
BirthdaySortModel
Definition: birthdaymodel.h:70
QObject
BirthdayModel
Provides the global model for all contacts.
Definition: birthdaymodel.h:40
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
BirthdayModel::entityData
virtual QVariant entityData(const Akonadi::Item &, int column, int role=Qt::DisplayRole) const
Definition: birthdaymodel.cpp:76
QSortFilterProxyModel
BirthdayModel::NameColumn
Definition: birthdaymodel.h:45
BirthdayModel::ColumnCount
Definition: birthdaymodel.h:46
BirthdayModel::~BirthdayModel
~BirthdayModel()
Destroys the global contact model.
Definition: birthdaymodel.cpp:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:10 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

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