moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / kstarsinterface.h
blobf1eb827712def257306c570fa83caa1f08e1cfec
1 /***************************************************************************
2 kstarsinterface.h - K Desktop Planetarium
3 -------------------
4 begin : Thu Jan 3 2002
5 copyright : (C) 2002 by Mark Hollomon
6 email : mhh@mindspring.com
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 ***************************************************************************/
21 #ifndef KSTARSINTERFACE_H
22 #define KSTARSINTERFACE_H
24 #include <dcopobject.h>
26 /**@class KStarsInterface
27 *This class encapsulates the DCOP functions for KStars.
28 *@note Clock-related DCOP functions are in a separate class: SimClockInterface
29 *@note The function definitions are in the file kstarsdcop.cpp
30 *@author Mark Hollomon
31 *@version 1.0
35 class KStarsInterface : virtual public DCOPObject
37 K_DCOP
39 k_dcop:
40 /**Recenter the display at a new object or point in the sky.
41 *@param direction This is either the name of a SkyObject, or one
42 *of the following to center on a compass point along the horizon
43 *or at the zenith point:
44 *@li north, n
45 *@li northeast, ne
46 *@li east, e
47 *@li southeast, se
48 *@li south, s
49 *@li southwest, sw
50 *@li west, w
51 *@li northwest, nw
52 *@li zenith, z
55 virtual ASYNC lookTowards( const QString direction ) = 0;
57 /**Set the zoomFactor. The zoomFactor is equal to the number of
58 *pixels which subtend one radian of angle.
59 *@param f the new zoomFactor
61 virtual ASYNC zoom( double f ) = 0;
63 /**Increase the zoomFactor by 10%
65 virtual ASYNC zoomIn() = 0;
67 /**Decrease the zoomFactor by 10%
69 virtual ASYNC zoomOut() = 0;
71 /**Set the zoomFactor to its default value
73 virtual ASYNC defaultZoom() = 0;
75 /**Recenter the Display to the given RA,Dec position
76 *@param ra the new RA coordinate
77 *@param dec the new Dec coordinate
79 virtual ASYNC setRaDec( double ra, double dec ) = 0;
81 /**Recenter the Display to the given Alt,Az position
82 *@param alt the new Alt coordinate
83 *@param az the new Az coordinate
85 virtual ASYNC setAltAz(double alt, double az) = 0;
87 /**Reset the clock to the given time and date
88 *@param yr the year
89 *@param mth the month
90 *@param day the day
91 *@param hr the hour
92 *@param min the minute
93 *@param sec the second
95 virtual ASYNC setLocalTime(int yr, int mth, int day, int hr, int min, int sec) = 0;
97 /**Pause execution of the script for a given number of seconds
98 *@param t pause interval in seconds
100 virtual ASYNC waitFor( double t ) = 0;
102 /**Pause execution of the script until a key is pressed
103 *@param k the key which will resume the script
105 virtual ASYNC waitForKey( const QString k ) = 0;
107 /**Turn tracking mode on or off. If tracking is on, then the coordinates at
108 *the center of the screen remain fixed with time. If tracking is off, then
109 *the sky "drifts" past the screen at the sidereal rate.
110 *@param track if TRUE, turn tracking on; otherwise turn it off.
112 virtual ASYNC setTracking( bool track ) = 0;
114 /**Reset a View option. There are dozens of view options which can be adjusted
115 *with this function. See the ScriptBuilder tool for a hierarchical list, or
116 *see the kstarsrc config file. Different options require different data types
117 *for their argument. The value parameter will be recast from a QString to the
118 *correct data type for the specified option. If the value cannot be recast,
119 *then the option will not be changed.
120 *@param option the name of the option to change
121 *@param value the new value for the option
123 virtual ASYNC changeViewOption( const QString option, const QString value ) = 0;
125 /**Show a message in a popup window (NOT YET IMPLEMENTED)
126 *@param x the X-coordinate of the window
127 *@param y the Y-coordinate of the window
128 *@param message the text to be displayed
130 virtual ASYNC popupMessage( int x, int y, const QString message ) = 0;
132 /**Draw a line on the sky map (NOT YET IMPLEMENTED)
133 *@param x1 the x-coordinate of the starting point of the line
134 *@param y1 the y-coordinate of the starting point of the line
135 *@param x2 the x-coordinate of the ending point of the line
136 *@param y2 the y-coordinate of the ending point of the line
137 *@param speed how fast the line should be drawn from the starting point to the
138 *ending point. A speed of 0 will draw the entire line instantly.
140 virtual ASYNC drawLine( int x1, int y1, int x2, int y2, int speed ) = 0;
142 /**Set the Geographic location according to the given city name.
143 *@param city the name of the city
144 *@param province the name of the province or US state
145 *@param country the name of the country
147 virtual ASYNC setGeoLocation( const QString city, const QString province, const QString country ) = 0;
149 /**Adjust one of the color settings.
150 *@param colorName The name of the color to change (see one of the *.colors files, or colorscheme.cpp)
151 *@param value The new color setting
153 virtual ASYNC setColor( const QString colorName, const QString value ) = 0;
155 /**Load a color scheme
156 *@param name The name of the color scheme to be loaded
158 virtual ASYNC loadColorScheme( const QString name ) = 0;
160 /**Export an image of the current sky to a file on disk.
161 *@param filename The filename for the exported image (the image type
162 *will be determined from the fileame extension; if this is not possible,
163 *it will save the image as a PNG)
164 *@param width the width of the image
165 *@param height the height of the image
167 virtual ASYNC exportImage( const QString filename, int width, int height ) = 0;
169 /**Print the current sky map. Options to show the Print Dialog and to use Star Chart colors.
171 virtual ASYNC printImage( bool usePrintDialog, bool useChartColors ) = 0;
174 // Generic Device Functions
175 /**Establish the device for an INDI-compatible device
176 *@param deviceName The INDI device name
177 *@param useLocal If true, starts the device in local mode. Otherwise, in server mode.
179 virtual ASYNC startINDI (QString deviceName, bool useLocal) = 0;
181 /**Shotdown a device
182 *@param deviceName The INDI device name
184 virtual ASYNC shutdownINDI (QString deviceName) = 0;
186 /**Turn the INDI device on/off
187 *@param deviceName The INDI device name
188 *@param turnOn If true, the device is switched on, otherwise it is switches off.
190 virtual ASYNC switchINDI(QString deviceName, bool turnOn) = 0;
192 /**Set INDI connection port
193 *@param deviceName The INDI device name
194 *@param port The connection port (e.g. /dev/ttyS0)
196 virtual ASYNC setINDIPort(QString deviceName, QString port) = 0;
198 /**Set INDI device action. This action is an element of a valid switch
199 * property in the device.
200 *@param deviceName The INDI device name
201 *@param action The generic action to invoke
203 virtual ASYNC setINDIAction(QString deviceName, QString action) = 0;
205 /** Wait for action to complete (state changed to OK or IDLE)
206 *@param deviceName The INDI device name
207 *@param action The action. The action can be any valid device property.
208 * script will pause until the property status becomes OK.
210 virtual ASYNC waitForINDIAction(QString deviceName, QString action) = 0;
213 // Telescope Functions
214 /**Set telescope target coordinates
215 *@param deviceName The INDI device name
216 *@param RA Target's right ascension in JNOW
217 *@param DEC Target's declination in JNOW
219 virtual ASYNC setINDITargetCoord(QString deviceName, double RA, double DEC) = 0;
221 /**Set telescope target
222 *@param deviceName The INDI device name
223 *@param objectName Object's name as found in KStars
225 virtual ASYNC setINDITargetName(QString deviceName, QString objectName) = 0;
227 /**Set telescope action
228 *@param deviceName The INDI device name
229 *@param action The specfic action to perform. Either SLEW, TRACK, SYNC, PARK, or ABORT.
231 virtual ASYNC setINDIScopeAction(QString deviceName, QString action) = 0;
233 /** Set INDI geographical location
234 *@param deviceName The INDI device name
235 *@param longitude Longitude expressed in double. E of N
236 *@param latitude Latitude expressed in double.
238 virtual ASYNC setINDIGeoLocation(QString deviceName, double longitude, double latitude) = 0;
240 /** Start INDI UTC date and time in ISO 8601 format
241 *@param deviceName The INDI device name
242 *@param UTCDateTime UTC date and time in ISO 8601 format.
244 virtual ASYNC setINDIUTC(QString deviceName, QString UTCDateTime) = 0;
247 // Focus Functions
248 /** Set Focus Speed
249 *@param deviceName The INDI device name
250 *@param speed Focus speed: Halt, Fast, Medium, and Slow
252 virtual ASYNC setINDIFocusSpeed(QString deviceName, QString action) = 0;
254 /** Set INDI focus timeout
255 *@param deviceName The INDI device name
256 *@param timeout Number of seconds to perform focusing.
258 virtual ASYNC setINDIFocusTimeout(QString deviceName, int timeout) = 0;
260 /** Start INDI focus operation in the selected direction
261 *@param deviceName The INDI device name
262 *@param focusDir Focus direction. If 0, focus in, if 1 focus out
264 virtual ASYNC startINDIFocus(QString deviceName, int focusDir) = 0;
266 // Filter Functions
267 /** Sets the Filter position
268 *@param deviceName The INDI device name
269 *@param type The filter position (0-20)
271 virtual ASYNC setINDIFilterNum(QString deviceName, int filter_num) = 0;
273 // Camera CCD Functions
275 /** Sets the CCD camera frame type
276 *@param deviceName The INDI device name
277 *@param type The frame type can be either FRAME_LIGHT, FRAME_DARK,
278 * FRAME_BIAS, or FRAME_FLAT
280 virtual ASYNC setINDIFrameType(QString deviceName, QString type) = 0;
282 /** Set CCD target temperature
283 *@param deviceName The INDI device name
284 *@param temp The target CCD temperature.
286 virtual ASYNC setINDICCDTemp(QString deviceName, int temp) = 0;
288 /** Start camera exposure
289 *@param deviceName The INDI device name
290 *@param timeout Number of seconds to perform exposure.
292 virtual ASYNC startINDIExposure(QString deviceName, int timeout) = 0;
296 #endif