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 bool editIncidence( const QString &uid, const QDate &date );
00152
00158 bool addIncidence( const QString& ical );
00159
00161 virtual ResourceRequestReply resourceRequest( const QValueList<QPair<QDateTime, QDateTime> >& busy,
00162 const QCString& resource,
00163 const QString& vCalIn );
00164
00165 void openEventEditor( const QString& );
00166 void openEventEditor( const QString& summary,
00167 const QString& description,
00168 const QString& attachment );
00169 void openEventEditor( const QString& summary,
00170 const QString& description,
00171 const QString& attachment,
00172 const QStringList& attendees );
00173 void openEventEditor( const QString& summary,
00174 const QString& description,
00175 const QString& uri,
00176 const QString& file,
00177 const QStringList& attendees,
00178 const QString& attachmentMimetype );
00179
00180 void openTodoEditor( const QString& );
00181 void openTodoEditor( const QString& summary,
00182 const QString& description,
00183 const QString& attachment );
00184 void openTodoEditor( const QString& summary,
00185 const QString& description,
00186 const QString& attachment,
00187 const QStringList& attendees );
00188 void openTodoEditor( const QString& summary,
00189 const QString& description,
00190 const QString& uri,
00191 const QString& file,
00192 const QStringList& attendees,
00193 const QString& attachmentMimetype,
00194 bool isTask );
00195
00196 void openJournalEditor( const QDate& date );
00197 void openJournalEditor( const QString& text, const QDate& date );
00198 void openJournalEditor( const QString& text );
00199
00200
00201
00202
00203
00204 void showJournalView();
00205 void showTodoView();
00206 void showEventView();
00207
00208 void goDate( const QDate& );
00209 void goDate( const QString& );
00210 void showDate( const QDate &date );
00211
00212 QString localFileName();
00213
00214 bool queryClose();
00215
00216 void loadProfile( const QString & path );
00217
00218 void saveToProfile( const QString & path ) const;
00219
00220 signals:
00224 void actionNew( const KURL &url = KURL() );
00225
00231 void configChanged();
00232
00237 void closingDown();
00238
00240 void resourceAdded( ResourceCalendar * );
00241
00242 public slots:
00247 void updateConfig();
00248
00249 void setDestinationPolicy();
00250
00251 void processIncidenceSelection( Incidence *incidence, const QDate &date );
00252 void keyBindings();
00253
00258 void readSettings();
00259
00263 void writeSettings();
00264
00265
00266 void saveProperties( KConfig * );
00267 void readProperties( KConfig * );
00268
00269 void loadParts();
00270
00271 void importCalendar( const KURL &url );
00272
00273 protected slots:
00274
00276 void file_new();
00277
00279 void file_open();
00280
00283 void file_open( const KURL &url );
00284
00286 void file_icalimport();
00287
00289 void file_merge();
00290
00292 void file_revert();
00293
00295 void file_archive();
00296
00298 void file_save();
00299
00301 void file_saveas();
00302
00304 void file_close();
00305
00307 void configureDateTime();
00308
00310 void showTip();
00311
00313 void showTipOnStart();
00314
00315 void downloadNewStuff();
00316 void uploadNewStuff();
00317
00318 void toggleResourceButtons();
00319
00320 void toggleDateNavigator();
00321 void toggleTodoView();
00322 void toggleEventViewer();
00323 void toggleResourceView();
00324
00326 void checkAutoSave();
00327
00329 void slotAutoArchivingSettingsModified();
00330
00332 void slotAutoArchive();
00333
00334 void configureDateTimeFinished(KProcess *);
00335
00336 void setTitle();
00337
00338 void updateUndoAction( const QString & );
00339
00340 void updateRedoAction( const QString & );
00341
00342 void slotImportDialogFinished( ImportDialog * );
00343
00344 protected:
00346 KURL getSaveURL();
00347
00348 void showStatusMessageOpen( const KURL &url, bool merge );
00349
00350 void initCalendar( Calendar *cal );
00351
00355 QWidget *dialogParent();
00356
00357 private slots:
00358 void dumpText( const QString & );
00359
00360 private:
00361 class ActionStringsVisitor;
00362
00364 void initActions();
00365 void enableIncidenceActions( bool enable );
00366
00367 KOrg::Part::List mParts;
00368 KURL mURL;
00369 QString mFile;
00370 QString mLastUrl;
00371
00372 KTempFile *mTempFile;
00373 QTimer *mAutoSaveTimer;
00374 QTimer *mAutoArchiveTimer;
00375
00376
00377 static KOWindowList *mWindowList;
00378
00379
00380 KRecentFilesAction *mRecent;
00381 KToggleAction *mResourceButtonsAction;
00382
00383 KToggleAction *mDateNavigatorShowAction;
00384 KToggleAction *mTodoViewShowAction;
00385 KToggleAction *mResourceViewShowAction;
00386 KToggleAction *mEventViewerShowAction;
00387
00388
00389 KAction *mShowIncidenceAction;
00390 KAction *mEditIncidenceAction;
00391 KAction *mDeleteIncidenceAction;
00392
00393
00394 KAction *mCutAction;
00395 KAction *mCopyAction;
00396 KAction *mDeleteAction;
00397 KAction *mNextXDays;
00398 KAction *mPublishEvent;
00399 KAction *mForwardEvent;
00400
00401 KAction *mSendInvitation;
00402 KAction *mSendCancel;
00403 KAction *mSendStatusUpdate;
00404
00405 KAction *mRequestChange;
00406 KAction *mRequestUpdate;
00407
00408 KAction *mUndoAction;
00409 KAction *mRedoAction;
00410
00411 KSelectAction *mFilterAction;
00412
00413 KXMLGUIClient *mGUIClient;
00414 KActionCollection *mACollection;
00415 CalendarView *mCalendarView;
00416 KOrg::MainWindow *mMainWindow;
00417 bool mIsPart;
00418
00419 KONewStuff *mNewStuff;
00420 bool mHtmlExportSync;
00421
00422
00423 Calendar *mCalendar;
00424 CalendarResources *mCalendarResources;
00425
00426 ResourceView *mResourceView;
00427
00428 bool mIsClosing;
00429 };
00430
00431 #endif
|