~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to kde/src/klib/akonadicontactcollectionmodel.h

  • Committer: Package Import Robot
  • Author(s): Francois Marier, Francois Marier, Mark Purcell
  • Date: 2014-10-18 15:08:50 UTC
  • mfrom: (1.1.12)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20141018150850-2exfk34ckb15pcwi
Tags: 1.4.1-0.1
[ Francois Marier ]
* Non-maintainer upload
* New upstream release (closes: #759576, #741130)
  - debian/rules +PJPROJECT_VERSION := 2.2.1
  - add upstream patch to fix broken TLS support
  - add patch to fix pjproject regression

[ Mark Purcell ]
* Build-Depends:
  - sflphone-daemon + libavformat-dev, libavcodec-dev, libswscale-dev,
  libavdevice-dev, libavutil-dev
  - sflphone-gnome + libclutter-gtk-1.0-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
 *   Copyright (C) 2014 by Savoir-Faire Linux                               *
 
3
 *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
 
4
 *                                                                          *
 
5
 *   This library is free software; you can redistribute it and/or          *
 
6
 *   modify it under the terms of the GNU Lesser General Public             *
 
7
 *   License as published by the Free Software Foundation; either           *
 
8
 *   version 2.1 of the License, or (at your option) any later version.     *
 
9
 *                                                                          *
 
10
 *   This library is distributed in the hope that it will be useful,        *
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      *
 
13
 *   Lesser General Public License for more details.                        *
 
14
 *                                                                          *
 
15
 *   You should have received a copy of the GNU General Public License      *
 
16
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.  *
 
17
 ***************************************************************************/
 
18
#ifndef AKONADI_CONTACT_COLLECTION_MODEL_H
 
19
#define AKONADI_CONTACT_COLLECTION_MODEL_H
 
20
 
 
21
#include <QtGui/QSortFilterProxyModel>
 
22
#include "../lib/typedefs.h"
 
23
 
 
24
namespace Akonadi {
 
25
   class CollectionModel;
 
26
}
 
27
 
 
28
///Filter out notes and emails collections
 
29
class LIB_EXPORT AkonadiContactCollectionModel : public QSortFilterProxyModel
 
30
{
 
31
   Q_OBJECT
 
32
public:
 
33
   virtual ~AkonadiContactCollectionModel();
 
34
 
 
35
public:
 
36
   virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
 
37
   virtual Qt::ItemFlags flags       ( const QModelIndex& index                                    ) const;
 
38
   virtual bool          setData     ( const QModelIndex& index, const QVariant &value, int role   );
 
39
 
 
40
   //Mutator
 
41
   void reload();
 
42
   void save();
 
43
 
 
44
   //Singleton
 
45
   static AkonadiContactCollectionModel* instance();
 
46
 
 
47
protected:
 
48
   virtual bool filterAcceptsRow( int source_row, const QModelIndex & source_parent ) const;
 
49
 
 
50
private:
 
51
   explicit AkonadiContactCollectionModel(QObject* parent);
 
52
   QHash<int,bool> m_hChecked;
 
53
   QHash<int,bool> m_hLoaded ;
 
54
   Akonadi::CollectionModel* m_pParentModel;
 
55
 
 
56
   //Singleton
 
57
   static AkonadiContactCollectionModel* m_spInstance;
 
58
 
 
59
   //Helper
 
60
   void digg(const QModelIndex& idx);
 
61
 
 
62
private Q_SLOTS:
 
63
   void slotInsertCollection(const QModelIndex&,int,int);
 
64
   void slotRemoveCollection(const QModelIndex&,int,int);
 
65
 
 
66
Q_SIGNALS:
 
67
   void changed();
 
68
};
 
69
 
 
70
#endif