• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kstars

ColorScheme Class Reference

This class stores all of the adjustable colors in KStars, in a QMap object keyed by the names of the colors. More...

#include <colorscheme.h>

List of all members.


Public Member Functions

QString colorAt (int i) const
QString colorNamed (const QString &name) const
 ColorScheme (const ColorScheme &cs)
 ColorScheme ()
void copy (const ColorScheme &cs)
QString fileName () const
bool hasColorNamed (const QString &name) const
QString keyAt (int i) const
bool load (const QString &filename)
void loadFromConfig (KConfig *)
QString nameAt (int i) const
QString nameFromKey (const QString &key) const
unsigned int numberOfColors () const
bool save (const QString &name)
void saveToConfig (KConfig *)
void setColor (const QString &key, const QString &color)
void setStarColorIntensity (int intens)
void setStarColorMode (int mode)
int starColorIntensity () const
int starColorMode () const
 ~ColorScheme ()

Detailed Description

This class stores all of the adjustable colors in KStars, in a QMap object keyed by the names of the colors.

It also stores information on how stars are to be rendered in the map (with realistic colors, or as solid red/whit/black circles). In addition to the brief "Key names" used to index the colors in the QMap, each color has a "long name" description that is a bit more verbose, and suitable for UI display.

Author:
Jason Harris
Version:
1.0

Definition at line 39 of file colorscheme.h.


Constructor & Destructor Documentation

ColorScheme::ColorScheme (  ) 

Constructor.

Enter all adjustable colors and their default values into the QMap. Also assign the corresponding long names.

Definition at line 30 of file colorscheme.cpp.

ColorScheme::ColorScheme ( const ColorScheme &  cs  ) 

Copy constructor.

Definition at line 121 of file colorscheme.cpp.

ColorScheme::~ColorScheme (  ) 

Destructor.

Definition at line 131 of file colorscheme.cpp.


Member Function Documentation

QString ColorScheme::colorAt ( int  i  )  const

i the index of the color to retrieve

Returns:
a color by its index in the QMap

Definition at line 155 of file colorscheme.cpp.

QString ColorScheme::colorNamed ( const QString &  name  )  const

Retrieve a color by name.

name the key name of the color to be retrieved.

Returns:
the requested color, or "#FFFFFF" (white) if color name not found.

Definition at line 144 of file colorscheme.cpp.

void ColorScheme::copy ( const ColorScheme &  cs  ) 

Copy a color scheme cs the color scheme to be copied into this object.

Definition at line 134 of file colorscheme.cpp.

QString ColorScheme::fileName (  )  const [inline]

Returns:
the Filename associated with the color scheme.

Definition at line 108 of file colorscheme.h.

bool ColorScheme::hasColorNamed ( const QString &  name  )  const [inline]

Returns:
true if the Palette contains the given key name

Definition at line 58 of file colorscheme.h.

QString ColorScheme::keyAt ( int  i  )  const

i the index of the key name to retrieve

Returns:
the key name of the color at index i

Definition at line 165 of file colorscheme.cpp.

bool ColorScheme::load ( const QString &  filename  ) 

Load a color scheme from a *.colors file filename the filename of the color scheme to be loaded.

Returns:
TRUE if the scheme was successfully loaded

Definition at line 179 of file colorscheme.cpp.

void ColorScheme::loadFromConfig ( KConfig *  conf  ) 

Read color-scheme data from the Config object.

Definition at line 293 of file colorscheme.cpp.

QString ColorScheme::nameAt ( int  i  )  const

i the index of the long name to retrieve

Returns:
the name of the color at index i

Definition at line 160 of file colorscheme.cpp.

QString ColorScheme::nameFromKey ( const QString &  key  )  const

Returns:
the long name of the color whose key name is given key the key name identifying the color.

Definition at line 170 of file colorscheme.cpp.

unsigned int ColorScheme::numberOfColors (  )  const [inline]

Returns:
the number of colors in the color scheme.

Definition at line 124 of file colorscheme.h.

bool ColorScheme::save ( const QString &  name  ) 

Save the current color scheme to a *.colors file.

name the filename to create

Returns:
TRUE if the color scheme is successfully writeen to a file

Definition at line 243 of file colorscheme.cpp.

void ColorScheme::saveToConfig ( KConfig *  conf  ) 

Save color-scheme data to the Config object.

Definition at line 303 of file colorscheme.cpp.

void ColorScheme::setColor ( const QString &  key,
const QString &  color 
)

Change the color with the given key to the given value key the key-name of the color to be changed color the new color value.

Definition at line 174 of file colorscheme.cpp.

void ColorScheme::setStarColorIntensity ( int  intens  )  [inline]

Set the star color intensity value used by the color scheme.

Definition at line 136 of file colorscheme.h.

void ColorScheme::setStarColorMode ( int  mode  )  [inline]

Set the star color mode used by the color scheme.

Definition at line 133 of file colorscheme.h.

int ColorScheme::starColorIntensity (  )  const [inline]

Returns:
the star color intensity value used by the color scheme

Definition at line 130 of file colorscheme.h.

int ColorScheme::starColorMode (  )  const [inline]

Returns:
the star color mode used by the color scheme

Definition at line 127 of file colorscheme.h.


The documentation for this class was generated from the following files:
  • colorscheme.h
  • colorscheme.cpp

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal