~ubuntu-branches/debian/jessie/stellarium/jessie

« back to all changes in this revision

Viewing changes to src/core/StelModule.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Cédric Delfosse
  • Date: 2009-03-13 20:07:22 UTC
  • mfrom: (1.1.8 upstream)
  • mto: (11.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20090313200722-gbgujsmzsa8a02ty
Import upstream version 0.10.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
//! It can be called using the GETSTELMODULE macro, passing as argument its name, which is also the QObject name
36
36
//! Because StelModules are very generic components, it is also possible to load them dynamically,
37
37
//! thus enabling creation of external plug-ins for stellarium.
38
 
//! @author Fabien Chereau
 
38
//! @sa StelObjectModule for StelModule managing collections of StelObject.
 
39
//! @sa @ref plugins for documentation on how to develop external plugins.
39
40
class StelModule : public QObject
40
41
{
 
42
        // Do not add Q_OBJECT here!!
 
43
        // This make this class compiled by the Qt moc compiler and for some unknown reasons makes it impossible to dynamically
 
44
        // load plugins on windows.
41
45
public:
42
46
        StelModule() {;}
43
47
 
57
61
        
58
62
        //! Update i18n strings from english names according to current global sky and application language.
59
63
        //! This method also reload the proper fonts depending on the language.
60
 
        //! The translation shall be done using the Translator provided by the StelApp singleton instance.
 
64
        //! The translation shall be done using the StelTranslator provided by the StelApp singleton instance.
61
65
        virtual void updateI18n() {;}
62
66
                   
63
67
        //! Update sky culture, i.e. load data if necessary and translate them to current sky language if needed.
64
 
        virtual void updateSkyCulture() {;}     
 
68
        //! @param skyCultureDir the name of the directory containing the sky culture to use.
 
69
        virtual void updateSkyCulture(const QString& skyCultureDir) {;} 
65
70
        
66
71
        //! Get the version of the module, default is stellarium main version
67
72
        virtual QString getModuleVersion() const;
74
79
 
75
80
        //! Handle mouse clicks. Please note that most of the interactions will be done through the GUI module. 
76
81
        //! @return set the event as accepted if it was intercepted
77
 
        virtual void handleMouseClicks(class QMouseEvent* event) {return;}
 
82
        virtual void handleMouseClicks(class QMouseEvent* e) {;}
78
83
        
79
84
        //! Handle mouse wheel. Please note that most of the interactions will be done through the GUI module. 
80
85
        //! @return set the event as accepted if it was intercepted
81
 
        virtual void handleMouseWheel(class QWheelEvent* event) {return;}
 
86
        virtual void handleMouseWheel(class QWheelEvent* e) {;}
82
87
        
83
88
        //! Handle mouse moves. Please note that most of the interactions will be done through the GUI module. 
84
89
        //! @return true if the event was intercepted
87
92
        //! Handle key events. Please note that most of the interactions will be done through the GUI module.
88
93
        //! @param event the Key event
89
94
        //! @return set the event as accepted if it was intercepted
90
 
        virtual void handleKeys(class QKeyEvent* event) {return;}
 
95
        virtual void handleKeys(class QKeyEvent* e) {;}
91
96
 
92
 
        //! Enum used when selecting objects to define whether to add to, replace, or remove from 
93
 
        //! the existing selection list.
 
97
        //! Enum used when selecting objects to define whether to add to, replace, or remove from the existing selection list.
94
98
        enum StelModuleSelectAction
95
99
        {
96
 
                AddToSelection,
97
 
                ReplaceSelection,
98
 
                RemoveFromSelection
 
100
                AddToSelection,     //!< Add the StelObject to the current list of selected ones.
 
101
                ReplaceSelection,       //!< Set the StelObject as the new list of selected ones.
 
102
                RemoveFromSelection //!< Subtract the StelObject from the current list of selected ones.
99
103
        };
100
 
 
 
104
        
101
105
        //! Indicate that the user requested selection of StelObjects.
102
106
        //! The StelModule should then manage by themself how they handle the event
103
107
        //! @param action define if the user requested that the objects are added to the selection or just replace it
113
117
        //! Define the possible action for which an order is defined
114
118
        enum StelModuleActionName
115
119
        {
116
 
                ActionDraw,
117
 
                ActionUpdate,
118
 
                ActionHangleMouseClicks,
119
 
                ActionHandleMouseMoves,
120
 
                ActionHandleKeys
 
120
                ActionDraw,              //!< Action associated to the draw() method
 
121
                ActionUpdate,            //!< Action associated to the update() method
 
122
                ActionHandleMouseClicks, //!< Action associated to the handleMouseClicks() method
 
123
                ActionHandleMouseMoves,  //!< Action associated to the handleMouseMoves() method
 
124
                ActionHandleKeys         //!< Action associated to the handleKeys() method
121
125
        };
122
126
        
123
127
        //! Return the value defining the order of call for the given action