moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / kspopupmenu.h
blob467398f88dcf3907bf387a0072df9212eeaab80d
1 /***************************************************************************
2 kspopupmenu.h - K Desktop Planetarium
3 -------------------
4 begin : Sat Feb 27 2003
5 copyright : (C) 2001 by Jason Harris
6 email : jharris@30doradus.org
7 ***************************************************************************/
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 ***************************************************************************/
19 #ifndef KSPOPUPMENU_H
20 #define KSPOPUPMENU_H
22 #include <kpopupmenu.h>
24 /**@class KSPopupMenu
25 *The KStars Popup Menu. The menu is sensitive to the
26 *object type of the object which was clicked to invoke the menu.
27 *Items in the menu include name and type data; rise/transit/set times;
28 *actions such as Center, Details, Telescope actions, and Label;
29 *and Image and Information URL links.
30 *@author Jason Harris
31 *@version 1.0
34 class KStars;
35 class StarObject;
36 class SkyObject;
37 class QLabel;
39 class KSPopupMenu : public KPopupMenu
41 Q_OBJECT
42 public:
43 /**Default constructor*/
44 KSPopupMenu( QWidget *parent = 0, const char *name = 0 );
46 /**Destructor (empty)*/
47 ~KSPopupMenu();
49 /**Initialize the popup menus. Adds name and type labels, and possibly
50 *Rise/Set/Transit labels, Center/Track item, and Show Details item.
51 *@short initialize the right-click popup menu
52 *@param obj pointer to the skyobject which the menu describes
53 *@param name1 The primary object name
54 *@param name2 The (optional) secondary object name
55 *@param type a string identifying the object type
56 *@param showRiseSet if true, the Rise/Set/Transit labels are added
57 *@param showCenterTrack if true, the Center/Track item is added
58 *@param showDetails if true, the Show-Details item is added
59 *@param showTrail if true, the add/remove planet trail item is added
60 *@param addTrail if true, the add/remove planet trail item reads "Add Trail"
61 *if false, it reads "Remove Trail".
62 *@param showAngularDistance if true, the Angular Distance item is added.
63 *@param showObsList if true, the Add to List/Remove from List item is added.
65 void initPopupMenu( SkyObject *obj, QString name1, QString name2, QString type,
66 bool showRiseSet=true, bool showCenterTrack=true,
67 bool showDetails=true, bool showTrail=false,
68 bool addTrail=false, bool showAngularDistance=true,
69 bool showObsList=true );
71 /**Add an item to the popup menu for each of the URL links associated with
72 *this object. URL links appear in two categories: images and information pages.
73 *For some objects, a link to Digitized Sky Survey images will automatically be added
74 *in addition to the object's normal image links. Also, for some objects, an
75 *"Add link..." item will be included, which allows the user to add their own cutsom
76 *URLs for this object.
77 *@param obj pointer to the skyobject which the menu describes
78 *@param showDSS if TRUE, include DSS Image links
79 *@param allowCustom if TRUE, include the "Add Link..." item
81 void addLinksToMenu( SkyObject *obj, bool showDSS=true, bool allowCustom=true );
83 /**@short Create a popup menu for a star.
85 *Stars get the following labels: a primary name and/or a genetive name,
86 *a spectral type, an object type ("star"), and rise/transit/set times.
87 *Stars get a "Center & Track" item, an Angular Distance item, and a
88 *"Detailed Info" item. Named stars get an "Attach Label" item and an
89 *"Add Link..." item, and may have image/info links; all stars get DSS
90 *image links. Stars do not get an "Add Trail" item.
91 *@param star pointer to the star which the menu describes
93 void createStarMenu( StarObject *star );
95 /**@short Create a popup menu for a deep-sky object.
97 *DSOs get the following labels:
98 *a common name and/or a catalog name, an object type, and rise/transit/set
99 *times. DSOs get a "Center & Track" item, an Angular Distance item, an
100 *"Attach Label" item, and a "Detailed Info" item.
101 *They may have image/info links, and also get the DSS Image links and the
102 *"Add Link..." item. They do not get an "Add Trail" item.
103 *@param star pointer to the star which the menu describes
105 void createDeepSkyObjectMenu( SkyObject *obj );
107 /**@short Create a popup menu for a custom-catalog object.
109 *For now, this behaves essentially like the createDeepSkyObjectMenu()
110 *function, except that adding custom links is (temporarily?) disabled.
111 *@param obj pointer to the custom catalog object which the menu describes
113 void createCustomObjectMenu( SkyObject *obj );
115 /**@short Create a popup menu for a solar system body.
117 *Solar System bodies get a name label, a type label ("solar system"),
118 *and rise/set/transit time labels. They also get Center&Track,
119 *Angular Distance, Detailed Info, Attach Label, and Add Trail items.
120 *They can have image/info links, and also get the "Add Link..." item.
121 *@note despite the name "createPlanetMenu", this function is used for
122 *comets and asteroids as well.
123 *@param p the solar system object which the menu describes.
125 void createPlanetMenu( SkyObject *p );
127 /**@short Create a popup menu for empty sky.
129 *The popup menu when right-clicking on nothing is still useful.
130 *Instead of a name label, it shows "Empty Sky". The rise/set/transit
131 *times of the clicked point on the sky are also shown. You also get
132 *the Center & Track and Angular Distance items, and the DSS image links.
133 *@param nullObj pointer to dummy SkyObject, just to hold the clicked
134 *coordinates for passing to initPopupMenu().
136 void createEmptyMenu( SkyObject *nullObj=0 );
138 /**Set the rise/transit/set time labels for the object. Compute these times
139 *for the object for the current date and location. If the object is
140 *circumpolar or never rises, the rise and set labels will indicate this
141 *(but the transit time should always be valid).
142 *@param obj the skyobject whose r/t/s times are to be displayed.
144 void setRiseSetLabels( SkyObject *obj );
146 /**Add a submenu for INDI controls (Slew, Track, Sync, etc).
147 *@return true if a valid INDI menu was added.
149 bool addINDI(void);
151 private:
152 KStars *ksw;
153 QLabel *pmTitle, *pmTitle2, *pmType, *pmConstellation;
154 QLabel *pmRiseTime, *pmSetTime, *pmTransitTime;
158 #endif