• 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
resourceselector.h
Go to the documentation of this file.
1 /*
2  * resourceselector.h - alarm calendar resource selection widget
3  * Program: kalarm
4  * Copyright © 2006-2011 by David Jarvie <djarvie@kde.org>
5  * Based on KOrganizer's ResourceView class and KAddressBook's ResourceSelection class,
6  * Copyright (C) 2003,2004 Cornelius Schumacher <schumacher@kde.org>
7  * Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
8  * Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23  */
24 
25 #ifndef RESOURCESELECTOR_H
26 #define RESOURCESELECTOR_H
27 
28 #ifdef USE_AKONADI
29 #include "akonadimodel.h"
30 #include "collectionmodel.h"
31 
32 #include <akonadi/agentinstance.h>
33 #else
34 #include "alarmresource.h"
35 #include "alarmresources.h"
36 #endif
37 
38 #include <QModelIndex>
39 #include <QFrame>
40 #include <QSize>
41 #ifdef USE_AKONADI
42 #include <QList>
43 #endif
44 
45 using namespace KAlarmCal;
46 
47 class QPushButton;
48 class QResizeEvent;
49 class KAction;
50 class KActionCollection;
51 class KToggleAction;
52 class KComboBox;
53 class KMenu;
54 class ResourceView;
55 #ifdef USE_AKONADI
56 class AkonadiModel;
57 class AkonadiResourceCreator;
58 class CollectionFilterCheckListModel;
59 namespace Akonadi {
60  class Collection;
61 }
62 #else
63 using KCal::ResourceCalendar;
64 #endif
65 
66 
70 class ResourceSelector : public QFrame
71 {
72  Q_OBJECT
73  public:
74 #ifdef USE_AKONADI
75  explicit ResourceSelector(QWidget* parent = 0);
76 #else
77  explicit ResourceSelector(AlarmResources*, QWidget* parent = 0);
78  AlarmResources* calendar() const { return mCalendar; }
79 #endif
80  void initActions(KActionCollection*);
81  void setContextMenu(KMenu*);
82 
83  signals:
84  void resized(const QSize& oldSize, const QSize& newSize);
85 
86  protected:
87  virtual void resizeEvent(QResizeEvent*);
88 
89  private slots:
90  void alarmTypeSelected();
91  void addResource();
92  void editResource();
93 #ifdef USE_AKONADI
94  void updateResource();
95 #endif
96  void removeResource();
97  void selectionChanged();
98  void contextMenuRequested(const QPoint&);
99  void reloadResource();
100  void saveResource();
101  void setStandard();
102  void setColour();
103  void clearColour();
104  void importCalendar();
105  void exportCalendar();
106  void showInfo();
107  void archiveDaysChanged(int days);
108 #ifdef USE_AKONADI
109  void resourceAdded(AkonadiResourceCreator*, bool success);
110  void slotCollectionAdded(const Akonadi::Collection&);
111 #else
112  void slotStatusChanged(AlarmResource*, AlarmResources::Change);
113 #endif
114  void reinstateAlarmTypeScrollBars();
115 
116  private:
117  CalEvent::Type currentResourceType() const;
118 #ifdef USE_AKONADI
119  Akonadi::Collection currentResource() const;
120 
121  CollectionView* mListView;
122  QList<Akonadi::AgentInstance> mAddAgents; // agent added by addResource()
123 #else
124  AlarmResource* currentResource() const;
125 
126  AlarmResources* mCalendar;
127  ResourceView* mListView;
128 #endif
129  KComboBox* mAlarmType;
130  QPushButton* mAddButton;
131  QPushButton* mDeleteButton;
132  QPushButton* mEditButton;
133  CalEvent::Type mCurrentAlarmType;
134  KMenu* mContextMenu;
135  KAction* mActionReload;
136  KAction* mActionShowDetails;
137  KAction* mActionSetColour;
138  KAction* mActionClearColour;
139  KAction* mActionEdit;
140 #ifdef USE_AKONADI
141  KAction* mActionUpdate;
142 #else
143  KAction* mActionSave;
144 #endif
145  KAction* mActionRemove;
146  KAction* mActionImport;
147  KAction* mActionExport;
148  KToggleAction* mActionSetDefault;
149 };
150 
151 #endif
152 
153 // vim: et sw=4:
QWidget
QPushButton
ResourceView
Definition: resourcemodelview.h:90
akonadimodel.h
ResourceSelector
This class provides a view of alarm calendar resources.
Definition: resourceselector.h:70
collectionmodel.h
CollectionFilterCheckListModel
Definition: collectionmodel.h:113
KComboBox
CollectionView
Definition: collectionmodel.h:141
QFrame
AkonadiModel
Definition: akonadimodel.h:48
ResourceSelector::calendar
AlarmResources * calendar() const
Definition: resourceselector.h:78
AkonadiResourceCreator
Definition: akonadiresourcecreator.h:37
QList
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