Kstars

detailstable.h
1/*
2 SPDX-FileCopyrightText: 2011 Rafał Kułaga <rl.kulaga@gmail.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#ifndef DETAILSTABLE_H
8#define DETAILSTABLE_H
9
10#include "QTextTableFormat"
11#include "QTextCharFormat"
12
13class SkyObject;
14class KStarsDateTime;
15class GeoLocation;
16class QTextDocument;
17
18/**
19 * \class DetailsTable
20 * \brief Represents details tables that can be inserted to finder charts and logging forms.
21 * DetailsTable class is used for creating QTextTables filled with details about objects of all types.
22 * Created tables are stored inside QTextDocument, which can be obtained by DetailsTable::getDocument() and
23 * inserted into other QTextDocument as fragment.
24 * Four types of details tables are supported: general details, position details, Rise/Set/Transit details and
25 * Asteroid/Comet details.
26 * \author Rafał Kułaga
27 */
29{
30 public:
31 /**
32 * \short Default constructor - creates empty details table.
33 */
35
36 /**
37 * \short Destructor.
38 */
40
41 /**
42 * \short Get table format.
43 * \return Current table format.
44 */
45 inline QTextTableFormat getTableFormat() { return m_TableFormat; }
46
47 /**
48 * \short Get table title character format.
49 * \return Current table title character format.
50 */
51 inline QTextCharFormat getTableTitleCharFormat() { return m_TableTitleCharFormat; }
52
53 /**
54 * \short Get table item name character format.
55 * \return Current table item name character format.
56 */
57 inline QTextCharFormat getItemNameCharFormat() { return m_ItemNameCharFormat; }
58
59 /**
60 * \short Get table item value character format.
61 * \return Current table item value character format.
62 */
63 inline QTextCharFormat getItemValueCharFormat() { return m_ItemValueCharFormat; }
64
65 /**
66 * \short Set table format.
67 * \param format New table format.
68 */
69 inline void setTableFormat(const QTextTableFormat &format) { m_TableFormat = format; }
70
71 /**
72 * \short Set table title character format.
73 * \param format New table title character format.
74 */
75 inline void setTableTitleCharFormat(const QTextCharFormat &format) { m_TableTitleCharFormat = format; }
76
77 /**
78 * \short Set table item name character format.
79 * \param format New table item name character format.
80 */
81 inline void setItemNameCharFormat(const QTextCharFormat &format) { m_ItemNameCharFormat = format; }
82
83 /**
84 * \short Set table item value character format.
85 * \param format New table item value character format.
86 */
87 inline void setItemValueCharFormat(const QTextCharFormat &format) { m_ItemValueCharFormat = format; }
88
89 /**
90 * \short Create general details table.
91 * \param obj SkyObject for which table will be created.
92 */
94
95 /**
96 * \short Create Asteroid/Comet details table.
97 * \param obj Sky object (Asteroid/Comet) for which table will be created.
98 */
100
101 /**
102 * \short Create coordinates details table.
103 * \param obj Sky object for which table will be created.
104 * \param ut Date and time.
105 * \param geo Geographic location.
106 */
108
109 /**
110 * \short Create Rise/Set/Transit details table.
111 * \param obj Sky object for which table will be created.
112 * \param ut Date and time.
113 * \param geo Geographic location.
114 */
115 void createRSTTAble(SkyObject *obj, const KStarsDateTime &ut, GeoLocation *geo);
116
117 /**
118 * \short Clear current table.
119 */
120 void clearContents();
121
122 /**
123 * \short Get table document.
124 * \return Table document.
125 */
126 inline QTextDocument *getDocument() { return m_Document; }
127
128 private:
129 /**
130 * \short Sets default table formatting.
131 */
132 void setDefaultFormatting();
133
134 QTextDocument *m_Document;
135
136 QTextTableFormat m_TableFormat;
137 QTextCharFormat m_TableTitleCharFormat;
138 QTextCharFormat m_ItemNameCharFormat;
139 QTextCharFormat m_ItemValueCharFormat;
140};
141
142#endif // DETAILSTABLE_H
Represents details tables that can be inserted to finder charts and logging forms.
QTextTableFormat getTableFormat()
Get table format.
void createRSTTAble(SkyObject *obj, const KStarsDateTime &ut, GeoLocation *geo)
Create Rise/Set/Transit details table.
DetailsTable()
Default constructor - creates empty details table.
void createAsteroidCometTable(SkyObject *obj)
Create Asteroid/Comet details table.
void createGeneralTable(SkyObject *obj)
Create general details table.
void createCoordinatesTable(SkyObject *obj, const KStarsDateTime &ut, GeoLocation *geo)
Create coordinates details table.
QTextCharFormat getItemNameCharFormat()
Get table item name character format.
void setTableTitleCharFormat(const QTextCharFormat &format)
Set table title character format.
~DetailsTable()
Destructor.
QTextCharFormat getTableTitleCharFormat()
Get table title character format.
void setItemNameCharFormat(const QTextCharFormat &format)
Set table item name character format.
void setTableFormat(const QTextTableFormat &format)
Set table format.
void setItemValueCharFormat(const QTextCharFormat &format)
Set table item value character format.
QTextDocument * getDocument()
Get table document.
QTextCharFormat getItemValueCharFormat()
Get table item value character format.
void clearContents()
Clear current table.
Contains all relevant information for specifying a location on Earth: City Name, State/Province name,...
Definition geolocation.h:28
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.