00001 #ifndef COIN_SOQTCOLOREDITOR_H
00002 #define COIN_SOQTCOLOREDITOR_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <Inventor/Qt/nodes/SoGuiColorEditor.h>
00028 #include <Inventor/Qt/SoQtRenderArea.h>
00029
00030 typedef void SoQtColorEditorCB(void * closure, const SbColor * color);
00031
00032 class SbColor;
00033 class SoSFColor;
00034 class SoMFColor;
00035 class SoMFUInt32;
00036
00037 class SoQtColorEditor : public SoQtRenderArea {
00038 SOQT_OBJECT_HEADER(SoQtColorEditor, SoQtRenderArea);
00039
00040 public:
00041 SoQtColorEditor(QWidget * parent = NULL, const char * name = NULL, SbBool embed = TRUE);
00042 ~SoQtColorEditor(void);
00043
00044 enum Sliders {
00045 NONE = SoGuiColorEditor::NONE,
00046 INTENSITY = SoGuiColorEditor::INTENSITY,
00047 RGB = SoGuiColorEditor::RGB,
00048 HSV = SoGuiColorEditor::HSV,
00049 RGB_V = SoGuiColorEditor::RGB_V,
00050 RGB_HSV = SoGuiColorEditor::RGB_HSV
00051 };
00052
00053 enum UpdateFrequency {
00054 CONTINUOUS = SoGuiColorEditor::CONTINUOUS,
00055 AFTER_ACCEPT = SoGuiColorEditor::AFTER_ACCEPT
00056 };
00057
00058 void attach(SoSFColor * color, SoBase * node = NULL);
00059 void attach(SoMFColor * color, int idx = 0, SoBase * node = NULL);
00060 void attach(SoMFUInt32 * color, int idx = 0, SoBase * node = NULL);
00061 void detach(void);
00062 SbBool isAttached(void) const;
00063
00064 void addColorChangedCallback(SoQtColorEditorCB * cb, void * closure = NULL);
00065 void removeColorChangedCallback(SoQtColorEditorCB * cb, void * closure = NULL);
00066
00067 void setColor(const SbColor & color);
00068 const SbColor & getColor(void) const;
00069
00070 void setWYSIWYG(SbBool enable);
00071 SbBool isWYSIWYG(void) const;
00072
00073 void setCurrentSliders(Sliders which);
00074 Sliders getCurrentSliders(void) const;
00075
00076 void setUpdateFrequency(UpdateFrequency freq);
00077 UpdateFrequency getUpdateFrequency(void) const;
00078
00079 SoGuiColorEditor * getEditor(void) const;
00080
00081 protected:
00082 virtual const char * getDefaultWidgetName(void) const;
00083 virtual const char * getDefaultTitle(void) const;
00084 virtual const char * getDefaultIconTitle(void) const;
00085
00086 private:
00087 void * internals;
00088
00089 };
00090
00091 #endif // !COIN_SOQTCOLOREDITOR_H