korganizer
actionmanager.h00001
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
00027 #ifndef KORG_ACTIONMANAGER_H
00028 #define KORG_ACTIONMANAGER_H
00029
00030 #include <qobject.h>
00031 #include <kurl.h>
00032 #include <korganizer/part.h>
00033 #include <kdepimmacros.h>
00034
00035 #include "kcalendariface.h"
00036
00037 namespace KCal
00038 {
00039 class Calendar;
00040 class CalendarResources;
00041 class Incidence;
00042 class ResourceCalendar;
00043 }
00044 namespace KOrg
00045 {
00046 class MainWindow;
00047 }
00048
00049 class KAction;
00050 class KActionCollection;
00051 class KRecentFilesAction;
00052 class KSelectAction;
00053 class KToggleAction;
00054 class KConfig;
00055 class KProcess;
00056 class KTempFile;
00057 class KXMLGUIClient;
00058 class CalendarView;
00059 class KOrganizer;
00060 class KONewStuff;
00061 class KOWindowList;
00062 class ImportDialog;
00063 class ResourceView;
00064 class HTMLExportSettings;
00065
00066 using namespace KCal;
00067
00074 class KDE_EXPORT ActionManager : public QObject, public KCalendarIface
00075 {
00076 Q_OBJECT
00077 public:
00078 ActionManager( KXMLGUIClient *client, CalendarView *widget,
00079 QObject *parent, KOrg::MainWindow *mainWindow,
00080 bool isPart );
00081 virtual ~ActionManager();
00082
00084 void init();
00085
00086 CalendarView *view() const { return mCalendarView; }
00087
00091 void createCalendarLocal();
00096 void createCalendarResources();
00097
00101 void saveCalendar();
00102
00107 bool saveResourceCalendar();
00108
00109 public slots:
00111 bool addResource( const KURL &mUrl );
00116 bool openURL( const KURL &url, bool merge = false );
00118 bool saveURL();
00120 bool saveAsURL( const KURL &kurl );
00122 bool saveModifiedURL();
00123
00124 void exportHTML();
00125 void exportHTML( HTMLExportSettings * );
00126 public:
00128 KURL url() const { return mURL; }
00129
00131 static KOrg::MainWindow* findInstance( const KURL &url );
00133 bool openURL( const QString &url );
00135 bool mergeURL( const QString &url );
00137 bool saveAsURL( const QString &url );
00139 void closeURL();
00141 QString getCurrentURLasString() const;
00148 virtual bool deleteIncidence( const QString& uid, bool force = false );
00149
00150 bool editIncidence( const QString& uid );
00151
00157 bool addIncidence( const QString& ical );
00158
00160 virtual ResourceRequestReply resourceRequest( const QValueList<QPair<QDateTime, QDateTime> >& busy,
00161 const QCString& resource,
00162 const QString& vCalIn );
00163
00164 void openEventEditor( const QString& );
00165 void openEventEditor( const QString& summary,
00166 const QString& description,
00167 const QString& attachment );
00168 void openEventEditor( const QString& summary,
00169 const QString& description,
00170 const QString& attachment,
00171 const QStringList& attendees );
00172
00173 void openTodoEditor( const QString& );
00174 void openTodoEditor( const QString& summary,
00175 const QString& description,
00176 const QString& attachment );
00177 void openTodoEditor( const QString& summary,
00178 const QString& description,
00179 const QString& attachment,
00180 const QStringList& attendees );
00181
00182 void openJournalEditor( const QDate& date );
00183 void openJournalEditor( const QString& text, const QDate& date );
00184 void openJournalEditor( const QString& text );
00185
00186
00187
00188
00189
00190 void showJournalView();
00191 void showTodoView();
00192 void showEventView();
00193
00194 void goDate( const QDate& );
00195 void goDate( const QString& );
00196
00197 QString localFileName();
00198
00199 bool queryClose();
00200
00201 signals:
00205 void actionNew( const KURL &url = KURL() );
00206
00212 void configChanged();
00213
00218 void closingDown();
00219
00221 void resourceAdded( ResourceCalendar * );
00222
00223 public slots:
00228 void updateConfig();
00229
00230 void setDestinationPolicy();
00231
00232 void processIncidenceSelection( Incidence * );
00233 void keyBindings();
00234
00239 void readSettings();
00240
00244 void writeSettings();
00245
00246
00247 void saveProperties( KConfig * );
00248 void readProperties( KConfig * );
00249
00250 void loadParts();
00251
00252 void importCalendar( const KURL &url );
00253
00254 protected slots:
00255
00257 void file_new();
00258
00260 void file_open();
00261
00264 void file_open( const KURL &url );
00265
00267 void file_icalimport();
00268
00270 void file_merge();
00271
00273 void file_revert();
00274
00276 void file_archive();
00277
00279 void file_save();
00280
00282 void file_saveas();
00283
00285 void file_close();
00286
00288 void configureDateTime();
00289
00291 void showTip();
00292
00294 void showTipOnStart();
00295
00296 void downloadNewStuff();
00297 void uploadNewStuff();
00298
00299 void toggleResourceButtons();
00300
00301 void toggleDateNavigator();
00302 void toggleTodoView();
00303 void toggleEventViewer();
00304 void toggleResourceView();
00305
00307 void checkAutoSave();
00308
00310 void slotAutoArchivingSettingsModified();
00311
00313 void slotAutoArchive();
00314
00315 void configureDateTimeFinished(KProcess *);
00316
00317 void setTitle();
00318
00319 void updateUndoAction( const QString & );
00320
00321 void updateRedoAction( const QString & );
00322
00323 void slotImportDialogFinished( ImportDialog * );
00324
00325 protected:
00327 KURL getSaveURL();
00328
00329 void showStatusMessageOpen( const KURL &url, bool merge );
00330
00331 void initCalendar( Calendar *cal );
00332
00336 QWidget *dialogParent();
00337
00338 private slots:
00339 void dumpText( const QString & );
00340
00341 private:
00342 class ActionStringsVisitor;
00343
00345 void initActions();
00346 void enableIncidenceActions( bool enable );
00347
00348 KOrg::Part::List mParts;
00349 KURL mURL;
00350 QString mFile;
00351 QString mLastUrl;
00352
00353 KTempFile *mTempFile;
00354 QTimer *mAutoSaveTimer;
00355 QTimer *mAutoArchiveTimer;
00356
00357
00358 static KOWindowList *mWindowList;
00359
00360
00361 KRecentFilesAction *mRecent;
00362 KToggleAction *mResourceButtonsAction;
00363
00364 KToggleAction *mDateNavigatorShowAction;
00365 KToggleAction *mTodoViewShowAction;
00366 KToggleAction *mResourceViewShowAction;
00367 KToggleAction *mEventViewerShowAction;
00368
00369
00370 KAction *mShowIncidenceAction;
00371 KAction *mEditIncidenceAction;
00372 KAction *mDeleteIncidenceAction;
00373
00374
00375 KAction *mCutAction;
00376 KAction *mCopyAction;
00377 KAction *mDeleteAction;
00378 KAction *mNextXDays;
00379 KAction *mPublishEvent;
00380
00381 KAction *mUndoAction;
00382 KAction *mRedoAction;
00383
00384 KSelectAction *mFilterAction;
00385
00386 KXMLGUIClient *mGUIClient;
00387 KActionCollection *mACollection;
00388 CalendarView *mCalendarView;
00389 KOrg::MainWindow *mMainWindow;
00390 bool mIsPart;
00391
00392 KONewStuff *mNewStuff;
00393 bool mHtmlExportSync;
00394
00395
00396 Calendar *mCalendar;
00397 CalendarResources *mCalendarResources;
00398
00399 ResourceView *mResourceView;
00400
00401 bool mIsClosing;
00402 };
00403
00404 #endif
|