25 #ifndef KDELIBS_KCOLORDIALOG_H
26 #define KDELIBS_KCOLORDIALOG_H
30 #include <tqcolordialog.h>
31 #define KColorDialog QColorDialog
33 #include <kdialogbase.h>
36 #include <tqgridview.h>
38 #include "tdeselect.h"
66 KHSSelector( TQWidget *parent=0,
const char *name=0 );
73 virtual void drawPalette( TQPixmap *pixmap );
74 virtual void resizeEvent( TQResizeEvent * );
84 void updateContents();
88 virtual void virtual_hook(
int id,
void* data );
90 class KHSSelectorPrivate;
91 KHSSelectorPrivate *d;
95 class KValueSelectorPrivate;
114 KValueSelector( Orientation o, TQWidget *parent = 0,
const char *name = 0 );
120 int saturation()
const
122 void setSaturation(
int s )
125 void updateContents();
131 virtual void drawPalette( TQPixmap *pixmap );
132 virtual void resizeEvent( TQResizeEvent * );
147 virtual void virtual_hook(
int id,
void* data );
149 class KValueSelectorPrivate;
150 KValueSelectorPrivate *d;
164 class TDEUI_EXPORT
KColor :
public TQColor
169 KColor(
const TQColor &col);
173 bool operator==(
const KColor& col)
const;
175 void setHsv(
int _h,
int _s,
int _v);
176 void setRgb(
int _r,
int _g,
int _b);
178 void rgb(
int *_r,
int *_g,
int *_b)
const;
179 void hsv(
int *_h,
int *_s,
int *_v)
const;
202 KPaletteTable( TQWidget *parent,
int minWidth=210,
int cols = 16);
204 void addToCustomColors(
const TQColor &);
205 void addToRecentColors(
const TQColor &);
206 TQString palette()
const;
208 void setPalette(
const TQString &paletteName);
210 void colorSelected(
const TQColor &,
const TQString & );
211 void colorDoubleClicked(
const TQColor &,
const TQString & );
214 void slotColorCellSelected(
int );
215 void slotColorCellDoubleClicked(
int );
216 void slotColorTextSelected(
const TQString &colorText );
217 void slotSetPalette(
const TQString &_paletteName );
218 void slotShowNamedColorReadError(
void );
221 void readNamedColor(
void );
239 virtual void setPalette(
const TQPalette& p) { TQWidget::setPalette(p); }
241 virtual void virtual_hook(
int id,
void* data );
243 class KPaletteTablePrivate;
244 KPaletteTablePrivate *d;
257 KColorCells( TQWidget *parent,
int rows,
int cols );
260 void setColor(
int colNum,
const TQColor &col );
261 TQColor color(
int indx )
const
262 {
return colors[indx]; }
264 {
return numRows() * numCols(); }
266 void setShading(
bool _shade) { shade = _shade; }
268 void setAcceptDrags(
bool _acceptDrags) { acceptDrags = _acceptDrags; }
270 int getSelected()
const
274 void colorSelected(
int col );
275 void colorDoubleClicked(
int col );
278 virtual void paintCell( TQPainter *painter,
int row,
int col );
279 virtual void resizeEvent( TQResizeEvent * );
280 virtual void mouseReleaseEvent( TQMouseEvent * );
281 virtual void mousePressEvent( TQMouseEvent * );
282 virtual void mouseMoveEvent( TQMouseEvent * );
283 virtual void dragEnterEvent( TQDragEnterEvent *);
284 virtual void dropEvent( TQDropEvent *);
285 virtual void mouseDoubleClickEvent( TQMouseEvent * );
287 int posToCell(
const TQPoint &pos,
bool ignoreBorders=
false);
297 virtual void virtual_hook(
int id,
void* data );
299 class KColorCellsPrivate;
300 KColorCellsPrivate *d;
318 void setColor(
const TQColor &col );
321 void colorChanged(
const TQColor&);
325 virtual void mouseMoveEvent( TQMouseEvent * );
326 virtual void dragEnterEvent( TQDragEnterEvent *);
327 virtual void dropEvent( TQDropEvent *);
335 virtual void virtual_hook(
int id,
void* data );
337 class KColorPatchPrivate;
338 KColorPatchPrivate *d;
385 KColorDialog( TQWidget *parent = 0L,
const char *name = 0L,
386 bool modal =
false );
395 TQColor color()
const;
405 static int getColor( TQColor &theColor, TQWidget *parent=0L );
419 static int getColor( TQColor &theColor,
const TQColor& defaultColor, TQWidget *parent=0L );
424 static TQColor grabColor(
const TQPoint &p);
432 void setDefaultColor(
const TQColor& defaultCol );
437 TQColor defaultColor()
const;
443 void setColor(
const TQColor &col );
454 void slotRGBChanged(
void );
455 void slotHSVChanged(
void );
456 void slotHtmlChanged(
void );
457 void slotHSChanged(
int,
int );
458 void slotVChanged(
int );
459 void slotColorSelected(
const TQColor &col );
460 void slotColorSelected(
const TQColor &col,
const TQString &name );
461 void slotColorDoubleClicked(
const TQColor &col,
const TQString &name );
462 void slotColorPicker();
463 void slotAddToCustomColors();
464 void slotDefaultColorClicked();
468 void slotWriteSettings();
476 void setRgbEdit(
const KColor &col );
477 void setHsvEdit(
const KColor &col );
478 void setHtmlEdit(
const KColor &col );
479 void _setColor(
const KColor &col,
const TQString &name=TQString::null );
480 void showColor(
const KColor &color,
const TQString &name );
483 virtual void mouseReleaseEvent( TQMouseEvent * );
484 virtual void keyPressEvent( TQKeyEvent * );
485 virtual bool eventFilter( TQObject *obj, TQEvent *ev );
488 virtual void virtual_hook(
int id,
void* data );
490 class KColorDialogPrivate;
491 KColorDialogPrivate *d;
A table of editable color cells.
A color selection dialog.
void colorSelected(const TQColor &col)
Emitted when a color is selected.
A color class that preserves both RGB and HSV values.
A dialog base class with standard buttons and predefined layouts.
Widget for Hue/Saturation colour selection.
A color palette in table form.
TQString i18n_recentColors
TQString i18n_customColors
TQString i18n_namedColors
Widget for color value selection.
KXYSelector is the base class for other widgets which provides the ability to choose from a two-dimen...
virtual void drawContents(TQPainter *)
Override this function to draw the contents of the widget.
A variant of TQListBox that honors KDE's system-wide settings.
TDESelector is the base class for other widgets which provides the ability to choose from a one-dimen...