• 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
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 <QFrame>
39 #include <QSize>
40 #ifdef USE_AKONADI
41 #include <QList>
42 #endif
43 
44 using namespace KAlarmCal;
45 
46 class QPushButton;
47 class QResizeEvent;
48 class KAction;
49 class KActionCollection;
50 class KToggleAction;
51 class KComboBox;
52 class KMenu;
53 class ResourceView;
54 #ifdef USE_AKONADI
55 class AkonadiResourceCreator;
56 namespace Akonadi {
57  class Collection;
58 }
59 #else
60 using KCal::ResourceCalendar;
61 #endif
62 
63 
67 class ResourceSelector : public QFrame
68 {
69  Q_OBJECT
70  public:
71 #ifdef USE_AKONADI
72  explicit ResourceSelector(QWidget* parent = 0);
73 #else
74  explicit ResourceSelector(AlarmResources*, QWidget* parent = 0);
75  AlarmResources* calendar() const { return mCalendar; }
76 #endif
77  void initActions(KActionCollection*);
78  void setContextMenu(KMenu*);
79 
80  signals:
81  void resized(const QSize& oldSize, const QSize& newSize);
82 
83  protected:
84  virtual void resizeEvent(QResizeEvent*);
85 
86  private slots:
87  void alarmTypeSelected();
88  void addResource();
89  void editResource();
90 #ifdef USE_AKONADI
91  void updateResource();
92 #endif
93  void removeResource();
94  void selectionChanged();
95  void contextMenuRequested(const QPoint&);
96  void reloadResource();
97  void saveResource();
98  void setStandard();
99  void setColour();
100  void clearColour();
101  void importCalendar();
102  void exportCalendar();
103  void showInfo();
104  void archiveDaysChanged(int days);
105 #ifdef USE_AKONADI
106  void resourceAdded(AkonadiResourceCreator*, bool success);
107  void slotCollectionAdded(const Akonadi::Collection&);
108 #else
109  void slotStatusChanged(AlarmResource*, AlarmResources::Change);
110 #endif
111  void reinstateAlarmTypeScrollBars();
112 
113  private:
114  CalEvent::Type currentResourceType() const;
115 #ifdef USE_AKONADI
116  Akonadi::Collection currentResource() const;
117 
118  CollectionView* mListView;
119  QList<Akonadi::AgentInstance> mAddAgents; // agent added by addResource()
120 #else
121  AlarmResource* currentResource() const;
122 
123  AlarmResources* mCalendar;
124  ResourceView* mListView;
125 #endif
126  KComboBox* mAlarmType;
127  QPushButton* mAddButton;
128  QPushButton* mDeleteButton;
129  QPushButton* mEditButton;
130  CalEvent::Type mCurrentAlarmType;
131  KMenu* mContextMenu;
132  KAction* mActionReload;
133  KAction* mActionShowDetails;
134  KAction* mActionSetColour;
135  KAction* mActionClearColour;
136  KAction* mActionEdit;
137 #ifdef USE_AKONADI
138  KAction* mActionUpdate;
139 #else
140  KAction* mActionSave;
141 #endif
142  KAction* mActionRemove;
143  KAction* mActionImport;
144  KAction* mActionExport;
145  KToggleAction* mActionSetDefault;
146 };
147 
148 #endif
149 
150 // vim: et sw=4:
QResizeEvent
QWidget
QPoint
ResourceView
Definition: resourcemodelview.h:89
akonadimodel.h
QList
ResourceSelector
This class provides a view of alarm calendar resources.
Definition: resourceselector.h:67
QSize
QFrame
collectionmodel.h
KComboBox
QPushButton
CollectionView
Definition: collectionmodel.h:141
ResourceSelector::calendar
AlarmResources * calendar() const
Definition: resourceselector.h:75
AkonadiResourceCreator
Definition: akonadiresourcecreator.h:37
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