From 47d455dd55be855e4cc691c32f687f723d9247ee Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kcoloredit/kcoloreditview.h | 128 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 kcoloredit/kcoloreditview.h (limited to 'kcoloredit/kcoloreditview.h') diff --git a/kcoloredit/kcoloreditview.h b/kcoloredit/kcoloreditview.h new file mode 100644 index 00000000..ec0ca17f --- /dev/null +++ b/kcoloredit/kcoloreditview.h @@ -0,0 +1,128 @@ +/*************************************************************************** + kcoloreditview.h - description + ------------------- + begin : Sat Jul 8 09:57:28 CEST 2000 + copyright : (C) 2000 by Artur Rataj + email : art@zeus.polsl.gliwice.pl + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KCOLOREDITVIEW_H +#define KCOLOREDITVIEW_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +// include files for Qt +#include +#include +#include + +// application specific includes +#include "colorselector.h" +#include "paletteview.h" + +class KColorEditDoc; + +/** The KColorEditView class provides the view widget for the KColorEditApp instance. + * The View instance inherits QWidget as a base class and represents the view object of a KMainWindow. As KColorEditView is part of the + * docuement-view model, it needs a reference to the document object connected with it by the KColorEditApp class to manipulate and display + * the document structure provided by the KColorEditDoc class. + * + * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team. + * @version KDevelop version 0.4 code generation + */ +class KColorEditView : public QSplitter { + Q_OBJECT + + public: + /** Constructor for the main view */ + KColorEditView(QWidget *parent = 0, const char *name = 0); + /** Destructor for the main view */ + ~KColorEditView(); + + /** returns a pointer to the document connected to the view instance. Mind that this method requires a KColorEditApp instance as a parent + * widget to get to the window document pointer by calling the KColorEditApp::getDocument() method. + * + * @see KColorEditApp#getDocument + */ + KColorEditDoc *document() const; + + /** Contains the implementation for printing functionality */ + void print(QPrinter *pPrinter); + /** Chooses a color to the color selector */ + void chooseColor(Color* const color); + /** Updates the view after the document has been changed */ + void redraw(bool newDocument); + + public slots: + /** Notifies that the cursor position changed */ + void slotCursorPosChanged(int position); + /** Whether to view color names */ + void slotViewColorNames(bool viewColorNames); + + protected: + ColorSelector* colorSelector; + PaletteView* paletteView; + + protected slots: + /** Adds a color from color selector at cursor position. It inserts or replaces a color, + * depending on addColorMode + */ + void slotAddColor(); + /** Sets if add a color at cursor */ + void slotAddColorAtCursor(bool atCursor); + /** Sets whether insert or replace a color */ + void slotAddColorOverwrite(bool overwrite); + /** Sets a color name */ + void slotSetColorName(const QString& name); + + protected: + /** Add color mode constants */ + enum { INSERT_COLOR = 0, + REPLACE_COLOR = 1 }; + + /** Color mode widget */ + QCheckBox* overwriteCheckBox; + /** Color name widget */ + QLineEdit* colorName; + /** H component value label of the color at cursor */ + QLabel* colorAtCursorHValueLabel; + /** S component value label of the color at cursor */ + QLabel* colorAtCursorSValueLabel; + /** V component value label of the color at cursor */ + QLabel* colorAtCursorVValueLabel; + /** R component value label of the color at cursor */ + QLabel* colorAtCursorRValueLabel; + /** G component value label of the color at cursor */ + QLabel* colorAtCursorGValueLabel; + /** B component value label of the color at cursor */ + QLabel* colorAtCursorBValueLabel; + /** RGB Hex string value label of the color at cursor */ + QLabel* colorAtCursorRgbStringValueLabel; + /** If add a color at cursor */ + bool addColorAtCursor; + /** Add color mode */ + int addColorMode; + /** If in color name changing */ + bool inColorNameChanging; + /** Whether not to update color labels */ + bool doNotUpdateColorLabels; + + protected: + /** Sets component value label of the color at cursor sizes */ + void setColorAtCursorComponentValueLabelSizes(QLabel* const label); + /** Updates color value labels */ + void updateColorValueLabels(); +}; + +#endif // KCOLOREDITVIEW_H -- cgit v1.2.1