• 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
  • widgets
moonphasecalendarwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  moonphasecalendarwidget.h - K Desktop Planetarium
3  -------------------
4  begin : Sat Jun 26 2010
5  copyright : (C) 2010 by Akarsh Simha
6  email : akarshsimha@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 #ifndef _MOONPHASECALENDARWIDGET_H_
19 #define _MOONPHASECALENDARWIDGET_H_
20 
21 #include <QWidget>
22 #include <KDateTable>
23 
24 class KSMoon;
25 class KSSun;
26 class KStarsDateTime;
27 
28 class MoonPhaseCalendar : public KDateTable {
29 
30  Q_OBJECT
31 
32  public:
33 
39  explicit MoonPhaseCalendar( KSMoon &moon, KSSun &sun, QWidget *parent = 0 );
40 
41  ~MoonPhaseCalendar();
42 
46  virtual QSize sizeHint() const;
47 
48  public slots:
49 
60  virtual void setGeometry( int x, int y, int w, int h );
61 
62  virtual void setGeometry( const QRect &r );
63 
64  protected:
65 
71  virtual void paintEvent( QPaintEvent *e );
72 
77  void paintCell( QPainter *painter, int row, int col, const KColorScheme &colorScheme );
78 
85  void loadImages();
86 
90  void computeMoonImageSize();
91 
92  private:
93 
99  unsigned short computeMoonPhase( const KStarsDateTime &date );
100 
101  QPixmap m_Images[36]; // Array storing moon images against integer phase
102 
103  double cellWidth, cellHeight;
104  int numWeekRows;
105  int numDayColumns;
106  int MoonImageSize;
107  bool imagesLoaded;
108 
109  KSMoon &m_Moon;
110  KSSun &m_Sun;
111 };
112 
113 #endif
KSSun
Child class of KSPlanetBase; encapsulates information about the Sun.
Definition: kssun.h:31
MoonPhaseCalendar::computeMoonImageSize
void computeMoonImageSize()
Computes the optimum moon image size.
Definition: moonphasecalendarwidget.cpp:73
KDateTable
QWidget
MoonPhaseCalendar::~MoonPhaseCalendar
~MoonPhaseCalendar()
Definition: moonphasecalendarwidget.cpp:52
MoonPhaseCalendar::paintEvent
virtual void paintEvent(QPaintEvent *e)
Overrides KDateTable::paintEvent() to draw moon phases on the calendar cells by calling this->paintCe...
Definition: moonphasecalendarwidget.cpp:89
MoonPhaseCalendar::setGeometry
virtual void setGeometry(int x, int y, int w, int h)
Set the geometry of the moon phase calendar (overloaded from QWidget).
Definition: moonphasecalendarwidget.cpp:80
MoonPhaseCalendar::MoonPhaseCalendar
MoonPhaseCalendar(KSMoon &moon, KSSun &sun, QWidget *parent=0)
Constructor.
Definition: moonphasecalendarwidget.cpp:41
KStarsDateTime
Extension of KDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day...
Definition: kstarsdatetime.h:45
KSMoon
A subclass of SkyObject that provides information needed for the Moon.
Definition: ksmoon.h:36
MoonPhaseCalendar
Definition: moonphasecalendarwidget.h:28
MoonPhaseCalendar::sizeHint
virtual QSize sizeHint() const
Definition: moonphasecalendarwidget.cpp:55
MoonPhaseCalendar::loadImages
void loadImages()
Loads the moon images, appropriately resized depending on the current cell size.
Definition: moonphasecalendarwidget.cpp:61
MoonPhaseCalendar::paintCell
void paintCell(QPainter *painter, int row, int col, const KColorScheme &colorScheme)
Replaces KDateTable::paintCell() to draw moon phases on the calendar cells.
Definition: moonphasecalendarwidget.cpp:115
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 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