vtkFetchMIQueryTermWidget.h

Go to the documentation of this file.
00001 #ifndef __vtkFetchMIQueryTermWidget_h
00002 #define __vtkFetchMIQueryTermWidget_h
00003 
00004 
00005 #include "vtkFetchMIWin32Header.h"
00006 #include "vtkFetchMIMulticolumnWidget.h"
00007 #include "vtkFetchMILogic.h"
00008 #include <string>
00009 #include <vector>
00010 #include <map>
00011 #include <iterator>
00012 
00013 class vtkKWPushButton;
00014 class vtkFetchMIIcons;
00015 
00016 class VTK_FETCHMI_EXPORT vtkFetchMIQueryTermWidget : public vtkFetchMIMulticolumnWidget
00017 {
00018   
00019 public:
00020   static vtkFetchMIQueryTermWidget* New();
00021   vtkTypeRevisionMacro(vtkFetchMIQueryTermWidget,vtkFetchMIMulticolumnWidget);
00022   void PrintSelf(ostream& os, vtkIndent indent);
00023 
00024   // Description:
00025   // Get methods on class members ( no Set methods required. )
00026   vtkGetObjectMacro ( SelectAllButton, vtkKWPushButton);
00027   vtkGetObjectMacro ( DeselectAllButton, vtkKWPushButton);
00028   vtkGetObjectMacro ( HelpButton, vtkKWPushButton );
00029   vtkGetObjectMacro ( ClearAllButton, vtkKWPushButton);
00030   vtkGetObjectMacro ( ClearSelectedButton, vtkKWPushButton);
00031   vtkGetObjectMacro ( SearchButton, vtkKWPushButton );
00032   vtkGetObjectMacro ( RefreshButton, vtkKWPushButton );
00033   vtkGetObjectMacro ( FetchMIIcons, vtkFetchMIIcons );
00034   vtkGetObjectMacro ( Logic, vtkFetchMILogic );
00035   vtkSetObjectMacro ( Logic, vtkFetchMILogic );
00036   vtkGetMacro ( InPopulateWidget, int );
00037   vtkSetMacro ( InPopulateWidget, int );
00038   
00039   // Description:
00040   // not used. New method AddNewTagForQuery is used instead.
00041   virtual void AddNewItem ( const char *keyword, const char *value);
00042   //BTX
00043   using vtkFetchMIMulticolumnWidget::AddNewItem; 
00044   //ETX
00045   
00046   //BTX
00047   // Description:
00048   // Method to add a new keyword and list of possible values to the tag list
00049   virtual void AddNewTagForQuery ( const char *keyword,
00050                             std::vector<std::string> values );
00051   //ETX
00052 
00053   // Description:
00054   // Method to add all metadata known by the selected webservice in one shot.
00055   virtual void PopulateFromServer ( );
00056 
00057   // Description:
00058   // returns the row number of that attribute.
00059   int GetRowForAttribute ( const char *attribute );
00060 
00061   // Description:
00062   // alternative method to propagate events generated in GUI to logic / mrml
00063   virtual void ProcessWidgetEvents ( vtkObject *caller, unsigned long event, void *callData );
00064   
00065   // Description:
00066   // alternative method to propagate events generated in GUI to logic / mrml
00067   virtual void ProcessMRMLEvents ( vtkObject *caller, unsigned long event, void *callData );
00068   
00069   // Description:
00070   // removes observers on widgets in the class
00071   virtual void RemoveWidgetObservers ( );
00072   // Description:
00073   // adds observers on widgets in the class
00074   virtual void AddWidgetObservers ( );
00075 
00076   // Description:
00077   // add observers on node
00078   virtual void AddMRMLObservers ( );
00079 
00080   // Description:
00081   // remove observers on  node
00082   virtual void RemoveMRMLObservers ( );
00083 
00084   // Description:
00085   // Selection methods
00086   virtual void SelectRow ( int i );
00087   virtual void SelectAllItems();
00088   virtual void DeselectAllItems();
00089   virtual void SetStatusText(const char *txt);
00090 
00091   // Description:
00092   // Methods to operate on selected items.
00093   virtual int IsItemSelected(int i);
00094   virtual const char *GetAttributeOfItem (int i );
00095   virtual const char *GetValueOfItem (int i );
00096   virtual void DeleteSelectedItems();
00097   virtual int GetNumberOfSelectedItems();
00098   virtual const char *GetNthSelectedAttribute(int n);
00099   virtual const char *GetNthSelectedValue(int n);
00100   virtual void SelectValueOfItem(int i, const char *val );
00101 
00102   //BTX
00103   enum
00104     {
00105       TagChangedEvent = 11000,
00106       QuerySubmittedEvent,
00107     };
00108   //ETX
00109 
00110   // Description:
00111   // editing callback for the multicolumn list
00112   void RightClickListCallback(int row, int col, int x, int y);
00113   
00114  protected:
00115   vtkFetchMIQueryTermWidget();
00116   virtual ~vtkFetchMIQueryTermWidget();
00117 
00118   // Custom buttons and icons
00119   vtkKWPushButton *SelectAllButton;
00120   vtkKWPushButton *DeselectAllButton;
00121   vtkKWPushButton *ClearAllButton;
00122   vtkKWPushButton *ClearSelectedButton;
00123   vtkKWPushButton *SearchButton;
00124   vtkKWPushButton *HelpButton;
00125   vtkKWPushButton *RefreshButton;
00126   vtkFetchMIIcons *FetchMIIcons;
00127   vtkFetchMILogic *Logic;
00128   int InPopulateWidget;
00129 
00130   // Description:
00131   // Create the widget.
00132   virtual void CreateWidget();
00133 
00134   // Description:
00135   // Display a window that has tips on using the interface.
00136   virtual void RaiseHelpWindow();
00137   
00138   // Description:
00139   // Update the widget from MRML
00140   void UpdateWidget();
00141   
00142   void UpdateMRML();
00143 
00144   vtkFetchMIQueryTermWidget(const vtkFetchMIQueryTermWidget&); // Not implemented
00145   void operator=(const vtkFetchMIQueryTermWidget&); // Not Implemented
00146 };
00147 
00148 #endif
00149 

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1