korganizer Library API Documentation

resourceview.h

00001 /* 00002 This file is part of KOrganizer. 00003 00004 Copyright (c) 2003,2004 Cornelius Schumacher <schumacher@kde.org> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 00020 As a special exception, permission is given to link this program 00021 with any edition of Qt, and distribute the resulting executable, 00022 without including the source code for Qt in the source distribution. 00023 */ 00024 #ifndef KORG_RESOURCEVIEW_H 00025 #define KORG_RESOURCEVIEW_H 00026 00027 #include "calendarview.h" 00028 00029 #include <libkcal/resourcecalendar.h> 00030 #include <qlistview.h> 00031 00032 namespace KCal { 00033 class CalendarResources; 00034 } 00035 using namespace KCal; 00036 class KListView; 00037 class ResourceView; 00038 class QPushButton; 00039 00040 class ResourceViewFactory : public CalendarViewExtension::Factory 00041 { 00042 public: 00043 ResourceViewFactory( KCal::CalendarResources *calendar, 00044 CalendarView *view ); 00045 00046 CalendarViewExtension *create( QWidget * ); 00047 00048 ResourceView *resourceView() const; 00049 00050 private: 00051 KCal::CalendarResources *mCalendar; 00052 CalendarView *mView; 00053 ResourceView *mResourceView; 00054 }; 00055 00056 00057 class ResourceItem : public QCheckListItem 00058 { 00059 public: 00060 ResourceItem( KCal::ResourceCalendar *resource, ResourceView *view, 00061 KListView *parent ); 00062 ResourceItem( KCal::ResourceCalendar *resource, const QString& sub, 00063 ResourceView *view, ResourceItem* parent ); 00064 00065 KCal::ResourceCalendar *resource() { return mResource; } 00066 00067 void update(); 00068 00069 protected: 00070 void stateChange( bool active ); 00071 00072 void setGuiState(); 00073 00074 private: 00075 KCal::ResourceCalendar *mResource; 00076 ResourceView *mView; 00077 bool mBlockStateChange; 00078 bool mIsSubresource; 00079 }; 00080 00084 class ResourceView : public CalendarViewExtension 00085 { 00086 Q_OBJECT 00087 public: 00088 ResourceView( KCal::CalendarResources *calendar, QWidget *parent = 0, 00089 const char *name = 0 ); 00090 ~ResourceView(); 00091 00092 KCal::CalendarResources *calendar() const { return mCalendar; } 00093 00094 void updateView(); 00095 00096 void emitResourcesChanged(); 00097 00098 void requestClose( ResourceCalendar * ); 00099 00100 void showButtons( bool visible ); 00101 00102 public slots: 00103 void addResourceItem( ResourceCalendar * ); 00104 void updateResourceItem( ResourceCalendar * ); 00105 00106 signals: 00107 void resourcesChanged(); 00108 00109 protected: 00110 ResourceItem *findItem( ResourceCalendar * ); 00111 ResourceItem *currentItem(); 00112 00113 protected slots: 00114 void addResource(); 00115 void removeResource(); 00116 void editResource(); 00117 void currentChanged( QListViewItem* ); 00118 void slotSubresourceAdded( ResourceCalendar *, const QString &, 00119 const QString &resource ); 00120 void slotSubresourceRemoved( ResourceCalendar *, const QString &, 00121 const QString &resource ); 00122 void closeResource( ResourceCalendar * ); 00123 00124 void contextMenuRequested ( QListViewItem *i, const QPoint &pos, int ); 00125 00126 void showInfo(); 00127 00128 void reloadResource(); 00129 void saveResource(); 00130 00131 private: 00132 KListView *mListView; 00133 KCal::CalendarResources *mCalendar; 00134 QPushButton *mAddButton; 00135 QPushButton *mDeleteButton; 00136 QPushButton *mEditButton; 00137 QPtrList<ResourceCalendar> mResourcesToClose; 00138 }; 00139 00140 #endif
KDE Logo
This file is part of the documentation for korganizer Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 27 12:53:28 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003