1 // -*- C++ -*- 2 3 /* 4 * Gnome Chemistry Utils 5 * gccv/fill-item.h 6 * 7 * Copyright (C) 2008-2010 Jean Bréfort <jean.brefort@normalesup.org> 8 * 9 * This program is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU General Public License as 11 * published by the Free Software Foundation; either version 3 of the 12 * License, or (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 22 * USA 23 */ 24 25 #ifndef GCCV_FILL_ITEM_H 26 #define GCCV_FILL_ITEM_H 27 28 /*!\file*/ 29 30 #include "line-item.h" 31 32 namespace gccv { 33 34 /*! 35 @brief Base class for filled items. 36 37 This class has just one important member: the fill color. Although it is 38 not a virtual class, only derived objects should be used. 39 */ 40 class FillItem: public LineItem { 41 public: 42 /*! 43 @param canvas a Canvas. 44 45 Creates a new FillItem and sets it as a child of the root Group of \a canvas. 46 */ 47 FillItem (Canvas *canvas); 48 /*! 49 @param parent the Group to which the new FillItem will be added. 50 @param client the ItemClient for the new FillItem if any. 51 52 Creates a new FillItem inside \a parent and sets \a client as its associated 53 ItemClient. 54 */ 55 FillItem (Group *parent, ItemClient *client = NULL); 56 /*! 57 The destructor. 58 */ 59 virtual ~FillItem (); 60 61 /*! 62 @return the fill color whether it is an automatic color or not. 63 */ 64 GOColor GetEffectiveFillColor () const; 65 66 /*!\fn SetFillColor(GOColor color) 67 @param color the new fill color. 68 69 Sets the fill color for the item. 70 */ 71 /*!\fn GetFillColor() 72 @return the fill color for the item. 73 */ 74 GCCV_ITEM_PROP (GOColor, FillColor) 75 /*!\fn SetAutoFillColor(bool auto) 76 @param auto whether to use a color from the theme. 77 78 if \a auto is true, the color used to fill the shape whill be retrieved from 79 the Gtk+ theme instead of using the FillColor member. 80 */ 81 /*!\fn bool GetAutoFillColor() 82 @return the line color mode, true if automatic, false otherwise. 83 */ 84 GCCV_ITEM_PROP (bool, AutoFillColor) 85 }; 86 87 } 88 89 #endif // GCCV_FILL_ITEM_H 90