moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / stardatasink.h
blob0cb977494fd8692c850d2eefd949901b5695e7d9
1 /***************************************************************************
2 stardatasink.h - description
3 -------------------
4 begin : Son Feb 10 2002
5 copyright : (C) 2002 by Thomas Kabelmann
6 email : tk78@gmx.de
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 ***************************************************************************/
18 #ifndef STARDATASINK_H
19 #define STARDATASINK_H
22 /**@class StarDataSink
23 *StarDataSink receives data from an FileSource object and appends these data
24 *to a QList of star data. It's an asynchronous io class.
25 *@author Thomas Kabelmann
26 *@version 1.0
29 #include <qobject.h>
30 #include <qasyncio.h>
32 #include <qglobal.h>
34 class KStarsData;
36 class StarDataSink : public QObject, public QDataSink {
37 /**
38 *class needs signals
40 Q_OBJECT
42 public:
43 /** constructor */
44 StarDataSink( KStarsData *parent, const char *name=0 );
46 /** destructor */
47 ~StarDataSink();
49 /** is this object ready to receive data? */
50 int readyToReceive();
52 /** end of data transmission reached */
53 void eof();
55 /**
56 *This function receives data from FileSource and appends data
57 *to some lists in KStarsData.
59 void receive( const uchar *data, int entries );
61 private:
63 KStarsData *ksData;
65 // has objectnamelist changed while reloading?
66 uint nameListCount;
68 // counts the number of blocks
69 uint receivedBlocks;
71 signals:
73 /**
74 *send signal if all data were transmitted
76 void done();
78 /**
79 *send signal to update skymap time by time
80 *just for long data transmissions needed.
82 void updateSkymap();
84 /**
85 *If name list has changed emit this signal.
87 void clearCache();
90 #endif