00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
#ifndef KORG_ACTIONMANAGER_H
00027
#define KORG_ACTIONMANAGER_H
00028
00029
#include <qobject.h>
00030
#include <kurl.h>
00031
#include <korganizer/part.h>
00032
00033
#include "kcalendariface.h"
00034
00035
namespace KCal
00036 {
00037
class Calendar;
00038
class CalendarResources;
00039
class Incidence;
00040
class ResourceCalendar;
00041 }
00042
namespace KOrg
00043 {
00044
class MainWindow;
00045 }
00046
00047
class KAction;
00048
class KActionCollection;
00049
class KRecentFilesAction;
00050
class KToggleAction;
00051
class KConfig;
00052
class KProcess;
00053
class KTempFile;
00054
class KXMLGUIClient;
00055
class CalendarView;
00056
class KOrganizer;
00057
class KONewStuff;
00058
class KOWindowList;
00059
class ImportDialog;
00060
class ResourceView;
00061
00062
using namespace KCal;
00063
00070 class ActionManager :
public QObject,
public KCalendarIface
00071 {
00072 Q_OBJECT
00073
public:
00074
ActionManager( KXMLGUIClient *client,
CalendarView *widget,
00075
QObject *parent,
KOrg::MainWindow *mainWindow,
00076
bool isPart );
00077
virtual ~
ActionManager();
00078
00080
void init();
00081
00082
CalendarView *view()
const {
return mCalendarView; }
00083
00087
void createCalendarLocal();
00092
void createCalendarResources();
00093
00097
void saveCalendar();
00098
00103
bool saveResourceCalendar();
00104
00105
public slots:
00110
bool openURL(
const KURL &
url,
bool merge =
false );
00112
bool saveURL();
00114
bool saveAsURL(
const KURL &kurl );
00116
bool saveModifiedURL();
00117
public:
00119 KURL
url()
const {
return mURL; }
00120
00122
static KOrg::MainWindow*
findInstance(
const KURL &url );
00124
bool openURL(
QString url );
00126
bool mergeURL(
QString url );
00128
bool saveAsURL(
QString url );
00130
void closeURL();
00132
QString getCurrentURLasString() const;
00134 virtual
bool deleteEvent( const
QString& uid );
00135
00137
bool eventRequest( const
QString& request, const
QString& receiver,
00138 const
QString& ical );
00140
bool eventReply( const
QString& ical );
00142
bool cancelEvent( const
QString& ical );
00143
00144
bool editIncidence( const
QString& uid );
00145
00147 virtual ResourceRequestReply resourceRequest( const
QValueList<
QPair<
QDateTime, QDateTime> >& busy,
00148 const
QCString& resource,
00149 const
QString& vCalIn );
00150
00151
void openEventEditor(
QString );
00152
void openEventEditor( QString summary, QString description,
00153 QString attachment );
00154
void openEventEditor( QString summary, QString description,
00155 QString attachment,
QStringList attendees );
00156
00157
void openTodoEditor( QString );
00158
void openTodoEditor( QString summary, QString description,
00159 QString attachment );
00160
void openTodoEditor( QString summary, QString description,
00161 QString attachment,
QStringList attendees );
00162
00163
void showTodoView();
00164
void showEventView();
00165
00166
void goDate(
QDate );
00167
void goDate( QString );
00168
00169 QString localFileName();
00170
00171
bool queryClose();
00172
00173 signals:
00177
void actionNew( const KURL &url = KURL() );
00178
00182
void actionKeyBindings();
00183
00189
void configChanged();
00190
00195
void closingDown();
00196
00200
void filterActivated(
int );
00201
00202 public slots:
00207
void updateConfig();
00208
00209
void setDestinationPolicy();
00210
00211
void processIncidenceSelection( Incidence * );
00212
void keyBindings();
00213
00218
void readSettings();
00219
00223
void writeSettings();
00224
00225
00226
void saveProperties( KConfig * );
00227
void readProperties( KConfig * );
00228
00229
void loadParts();
00230
00231
void importCalendar( const KURL &url );
00232
00233 protected slots:
00234
00236
void file_new();
00237
00239
void file_open();
00240
00242
void file_openRecent( const KURL &url );
00243
00245
void file_import();
00246
00248
void file_merge();
00249
00251
void file_revert();
00252
00254
void file_archive();
00255
00257
void file_save();
00258
00260
void file_saveas();
00261
00263
void file_close();
00264
00266
void configureDateTime();
00267
00269
void showTip();
00270
00272
void showTipOnStart();
00273
00274
void downloadNewStuff();
00275
void uploadNewStuff();
00276
00277
void toggleFilterView();
00278
void toggleResourceButtons();
00279
00281
void checkAutoSave();
00282
00284
void slotAutoArchivingSettingsModified();
00285
00287
void slotAutoArchive();
00288
00289
void configureDateTimeFinished(KProcess *);
00290
00291
void setTitle();
00292
00293
void updateUndoAction( const QString & );
00294
00295
void updateRedoAction( const QString & );
00296
00297
void slotImportDialogFinished( ImportDialog * );
00298
00299 protected:
00301 KURL getSaveURL();
00302
00303
void showStatusMessageOpen( const KURL &url,
bool merge );
00304
00305
void initCalendar( Calendar *cal );
00306
00307
void exportToHTML();
00308
00312
QWidget *dialogParent();
00313
00314 private slots:
00315
void dumpText( const QString & );
00316
00317 private:
00319
void initActions();
00320
void enableIncidenceActions(
bool enable );
00321
00322 KOrg::Part::List mParts;
00323 KURL mURL;
00324 QString mFile;
00325 QString mLastUrl;
00326
00327 KTempFile *mTempFile;
00328
QTimer *mAutoSaveTimer;
00329
QTimer *mAutoArchiveTimer;
00330
00331
00332 static
KOWindowList *mWindowList;
00333
00334
00335 KRecentFilesAction *mRecent;
00336 KToggleAction *mFilterViewAction;
00337 KToggleAction *mResourceButtonsAction;
00338 KAction *mShowIncidenceAction;
00339 KAction *mEditIncidenceAction;
00340 KAction *mDeleteIncidenceAction;
00341
00342 KAction *mCutAction;
00343 KAction *mCopyAction;
00344 KAction *mDeleteAction;
00345 KAction *mNextXDays;
00346 KAction *mPublishEvent;
00347
00348 KAction *mUndoAction;
00349 KAction *mRedoAction;
00350
00351 KXMLGUIClient *mGUIClient;
00352 KActionCollection *mACollection;
00353
CalendarView *mCalendarView;
00354 KOrg::MainWindow *mMainWindow;
00355
bool mIsPart;
00356
00357 KONewStuff *mNewStuff;
00358
bool mHtmlExportSync;
00359
00360
00361 Calendar *mCalendar;
00362 CalendarResources *mCalendarResources;
00363
00364
ResourceView *mResourceView;
00365
00366
bool mIsClosing;
00367 };
00368
00369 #endif