Index: sources/main.h =================================================================== diff -u -rc71946746586d5a4061ad866ce7dbbaf74b9798a -r7077e38c74db9cccb5496ffefcf8936c0916de76 --- sources/main.h (.../main.h) (revision c71946746586d5a4061ad866ce7dbbaf74b9798a) +++ sources/main.h (.../main.h) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) @@ -30,7 +30,7 @@ // TODO : A singleton parent class needs to be created // to taking care of the Threading, init, quit, and so -// TODO : +// TODO : Threading // - We still need to work on threading on other classes // - We need to have a singleton parent class // - Some code has been added to debug can interface (We still have swap frames) @@ -49,6 +49,7 @@ static vCLASS _instance; \ return _instance; \ } \ +private: //--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------// extern int gFakeInterval; @@ -174,7 +175,39 @@ return vDEFVALUE ; \ } //--------------------------------------------------------------------------------// +#define NOTIFIER( vVARIABLE ) \ + Q_SIGNALS: \ + /*! \brief Property notify signal + \details The property notify signal (...Changed) + which will be emitted by property setter + - if only the value has been changed \n + - or it's the first time property is set. \n + \return current value + */\ + void vVARIABLE##Notified( const bool & v##vVARIABLE ); \ + private: \ + bool _##vVARIABLE = false; \ + protected: \ + /*! \brief Property getter + \details The property getter which reads the private variable + \return current value + */\ + bool vVARIABLE () const { \ + return _##vVARIABLE ; \ + } \ + /*! \brief Notifier setter + \details The notifier setter which update the private variable \n + emits the notifier (is...) signal on update. \n + the notify signal (is...) passes the new value as its parameter. \n + \param new value + */\ + void vVARIABLE ( const bool & v##vVARIABLE ) { \ + DEBUG_PROPERTY_CHANGED(vVARIABLE, v) \ + _##vVARIABLE = v##vVARIABLE; \ + emit vVARIABLE##Notified( _##vVARIABLE ); \ + } //--------------------------------------------------------------------------------// +//--------------------------------------------------------------------------------// #define ACTION_VIEW_CONNECTION(vTYPE) \ connect(&_GuiController, SIGNAL(didActionReceive(const vTYPE &)), \ this, SLOT( onActionReceive(const vTYPE &)));