00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00030 #ifndef __vtkKWDragAndDropTargetSet_h
00031 #define __vtkKWDragAndDropTargetSet_h
00032
00033 #include "vtkKWObject.h"
00034
00035 class vtkKWWidget;
00036 class vtkKWDragAndDropTargetSetInternals;
00037
00038 class KWWidgets_EXPORT vtkKWDragAndDropTargetSet : public vtkKWObject
00039 {
00040
00041 public:
00042 static vtkKWDragAndDropTargetSet* New();
00043 vtkTypeRevisionMacro(vtkKWDragAndDropTargetSet,vtkKWObject);
00044 void PrintSelf(ostream& os, vtkIndent indent);
00045
00047
00048 virtual void SetEnable(int);
00049 vtkBooleanMacro(Enable, int);
00050 vtkGetMacro(Enable, int);
00052
00054
00057 virtual void SetSource(vtkKWWidget*);
00058 vtkGetObjectMacro(Source, vtkKWWidget);
00060
00062
00069 virtual void SetSourceAnchor(vtkKWWidget*);
00070 vtkGetObjectMacro(SourceAnchor, vtkKWWidget);
00072
00074
00075 virtual int AddTarget(vtkKWWidget *target);
00076 virtual int RemoveTarget(vtkKWWidget *target);
00077 virtual int HasTarget(vtkKWWidget *target);
00078 virtual int GetNumberOfTargets();
00080
00082
00096 virtual int SetTargetStartCommand(
00097 vtkKWWidget *target, vtkObject *object, const char *method);
00098 virtual int SetTargetPerformCommand(
00099 vtkKWWidget *target, vtkObject *object, const char *method);
00100 virtual int SetTargetEndCommand(
00101 vtkKWWidget *target, vtkObject *object, const char *method);
00103
00105
00117 virtual void SetStartCommand(vtkObject *object, const char *method);
00118 virtual void SetPerformCommand(vtkObject *object, const char *method);
00119 virtual void SetEndCommand(vtkObject *object, const char *method);
00121
00123
00124 virtual void StartCallback(int x, int y);
00125 virtual void PerformCallback(int x, int y);
00126 virtual void EndCallback(int x, int y);
00128
00129
00130
00131 protected:
00132 vtkKWDragAndDropTargetSet();
00133 ~vtkKWDragAndDropTargetSet();
00134
00135
00136
00137
00138
00139 class TargetSlot
00140 {
00141 public:
00142 vtkKWWidget *Target;
00143 char *StartCommand;
00144 char *PerformCommand;
00145 char *EndCommand;
00146
00147 void SetStartCommand(const char*);
00148 void SetEndCommand(const char*);
00149 void SetPerformCommand(const char*);
00150
00151 TargetSlot();
00152 ~TargetSlot();
00153 };
00154
00155
00156
00157 vtkKWDragAndDropTargetSetInternals *Internals;
00158 friend class vtkKWDragAndDropTargetSetInternals;
00159
00160 TargetSlot* GetTarget(vtkKWWidget *target);
00161
00162
00163
00164 int Enable;
00165
00166 vtkKWWidget *SourceAnchor;
00167 vtkKWWidget *Source;
00168
00169 char *StartCommand;
00170 char *PerformCommand;
00171 char *EndCommand;
00172 virtual void InvokeCommandWithCoordinates(const char *command, int x, int y);
00173 virtual void InvokeStartCommand(int x, int y);
00174 virtual void InvokePerformCommand(int x, int y);
00175 virtual void InvokeEndCommand(int x, int y);
00176
00177 virtual void AddBindings();
00178 virtual void RemoveBindings();
00179 virtual void DeleteAllTargets();
00180
00181
00182
00183 private:
00184
00185 vtkKWDragAndDropTargetSet(const vtkKWDragAndDropTargetSet&);
00186 void operator=(const vtkKWDragAndDropTargetSet&);
00187 };
00188
00189 #endif
00190