Kstars

obslistwizard.h
1 /*
2  SPDX-FileCopyrightText: 2005 Jason Harris <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "ui_obslistwizard.h"
10 #include "skyobjects/skypoint.h"
11 
12 #include <QDialog>
13 
14 class QListWidget;
15 class QPushButton;
16 
17 class SkyObject;
18 class GeoLocation;
19 
20 class ObsListWizardUI : public QFrame, public Ui::ObsListWizard
21 {
22  Q_OBJECT
23 
24  public:
25  explicit ObsListWizardUI(QWidget *p);
26 };
27 
28 /**
29  * @class ObsListWizard
30  * @short Wizard for constructing observing lists
31  *
32  * @author Jason Harris
33  */
34 class ObsListWizard : public QDialog
35 {
36  Q_OBJECT
37  public:
38  explicit ObsListWizard(QWidget *parent);
39  virtual ~ObsListWizard() override = default;
40 
41  /** @return reference to QPtrList of objects selected by the wizard */
42  QList<SkyObject *> &obsList() { return ObsList; }
43 
44  private slots:
45  void slotNextPage();
46  void slotPrevPage();
47  void slotAllButton();
48  void slotNoneButton();
49  void slotDeepSkyButton();
50  void slotSolarSystemButton();
51  void slotChangeLocation();
52  void slotToggleDateWidgets();
53  void slotToggleMagWidgets();
54 
55  void slotParseRegion();
56 
57  /** @short Construct the observing list by applying the selected filters */
58  void slotObjectCountDirty();
59  void slotUpdateObjectCount();
60  void slotApplyFilters() { applyFilters(true); }
61 
62  private:
63  void initialize();
64  void applyFilters(bool doBuildList);
65 
66  /** @return true if the object passes the filter region constraints, false otherwise.*/
67  bool applyRegionFilter(SkyObject *o, bool doBuildList, bool doAdjustCount = true);
68  bool applyObservableFilter(SkyObject *o, bool doBuildList, bool doAdjustCount = true);
69 
70  /**
71  * Convenience function for safely getting the selected state of a QListWidget item by name.
72  * QListWidget has no method for easily selecting a single item based on its text.
73  * @return true if the named QListWidget item is selected.
74  * @param name the QListWidget item to be queried is the one whose text matches this string
75  * @param listWidget pointer to the QListWidget whose item is to be queried
76  * @param ok pointer to a bool, which if present will return true if a matching list item was found
77  */
78  bool isItemSelected(const QString &name, QListWidget *listWidget, bool *ok = nullptr);
79  /**
80  * Convenience function for safely setting the selected state of a QListWidget item by name.
81  * QListWidget has no method for easily selecting a single item based on its text.
82  * @param name the QListWidget item to be (de)selected is the one whose text matches this string
83  * @param listWidget pointer to the QListWidget whose item is to be (de)selected
84  * @param value set the item's selected state to this bool value
85  * @param ok pointer to a bool, which if present will return true if a matching list item was found
86  */
87  void setItemSelected(const QString &name, QListWidget *listWidget, bool value, bool *ok = nullptr);
88 
89  QList<SkyObject *> ObsList;
90  ObsListWizardUI *olw { nullptr };
91  uint ObjectCount { 0 };
92  uint StarCount { 0 };
93  uint PlanetCount { 0 };
94  uint CometCount { 0 };
95  uint AsteroidCount { 0 };
96  uint GalaxyCount { 0 };
97  uint OpenClusterCount { 0 };
98  uint GlobClusterCount { 0 };
99  uint GasNebCount { 0 };
100  uint PlanNebCount { 0 };
101  double xRect1 { 0 };
102  double xRect2 { 0 };
103  double yRect1 { 0 };
104  double yRect2 { 0 };
105  double rCirc { 0 };
106  SkyPoint pCirc;
107  GeoLocation *geo { nullptr };
108  QPushButton *nextB { nullptr };
109  QPushButton *backB { nullptr };
110 };
Q_OBJECTQ_OBJECT
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
Wizard for constructing observing lists.
Definition: obslistwizard.h:34
QList< SkyObject * > & obsList()
Definition: obslistwizard.h:42
Information about an object in the sky.
Definition: skyobject.h:41
QObject * parent() const const
Relevant data about an observing location on Earth.
Definition: geolocation.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Aug 8 2022 04:13:23 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.