diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
commit | cc29364f06178f8f6b457384f2ec37a042bd9d43 (patch) | |
tree | 7c77a3184c698bbf9d98cef09fb1ba8124daceba /korganizer/koeditorattachments.h | |
parent | 4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff) | |
download | tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip |
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed
* Added journal read support to the CalDAV resource
* Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'korganizer/koeditorattachments.h')
-rw-r--r-- | korganizer/koeditorattachments.h | 98 |
1 files changed, 93 insertions, 5 deletions
diff --git a/korganizer/koeditorattachments.h b/korganizer/koeditorattachments.h index 09b2c48ea..dfcdb2b5f 100644 --- a/korganizer/koeditorattachments.h +++ b/korganizer/koeditorattachments.h @@ -26,19 +26,56 @@ #define KOEDITORATTACHMENTS_H #include <tqwidget.h> +#include <tqmap.h> +#include <kdialogbase.h> +#include <kmimetype.h> #include <kurl.h> +#include <kiconview.h> + +#include <set> + +class AttachmentListItem; +class AttachmentIconView; namespace KCal { class Incidence; class Attachment; } +class TQCheckBox; class TQIconViewItem; -class AttachmentIconView; +class TQLabel; class TQMimeSource; class TQPushButton; class TQPopupMenu; + class KAction; +class KLineEdit; +class KURLRequester; +class KTempDir; + +class AttachmentEditDialog : public KDialogBase +{ + Q_OBJECT + public: + AttachmentEditDialog( AttachmentListItem *item, TQWidget *parent=0 ); + + void accept(); + + protected slots: + void urlSelected( const TQString &url ); + void urlChanged( const TQString & url ); + virtual void slotApply(); + + private: + friend class KOEditorAttachments; + KMimeType::Ptr mMimeType; + AttachmentListItem *mItem; + TQLabel *mTypeLabel, *mIcon; + TQCheckBox *mInline; + KLineEdit *mLabelEdit; + KURLRequester *mURLRequester; +}; class KOEditorAttachments : public QWidget { @@ -48,9 +85,14 @@ class KOEditorAttachments : public QWidget const char *name = 0 ); ~KOEditorAttachments(); - void addAttachment( const KURL &uri, - const TQString &mimeType = TQString::null, bool asUri = true ); + void addUriAttachment( const TQString &uri, + const TQString &mimeType = TQString(), + const TQString &label = TQString(), + bool inLine = false ); void addAttachment( KCal::Attachment *attachment ); + void addDataAttachment( const TQByteArray &data, + const TQString &mimeType = TQString(), + const TQString &label = TQString() ); /** Set widgets to default values */ void setDefaults(); @@ -63,29 +105,75 @@ class KOEditorAttachments : public QWidget protected slots: void showAttachment( TQIconViewItem *item ); + void saveAttachment( TQIconViewItem *item ); void slotAdd(); void slotAddData(); void slotEdit(); void slotRemove(); void slotShow(); + void slotSaveAs(); void dragEnterEvent( TQDragEnterEvent *event ); + void dragMoveEvent( TQDragMoveEvent *event ); void dropEvent( TQDropEvent *event ); void slotCopy(); void slotCut(); void slotPaste(); void selectionChanged(); void contextMenu( TQIconViewItem* item, const TQPoint &pos ); + signals: void openURL( const KURL &url ); + protected: + enum { + DRAG_COPY = 0, + DRAG_LINK = 1, + DRAG_CANCEL = 2 + }; + private: friend class AttachmentIconView; void handlePasteOrDrop( TQMimeSource* source ); - + TQString randomString( int length ) const; AttachmentIconView *mAttachments; TQPushButton *mRemoveBtn; TQPopupMenu *mContextMenu, *mAddMenu; - KAction *mOpenAction, *mCopyAction, *mCutAction; + KAction *mOpenAction; + KAction *mSaveAsAction; + KAction *mCopyAction; + KAction *mCutAction; + KAction *mDeleteAction; + KAction *mEditAction; +}; + + +class AttachmentIconView : public KIconView +{ + Q_OBJECT + + friend class KOEditorAttachments; + public: + AttachmentIconView( KOEditorAttachments* parent=0 ); + KURL tempFileForAttachment( KCal::Attachment *attachment ); + TQDragObject *mimeData(); + ~AttachmentIconView(); + + protected: + TQDragObject * dragObject(); + + void dragMoveEvent( TQDragMoveEvent *event ); + void contentsDragMoveEvent( TQDragMoveEvent *event ); + void contentsDragEnterEvent( TQDragEnterEvent *event ); + void dragEnterEvent( TQDragEnterEvent *event ); + + protected slots: + + void handleDrop( TQDropEvent *event, const TQValueList<TQIconDragItem> & list ); + + private: + std::set<KTempDir*> mTempDirs; + TQMap<KCal::Attachment *, KURL> mTempFiles; + KOEditorAttachments* mParent; }; #endif |