• 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
astrocalc.h
Go to the documentation of this file.
1 /***************************************************************************
2  astrocalc.h - description
3  -------------------
4  begin : wed dec 19 16:20:11 CET 2002
5  copyright : (C) 2001-2002 by Pablo de Vicente
6  email : vicente@oan.es
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 ASTROCALC_H_
19 #define ASTROCALC_H_
20 
21 #include <QMap>
22 #include <QString>
23 #include <kdialog.h>
24 
25 
26 class QSplitter;
27 class QStackedWidget;
28 class QTreeWidget;
29 class QTreeWidgetItem;
30 class KTextEdit;
31 
37 class AstroCalc : public KDialog
38 {
39  Q_OBJECT
40 public:
41  AstroCalc(QWidget *parent = 0);
42 
43  ~AstroCalc();
44 
46  QSize sizeHint() const;
47 public slots:
50  void slotItemSelection(QTreeWidgetItem *it); // Q: Why is this public when we don't have access to navigationPanel anyway? Also doesn't seem to be used from outside -- asimha
51 
52 private:
55  typedef QWidget* (AstroCalc::*WidgetConstructor)();
59  class WidgetThunk
60  {
61  public:
66  WidgetThunk(AstroCalc* acalc, WidgetConstructor f) :
67  widget(0), calc(acalc), func(f) {}
70  QWidget* eval();
71  private:
72  QWidget* widget; // Cached value
73  AstroCalc* calc; // Pointer to calculator
74  WidgetConstructor func; // Function to call to construct widget.
75  };
76 
79  template<typename T>
80  inline QWidget* addToStack();
81 
86  QTreeWidgetItem* addTreeTopItem(QTreeWidget* parent, QString title, QString html);
87 
95  template<typename T>
96  QTreeWidgetItem* addTreeItem(QTreeWidgetItem* parent, QString title);
97 
99  QMap<QTreeWidgetItem*, QString> htmlTable;
101  QMap<QTreeWidgetItem*, WidgetThunk> dispatchTable;
102  QTreeWidget *navigationPanel;
103  QStackedWidget *acStack;
104  KTextEdit *splashScreen;
105 };
106 
107 #endif
AstroCalc::~AstroCalc
~AstroCalc()
Definition: astrocalc.cpp:201
QWidget
KDialog
AstroCalc::slotItemSelection
void slotItemSelection(QTreeWidgetItem *it)
Display calculator module or help text based on item selected.
Definition: astrocalc.cpp:203
NaN::f
const float f
Definition: nan.h:36
AstroCalc
Astrocalc is the base class for the KStars astronomical calculator.
Definition: astrocalc.h:37
AstroCalc::sizeHint
QSize sizeHint() const
Definition: astrocalc.cpp:221
AstroCalc::AstroCalc
AstroCalc(QWidget *parent=0)
Definition: astrocalc.cpp:43
KTextEdit
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