1 /** @file
2 * @brief Color swatches dialog
3 */
4 /* Authors:
5 * Jon A. Cruz
6 *
7 * Copyright (C) 2005 Jon A. Cruz
8 * Released under GNU GPL, read the file 'COPYING' for more information
9 */
10 #ifndef SEEN_DIALOGS_SWATCHES_H
11 #define SEEN_DIALOGS_SWATCHES_H
13 #include <gtkmm/textview.h>
15 #include "ui/widget/panel.h"
17 namespace Inkscape {
18 namespace UI {
20 class PreviewHolder;
22 namespace Dialogs {
24 class ColorItem;
25 class SwatchPage;
27 /**
28 * A panel that displays paint swatches.
29 */
30 class SwatchesPanel : public Inkscape::UI::Widget::Panel
31 {
32 public:
33 SwatchesPanel(gchar const* prefsPath = "/dialogs/swatches");
34 virtual ~SwatchesPanel();
36 static SwatchesPanel& getInstance();
38 virtual void setOrientation( Gtk::AnchorType how );
40 virtual void setDesktop( SPDesktop* desktop );
41 virtual SPDesktop* getDesktop() {return _currentDesktop;}
43 virtual int getSelectedIndex() {return _currentIndex;} // temporary
45 protected:
46 static void handleGradientsChange(SPDocument *document);
48 virtual void _updateFromSelection();
49 virtual void _handleAction( int setId, int itemId );
50 virtual void _setDocument( SPDocument *document );
51 virtual void _rebuild();
53 virtual std::vector<SwatchPage*> _getSwatchSets() const;
55 private:
56 SwatchesPanel(SwatchesPanel const &); // no copy
57 SwatchesPanel &operator=(SwatchesPanel const &); // no assign
59 static void _trackDocument( SwatchesPanel *panel, SPDocument *document );
60 static void handleDefsModified(SPDocument *document);
62 PreviewHolder* _holder;
63 ColorItem* _clear;
64 ColorItem* _remove;
65 int _currentIndex;
66 SPDesktop* _currentDesktop;
67 SPDocument* _currentDocument;
69 sigc::connection _documentConnection;
70 sigc::connection _selChanged;
71 };
73 } //namespace Dialogs
74 } //namespace UI
75 } //namespace Inkscape
79 #endif // SEEN_SWATCHES_H
81 /*
82 Local Variables:
83 mode:c++
84 c-file-style:"stroustrup"
85 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
86 indent-tabs-mode:nil
87 fill-column:99
88 End:
89 */
90 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :