actionmanager.h
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
00136 bool editIncidence( const QString& uid );
00137
00139 virtual ResourceRequestReply resourceRequest( const QValueList<QPair<QDateTime, QDateTime> >& busy,
00140 const QCString& resource,
00141 const QString& vCalIn );
00142
00143 void openEventEditor( QString );
00144 void openEventEditor( QString summary, QString description,
00145 QString attachment );
00146 void openEventEditor( QString summary, QString description,
00147 QString attachment, QStringList attendees );
00148
00149 void openTodoEditor( QString );
00150 void openTodoEditor( QString summary, QString description,
00151 QString attachment );
00152 void openTodoEditor( QString summary, QString description,
00153 QString attachment, QStringList attendees );
00154
00155 void showTodoView();
00156 void showEventView();
00157
00158 void goDate( QDate );
00159 void goDate( QString );
00160
00161 QString localFileName();
00162
00163 bool queryClose();
00164
00165 signals:
00169 void actionNew( const KURL &url = KURL() );
00170
00174 void actionKeyBindings();
00175
00181 void configChanged();
00182
00187 void closingDown();
00188
00192 void filterActivated( int );
00193
00194 public slots:
00199 void updateConfig();
00200
00201 void setDestinationPolicy();
00202
00203 void processIncidenceSelection( Incidence * );
00204 void keyBindings();
00205
00210 void readSettings();
00211
00215 void writeSettings();
00216
00217
00218 void saveProperties( KConfig * );
00219 void readProperties( KConfig * );
00220
00221 void loadParts();
00222
00223 void importCalendar( const KURL &url );
00224
00225 protected slots:
00226
00228 void file_new();
00229
00231 void file_open();
00232
00234 void file_openRecent( const KURL &url );
00235
00237 void file_import();
00238
00240 void file_merge();
00241
00243 void file_revert();
00244
00246 void file_archive();
00247
00249 void file_save();
00250
00252 void file_saveas();
00253
00255 void file_close();
00256
00258 void configureDateTime();
00259
00261 void showTip();
00262
00264 void showTipOnStart();
00265
00266 void downloadNewStuff();
00267 void uploadNewStuff();
00268
00269 void toggleFilterView();
00270 void toggleResourceButtons();
00271
00273 void checkAutoSave();
00274
00276 void slotAutoArchivingSettingsModified();
00277
00279 void slotAutoArchive();
00280
00281 void configureDateTimeFinished(KProcess *);
00282
00283 void setTitle();
00284
00285 void updateUndoAction( const QString & );
00286
00287 void updateRedoAction( const QString & );
00288
00289 void slotImportDialogFinished( ImportDialog * );
00290
00291 protected:
00293 KURL getSaveURL();
00294
00295 void showStatusMessageOpen( const KURL &url, bool merge );
00296
00297 void initCalendar( Calendar *cal );
00298
00299 void exportToHTML();
00300
00304 QWidget *dialogParent();
00305
00306 private slots:
00307 void dumpText( const QString & );
00308
00309 private:
00311 void initActions();
00312 void enableIncidenceActions( bool enable );
00313
00314 KOrg::Part::List mParts;
00315 KURL mURL;
00316 QString mFile;
00317 QString mLastUrl;
00318
00319 KTempFile *mTempFile;
00320 QTimer *mAutoSaveTimer;
00321 QTimer *mAutoArchiveTimer;
00322
00323
00324 static KOWindowList *mWindowList;
00325
00326
00327 KRecentFilesAction *mRecent;
00328 KToggleAction *mFilterViewAction;
00329 KToggleAction *mResourceButtonsAction;
00330 KAction *mShowIncidenceAction;
00331 KAction *mEditIncidenceAction;
00332 KAction *mDeleteIncidenceAction;
00333
00334 KAction *mCutAction;
00335 KAction *mCopyAction;
00336 KAction *mDeleteAction;
00337 KAction *mNextXDays;
00338 KAction *mPublishEvent;
00339
00340 KAction *mUndoAction;
00341 KAction *mRedoAction;
00342
00343 KXMLGUIClient *mGUIClient;
00344 KActionCollection *mACollection;
00345 CalendarView *mCalendarView;
00346 KOrg::MainWindow *mMainWindow;
00347 bool mIsPart;
00348
00349 KONewStuff *mNewStuff;
00350 bool mHtmlExportSync;
00351
00352
00353 Calendar *mCalendar;
00354 CalendarResources *mCalendarResources;
00355
00356 ResourceView *mResourceView;
00357
00358 bool mIsClosing;
00359 };
00360
00361 #endif
This file is part of the documentation for korganizer Library Version 3.3.2.