X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e90c1d2a19361551eb07778280f22be3e759cf64..df53be12c55c077d9c2e1c479a1552188638495c:/include/wx/motif/dnd.h?ds=sidebyside diff --git a/include/wx/motif/dnd.h b/include/wx/motif/dnd.h index 2cb1947fa5..ba22792fbf 100644 --- a/include/wx/motif/dnd.h +++ b/include/wx/motif/dnd.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: dnd.h +// Name: wx/motif/dnd.h // Purpose: declaration of wxDropTarget, wxDropSource classes // Author: Julian Smart // RCS-ID: $Id$ @@ -7,14 +7,9 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// - #ifndef _WX_DND_H_ #define _WX_DND_H_ -#ifdef __GNUG__ -#pragma interface -#endif - #include "wx/defs.h" #if wxUSE_DRAG_AND_DROP @@ -28,52 +23,52 @@ // classes //------------------------------------------------------------------------- -class WXDLLEXPORT wxWindow; +class WXDLLIMPEXP_FWD_CORE wxWindow; -class WXDLLEXPORT wxDropTarget; -class WXDLLEXPORT wxTextDropTarget; -class WXDLLEXPORT wxFileDropTarget; -class WXDLLEXPORT wxPrivateDropTarget; +class WXDLLIMPEXP_FWD_CORE wxDropTarget; +class WXDLLIMPEXP_FWD_CORE wxTextDropTarget; +class WXDLLIMPEXP_FWD_CORE wxFileDropTarget; +class WXDLLIMPEXP_FWD_CORE wxPrivateDropTarget; -class WXDLLEXPORT wxDropSource; +class WXDLLIMPEXP_FWD_CORE wxDropSource; //------------------------------------------------------------------------- // wxDropTarget //------------------------------------------------------------------------- -class WXDLLEXPORT wxDropTarget: public wxObject +class WXDLLIMPEXP_CORE wxDropTarget: public wxObject { - public: +public: wxDropTarget(); - ~wxDropTarget(); - + virtual ~wxDropTarget(); + virtual void OnEnter() { } virtual void OnLeave() { } virtual bool OnDrop( long x, long y, const void *data, size_t size ) = 0; - // Override these to indicate what kind of data you support: - + // Override these to indicate what kind of data you support: + virtual size_t GetFormatCount() const = 0; virtual wxDataFormat GetFormat(size_t n) const = 0; - - // implementation + + // implementation }; //------------------------------------------------------------------------- // wxTextDropTarget //------------------------------------------------------------------------- -class WXDLLEXPORT wxTextDropTarget: public wxDropTarget +class WXDLLIMPEXP_CORE wxTextDropTarget: public wxDropTarget { - public: +public: wxTextDropTarget() {}; virtual bool OnDrop( long x, long y, const void *data, size_t size ); virtual bool OnDropText( long x, long y, const char *psz ); - - protected: - + +protected: + virtual size_t GetFormatCount() const; virtual wxDataFormat GetFormat(size_t n) const; }; @@ -82,48 +77,48 @@ class WXDLLEXPORT wxTextDropTarget: public wxDropTarget // wxPrivateDropTarget //------------------------------------------------------------------------- -class WXDLLEXPORT wxPrivateDropTarget: public wxDropTarget +class WXDLLIMPEXP_CORE wxPrivateDropTarget: public wxDropTarget { public: - wxPrivateDropTarget(); - - // you have to override OnDrop to get at the data - - // the string ID identifies the format of clipboard or DnD data. a word - // processor would e.g. add a wxTextDataObject and a wxPrivateDataObject - // to the clipboard - the latter with the Id "WXWORD_FORMAT(". - - void SetId( const wxString& id ) - { m_id = id; } - - wxString GetId() - { return m_id; } + wxPrivateDropTarget(); + + // you have to override OnDrop to get at the data + + // the string ID identifies the format of clipboard or DnD data. a word + // processor would e.g. add a wxTextDataObject and a wxPrivateDataObject + // to the clipboard - the latter with the Id "WXWORD_FORMAT". + + void SetId( const wxString& id ) + { m_id = id; } + + wxString GetId() + { return m_id; } private: - virtual size_t GetFormatCount() const; - virtual wxDataFormat GetFormat(size_t n) const; - - wxString m_id; + virtual size_t GetFormatCount() const; + virtual wxDataFormat GetFormat(size_t n) const; + + wxString m_id; }; // ---------------------------------------------------------------------------- // A drop target which accepts files (dragged from File Manager or Explorer) // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxFileDropTarget: public wxDropTarget +class WXDLLIMPEXP_CORE wxFileDropTarget: public wxDropTarget { - public: - +public: + wxFileDropTarget() {}; - + virtual bool OnDrop( long x, long y, const void *data, size_t size ); - virtual bool OnDropFiles( long x, long y, - size_t nFiles, const char * const aszFiles[] ); + virtual bool OnDropFiles( long x, long y, + size_t nFiles, const char * const aszFiles[] ); + +protected: - protected: - virtual size_t GetFormatCount() const; virtual wxDataFormat GetFormat(size_t n) const; }; @@ -134,36 +129,36 @@ class WXDLLEXPORT wxFileDropTarget: public wxDropTarget enum wxDragResult { - wxDragError, // error prevented the d&d operation from completing - wxDragNone, // drag target didn't accept the data - wxDragCopy, // the data was successfully copied - wxDragMove, // the data was successfully moved - wxDragCancel // the operation was cancelled by user (not an error) + wxDragError, // error prevented the d&d operation from completing + wxDragNone, // drag target didn't accept the data + wxDragCopy, // the data was successfully copied + wxDragMove, // the data was successfully moved + wxDragCancel // the operation was cancelled by user (not an error) }; -class WXDLLEXPORT wxDropSource: public wxObject +class WXDLLIMPEXP_CORE wxDropSource: public wxObject { - public: +public: wxDropSource( wxWindow *win ); wxDropSource( wxDataObject &data, wxWindow *win ); - - ~wxDropSource(void); - + + virtual ~wxDropSource(void); + void SetData( wxDataObject &data ); - wxDragResult DoDragDrop( bool bAllowMove = FALSE ); - - virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; }; - - // implementation + wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); + + virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return true; }; + + // implementation #if 0 void RegisterWindow(void); void UnregisterWindow(void); - + wxWindow *m_window; wxDragResult m_retValue; wxDataObject *m_data; - + wxCursor m_defaultCursor; wxCursor m_goaheadCursor; #endif @@ -171,8 +166,7 @@ class WXDLLEXPORT wxDropSource: public wxObject #endif - // wxUSE_DRAG_AND_DROP - -#endif - //_WX_DND_H_ +// wxUSE_DRAG_AND_DROP +#endif +//_WX_DND_H_