• 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
  • tools
  • whatsinteresting
skyobjitem.h
Go to the documentation of this file.
1 /***************************************************************************
2  skyobjitem.h - K Desktop Planetarium
3  -------------------
4  begin : 2012/21/06
5  copyright : (C) 2012 by Samikshan Bairagya
6  email : samikshan@gmail.com
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 
19 #ifndef SKYOBJITEM_H
20 #define SKYOBJITEM_H
21 
22 #include "skyobject.h"
23 
29 class SkyObjItem
30 {
31 public:
36  enum SkyObjectRoles { DispNameRole = Qt::UserRole + 1, CategoryRole, CategoryNameRole };
37 
42  enum Type { Planet, Star, Constellation, Galaxy, Cluster, Nebula };
43 
48  SkyObjItem(SkyObject *so = 0);
49 
55  QVariant data(int role);
56 
61  QHash<int, QByteArray> roleNames() const;
62 
67  inline QString getName() const { return m_Name; }
68 
73  inline QString getLongName() const { return m_LongName; }
74 
79  inline QString getTypeName() const { return m_TypeName; }
80 
85  inline int getType() const { return m_Type; }
86 
91  inline QString getPosition() const { return m_Position; }
92 
97  inline SkyObject* getSkyObject() { return m_So; }
98 
103  QString getDesc() const;
104 
109  QString getDescSource();
110 
115  inline float getMagnitude() const { return m_So->mag(); }
116 
122  QString getSurfaceBrightness() const;
123 
129  QString getSize() const;
130 
135  void setPosition(SkyObject *so);
136 
137 private:
138  QString m_Name;
139  QString m_LongName;
140  QString m_TypeName;
141  QString m_Position;
142  Type m_Type;
143  SkyObject* m_So;
144 };
145 
146 #endif
SkyObjItem::Star
Definition: skyobjitem.h:42
SkyObjItem::CategoryNameRole
Definition: skyobjitem.h:36
SkyObjItem::SkyObjItem
SkyObjItem(SkyObject *so=0)
Constructor.
Definition: skyobjitem.cpp:25
SkyObjItem::getTypeName
QString getTypeName() const
Get category of sky-object associated with the SkyObjItem as a QString.
Definition: skyobjitem.h:79
SkyObjItem
Represents an item in the list of interesting sky-objects.
Definition: skyobjitem.h:29
skyobject.h
SkyObjItem::getDescSource
QString getDescSource()
Get source of description for the SkyObjItem.
Definition: skyobjitem.cpp:127
SkyObjItem::getDesc
QString getDesc() const
Get description for the SkyObjItem.
Definition: skyobjitem.cpp:93
SkyObjItem::getPosition
QString getPosition() const
Get current position of sky-object associated with the SkyObjItem.
Definition: skyobjitem.h:91
SkyObjItem::Type
Type
The type classification for the SkyObjItem.
Definition: skyobjitem.h:42
SkyObjItem::Constellation
Definition: skyobjitem.h:42
SkyObjItem::getSkyObject
SkyObject * getSkyObject()
Get sky-object associated with the SkyObjItem.
Definition: skyobjitem.h:97
SkyObjItem::getType
int getType() const
Get category of sky-object associated with the SkyObjItem as an integer.
Definition: skyobjitem.h:85
SkyObjItem::getName
QString getName() const
Get name of sky-object associated with the SkyObjItem.
Definition: skyobjitem.h:67
SkyObjItem::Galaxy
Definition: skyobjitem.h:42
SkyObjItem::Cluster
Definition: skyobjitem.h:42
SkyObjItem::Nebula
Definition: skyobjitem.h:42
SkyObjItem::setPosition
void setPosition(SkyObject *so)
Set current position of the sky-object in the sky.
Definition: skyobjitem.cpp:80
SkyObjItem::DispNameRole
Definition: skyobjitem.h:36
SkyObjItem::getLongName
QString getLongName() const
Get longname of sky-object associated with the SkyObjItem.
Definition: skyobjitem.h:73
SkyObjItem::getMagnitude
float getMagnitude() const
Get magnitude of sky-object associated with the SkyObjItem.
Definition: skyobjitem.h:115
SkyObject::mag
float mag(void) const
Definition: skyobject.h:182
SkyObjItem::data
QVariant data(int role)
Get data associated with a particular role for the SkyObjItem.
Definition: skyobjitem.cpp:56
SkyObjItem::getSurfaceBrightness
QString getSurfaceBrightness() const
Get surface-brightness of sky-object associated with the SkyObjItem as a QString to be displayed on t...
Definition: skyobjitem.cpp:137
SkyObjItem::getSize
QString getSize() const
Get size of sky-object associated with the SkyObjItem as a QString to be displayed on the details-vie...
Definition: skyobjitem.cpp:159
SkyObjItem::roleNames
QHash< int, QByteArray > roleNames() const
Create and return a QHash of rolenames for the SkyObjItem.
Definition: skyobjitem.cpp:71
SkyObjItem::Planet
Definition: skyobjitem.h:42
SkyObjItem::SkyObjectRoles
SkyObjectRoles
User-defined role for the SkyObjItem.
Definition: skyobjitem.h:36
SkyObject
Provides all necessary information about an object in the sky: its coordinates, name(s), type, magnitude, and QStringLists of URLs for images and webpages regarding the object.
Definition: skyobject.h:46
SkyObjItem::CategoryRole
Definition: skyobjitem.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:21 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