• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
colorscheme.h
Go to the documentation of this file.
1 /***************************************************************************
2  colorscheme.h - description
3  -------------------
4  begin : Wed May 8 2002
5  copyright : (C) 2002 by Jason Harris
6  email : kstars@30doradus.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef COLORSCHEME_H_
19 #define COLORSCHEME_H_
20 
21 #include <QColor>
22 #include <QMap>
23 #include <QStringList>
24 
38 class ColorScheme {
39 public:
43  ColorScheme();
44 
46  bool hasColorNamed( const QString &name ) const { return ( Palette.contains( name ) ); }
47 
52  QColor colorNamed( const QString &name ) const;
53 
57  QColor colorAt( int i ) const;
58 
62  QString nameAt( int i ) const;
63 
67  QString keyAt( int i ) const;
68 
72  QString nameFromKey( const QString &key ) const;
73 
78  void setColor( const QString &key, const QString &color );
79 
84  bool load( const QString &filename );
85 
90  bool save( const QString &name );
91 
93  QString fileName() const { return FileName; }
94 
96  void loadFromConfig();
97 
99  void saveToConfig();
100 
102  unsigned int numberOfColors() const { return (int)Palette.size(); }
103 
105  int starColorMode() const { return StarColorMode; }
106 
108  int starColorIntensity() const { return StarColorIntensity; }
109 
113  void setStarColorMode( int mode );
114 
118  void setStarColorIntensity( int intens);
119 
124  void setStarColorModeIntensity( int mode, int intens);
125 
126 private:
128  void appendItem(QString key, QString name, QString def);
129 
130  int StarColorMode, StarColorIntensity;
131  QString FileName;
132  QStringList KeyName, Name, Default;
133  QMap<QString,QString> Palette;
134 };
135 
136 #endif
ColorScheme::setStarColorMode
void setStarColorMode(int mode)
Set the star color mode used by the color scheme mode the star color mode to use. ...
Definition: colorscheme.cpp:288
ColorScheme::setStarColorModeIntensity
void setStarColorModeIntensity(int mode, int intens)
Set the star color mode and intensity value used by the color scheme mode the star color mode to use ...
Definition: colorscheme.cpp:300
ColorScheme::nameAt
QString nameAt(int i) const
i the index of the long name to retrieve
Definition: colorscheme.cpp:110
ColorScheme::colorNamed
QColor colorNamed(const QString &name) const
Retrieve a color by name.
Definition: colorscheme.cpp:97
ColorScheme::starColorIntensity
int starColorIntensity() const
Definition: colorscheme.h:108
ColorScheme::numberOfColors
unsigned int numberOfColors() const
Definition: colorscheme.h:102
ColorScheme::loadFromConfig
void loadFromConfig()
Read color-scheme data from the Config object.
Definition: colorscheme.cpp:266
ColorScheme::keyAt
QString keyAt(int i) const
i the index of the key name to retrieve
Definition: colorscheme.cpp:114
ColorScheme::colorAt
QColor colorAt(int i) const
i the index of the color to retrieve
Definition: colorscheme.cpp:106
ColorScheme::hasColorNamed
bool hasColorNamed(const QString &name) const
Definition: colorscheme.h:46
ColorScheme::load
bool load(const QString &filename)
Load a color scheme from a *.colors file filename the filename of the color scheme to be loaded...
Definition: colorscheme.cpp:130
ColorScheme
This class stores all of the adjustable colors in KStars, in a QMap object keyed by the names of the ...
Definition: colorscheme.h:38
ColorScheme::fileName
QString fileName() const
Definition: colorscheme.h:93
ColorScheme::setColor
void 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 co...
Definition: colorscheme.cpp:122
ColorScheme::setStarColorIntensity
void setStarColorIntensity(int intens)
Set the star color intensity value used by the color scheme intens The star color intensity value...
Definition: colorscheme.cpp:294
ColorScheme::saveToConfig
void saveToConfig()
Save color-scheme data to the Config object.
Definition: colorscheme.cpp:277
ColorScheme::save
bool save(const QString &name)
Save the current color scheme to a *.colors file.
Definition: colorscheme.cpp:218
ColorScheme::starColorMode
int starColorMode() const
Definition: colorscheme.h:105
ColorScheme::ColorScheme
ColorScheme()
Constructor.
Definition: colorscheme.cpp:35
ColorScheme::nameFromKey
QString nameFromKey(const QString &key) const
Definition: colorscheme.cpp:118
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal