~ubuntu-branches/ubuntu/quantal/kdepim/quantal

« back to all changes in this revision

Viewing changes to kalarm/itemlistmodel.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-15 14:17:51 UTC
  • mto: This revision was merged to the branch mainline in revision 193.
  • Revision ID: package-import@ubuntu.com-20111215141751-bmhdpiwl23wd9w26
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#define ITEMLISTMODEL_H
23
23
 
24
24
#include "akonadimodel.h"
25
 
#include "kacalendar.h"
26
 
#include "kaevent.h"
 
25
 
 
26
#include <kalarmcal/kacalendar.h>
 
27
#include <kalarmcal/kaevent.h>
27
28
 
28
29
#include <akonadi/entitymimetypefiltermodel.h>
29
30
 
 
31
using namespace KAlarmCal;
30
32
 
31
33
/*=============================================================================
32
34
= Class: ItemListModel
40
42
        /** Constructor.
41
43
         *  @param allowed the alarm types (active/archived/template) included in this model
42
44
         */
43
 
        explicit ItemListModel(KAlarm::CalEvent::Types allowed, QObject* parent = 0);
 
45
        explicit ItemListModel(CalEvent::Types allowed, QObject* parent = 0);
44
46
 
45
 
        KAlarm::CalEvent::Types includedTypes() const  { return mAllowedTypes; }
 
47
        CalEvent::Types includedTypes() const  { return mAllowedTypes; }
46
48
        KAEvent      event(int row) const;
47
49
        KAEvent      event(const QModelIndex&) const;
48
50
        using QObject::event;   // prevent warning about hidden virtual method
62
64
         */
63
65
        void         haveEventsStatus(bool have);
64
66
 
 
67
    protected:
 
68
        virtual bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const;
 
69
 
65
70
    private slots:
66
71
        void slotRowsInserted();
67
72
        void slotRowsRemoved();
 
73
        void collectionStatusChanged(const Akonadi::Collection& collection, AkonadiModel::Change change, const QVariant&, bool inserted);
68
74
 
69
75
    private:
70
 
        KAlarm::CalEvent::Types mAllowedTypes; // types of events allowed in this model
 
76
        CalEvent::Types mAllowedTypes; // types of events allowed in this model
71
77
        bool                    mHaveEvents;   // there are events in this model
72
78
};
73
79
 
97
103
         *  specified in the constructor.
98
104
         *  @param types the event types to be included in the model
99
105
         */
100
 
        void setEventTypeFilter(KAlarm::CalEvent::Types types);
 
106
        void setEventTypeFilter(CalEvent::Types types);
101
107
 
102
108
        /** Return the filter set by setEventTypeFilter().
103
109
         *  @return all event types included in the model
104
110
         */
105
 
        KAlarm::CalEvent::Types eventTypeFilter() const   { return mFilterTypes; }
 
111
        CalEvent::Types eventTypeFilter() const   { return mFilterTypes; }
106
112
 
107
113
        virtual int  columnCount(const QModelIndex& = QModelIndex()) const  { return ColumnCount; }
108
114
        virtual QVariant headerData(int section, Qt::Orientation, int role = Qt::DisplayRole) const;
114
120
    private:
115
121
        static AlarmListModel* mAllInstance;
116
122
 
117
 
        KAlarm::CalEvent::Types mFilterTypes;  // types of events contained in this model
 
123
        CalEvent::Types mFilterTypes;  // types of events contained in this model
118
124
};
119
125
 
120
126