vtkFetchMIFlatResourceWidget.h

Go to the documentation of this file.
00001 #ifndef __vtkFetchMIFlatResourceWidget_h
00002 #define __vtkFetchMIFlatResourceWidget_h
00003 
00004 
00005 #include "vtkFetchMIWin32Header.h"
00006 #include "vtkFetchMIMulticolumnWidget.h"
00007 #include "vtkFetchMILogic.h"
00008 #include "vtkSlicerFoundationIcons.h"
00009 #include "vtkSlicerApplication.h"
00010 #include "vtkSlicerApplicationGUI.h"
00011 #include "vtkSlicerWindow.h"
00012 class vtkKWPushButton;
00013 class vtkFetchMIIcons;
00014 
00015 class VTK_FETCHMI_EXPORT vtkFetchMIFlatResourceWidget : public vtkFetchMIMulticolumnWidget
00016 {
00017   
00018 public:
00019   static vtkFetchMIFlatResourceWidget* New();
00020   vtkTypeRevisionMacro(vtkFetchMIFlatResourceWidget,vtkFetchMIMulticolumnWidget);
00021   void PrintSelf(ostream& os, vtkIndent indent);
00022 
00023   // Description:
00024   // Get methods on class members ( no Set methods required. )
00025   vtkGetObjectMacro ( SelectAllButton, vtkKWPushButton);
00026   vtkGetObjectMacro ( DeselectAllButton, vtkKWPushButton);
00027   vtkGetObjectMacro ( HelpButton, vtkKWPushButton );
00028   vtkGetObjectMacro ( ClearAllButton, vtkKWPushButton);
00029   vtkGetObjectMacro ( ClearSelectedButton, vtkKWPushButton);
00030   vtkGetObjectMacro ( DownloadSelectedButton, vtkKWPushButton );
00031   vtkGetObjectMacro ( DeleteButton, vtkKWPushButton );
00032   vtkGetObjectMacro ( FetchMIIcons, vtkFetchMIIcons );
00033   vtkGetObjectMacro ( Logic, vtkFetchMILogic );
00034   vtkSetObjectMacro ( Logic, vtkFetchMILogic );
00035 
00036 
00037   // Description:
00038   // Method to add a new resource to the resource list.
00039   virtual void AddNewItem ( const char *uri, const char *dtype);
00040   //BTX
00041   using vtkFetchMIMulticolumnWidget::AddNewItem; 
00042   //ETX
00043   
00044   // Description:
00045   // alternative method to propagate events generated in GUI to logic / mrml
00046   virtual void ProcessWidgetEvents ( vtkObject *caller, unsigned long event, void *callData );
00047   
00048   // Description:
00049   // alternative method to propagate events generated in GUI to logic / mrml
00050   virtual void ProcessMRMLEvents ( vtkObject *caller, unsigned long event, void *callData );
00051   
00052   // Description:
00053   // removes observers on widgets in the class
00054   virtual void RemoveWidgetObservers ( );
00055   // Description:
00056   // adds observers on widgets in the class
00057   virtual void AddWidgetObservers ( );
00058 
00059   // Description:
00060   // add observers on color node
00061   virtual void AddMRMLObservers ( );
00062 
00063   // Description:
00064   // remove observers on color node
00065   virtual void RemoveMRMLObservers ( );
00066 
00067 
00068 // Description:
00069   // Display a window that has tips on using the interface.
00070   virtual void RaiseHelpWindow();
00071 
00072   // Description:
00073   // Convenience method that prevents other
00074   // listeners from acting on this event once
00075   // its callback has been dispatched.
00076   virtual void SwallowGUIEvent();
00077   
00078   // Description:
00079   // Selection methods
00080   virtual void SelectAllItems();
00081   virtual void DeselectAllItems();
00082   virtual void SelectRow ( int i );
00083   
00084   // Description:
00085   // Methods to operate on selected items.
00086   virtual int IsItemSelected(int i );
00087   virtual void DeleteSelectedItems();
00088   virtual int GetNumberOfSelectedItems();
00089   virtual const char *GetNthSelectedSlicerDataType(int n);
00090   virtual const char *GetNthSelectedURI(int n);
00091   virtual int GetRowForURI(const char *uri );
00092   virtual void SetStatusText (const char *txt);
00093 
00094   // Description:
00095   // editing callback for the multicolumn list
00096   void RightClickListCallback(int row, int col, int x, int y);
00097 
00098   //BTX
00099   enum
00100     {
00101       DeleteResourceEvent = 11000,
00102     };
00103   //ETX
00104   
00105  protected:
00106   vtkFetchMIFlatResourceWidget();
00107   virtual ~vtkFetchMIFlatResourceWidget();
00108 
00109   // Custom buttons and icons
00110   vtkKWPushButton *DownloadSelectedButton;
00111   vtkKWPushButton *DeleteButton;
00112   vtkKWPushButton *SelectAllButton;
00113   vtkKWPushButton *DeselectAllButton;
00114   vtkKWPushButton *HelpButton;
00115   vtkKWPushButton *ClearAllButton;
00116   vtkKWPushButton *ClearSelectedButton;
00117   vtkFetchMIIcons *FetchMIIcons;
00118   vtkFetchMILogic *Logic;
00119 
00120   // Description:
00121   // Create the widget.
00122   virtual void CreateWidget();
00123 
00124   // Description:
00125   // Update the widget, used when the color node id changes
00126   void UpdateWidget();
00127   
00128   void UpdateMRML();
00129 
00130 
00131   vtkFetchMIFlatResourceWidget(const vtkFetchMIFlatResourceWidget&); // Not implemented
00132   void operator=(const vtkFetchMIFlatResourceWidget&); // Not Implemented
00133 };
00134 
00135 #endif
00136 

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1