Databaseconnectionclasses  0.5.3
hk_colour.h
1 // ****************************************************************************
2 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
3 // This file is part of the hk_classes library.
4 // This file may be distributed and/or modified under the terms of the
5 // GNU Library Public License version 2 as published by the Free Software
6 // Foundation and appearing in the file COPYING included in the
7 // packaging of this file.
8 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
9 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10 // ****************************************************************************
11 #ifndef HK_COLOUR_H
12 #define HK_COLOUR_H
13 #include "hk_class.h"
14 #include <iostream>
24 class hk_colour: public hk_class
25 {
26  friend istream& operator>>(istream&,hk_colour&);
27  friend ostream& operator<<(ostream&,hk_colour&);
28  public:
29 
30  typedef int hk_colourtype ;
31 
32  hk_colour(void);
33  hk_colour(hk_colourtype red, hk_colourtype green, hk_colourtype blue);
34  hk_colour(const hk_colour&);
35  virtual ~hk_colour();
40  bool set_colour(hk_colourtype red, hk_colourtype green, hk_colourtype blue);
41  hk_colourtype red(void) const;
42  hk_colourtype green(void) const;
43  hk_colourtype blue(void) const;
44  bool operator=(const hk_colour&);
45  bool operator==(const hk_colour&);
46  bool operator!=(const hk_colour&);
47 
48  virtual void savedata(ostream& s );
49 virtual void loaddata(xmlNodePtr definition);
50 
51  protected:
52 
53  private:
54  void set_hk_colour( const hk_colour&);
55  bool is_equal(const hk_colour&);
56  hk_colourtype p_red;
57  hk_colourtype p_green;
58  hk_colourtype p_blue;
59 
60 };
61 
62 ostream& operator<<(ostream&,hk_colour&);
63 ostream& operator<<(ostream&,const hk_colour&);
64 
65 const hk_colour hk_aqua(0,255,255);
66 const hk_colour hk_beige(0xF5,0xF5,0xDC);
67 const hk_colour hk_black(0,0,0);
68 const hk_colour hk_blue(0,0,255);
69 const hk_colour hk_brown(0xA5,0x2A,0x2A);
70 const hk_colour hk_fuchsia(255,0,255);
71 const hk_colour hk_darkgrey(0xA9,0xA9,0xA9);
72 const hk_colour hk_darkyellow(0xEE,0xCA,0x16);
73 const hk_colour hk_green(0,128,0);
74 const hk_colour hk_grey(128,128,128);
75 const hk_colour hk_lightgrey(0xD3,0xD3,0xD3);
76 const hk_colour hk_lime(0,255,0);
77 const hk_colour hk_maroon(128,0,0);
78 const hk_colour hk_navy(0,0,128);
79 const hk_colour hk_olive(128,128,0);
80 const hk_colour hk_orange(0xFF,0xA5,0);
81 const hk_colour hk_pink(0xFF,0xC0,0xCB);
82 const hk_colour hk_purple(128,0,128);
83 const hk_colour hk_red(255,0,0);
84 const hk_colour hk_silver(0,0xc0,0xc0);
85 const hk_colour hk_teal(0,128,128); //aquamarin
86 const hk_colour hk_white(255,255,255);
87 const hk_colour hk_yellow(255,255,0);
88 #endif //HK_COLOUR_H
basic class for all other defined classes.
Definition: hk_class.h:52
virtual void loaddata(xmlNodePtr definition)
Definition: hk_colour.cpp:123
bool set_colour(hk_colourtype red, hk_colourtype green, hk_colourtype blue)
Definition: hk_colour.cpp:42
represents a RGB-colour
Definition: hk_colour.h:24
virtual void savedata(ostream &s)
Definition: hk_colour.cpp:108