NachrichtenListe.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #ifndef NachrichtenListe_H
  2. #define NachrichtenListe_H
  3. #include <Klient.h>
  4. #include <Array.h>
  5. #include <Fenster.h>
  6. #include <Knopf.h>
  7. #include <GSLSoundV.h>
  8. #include "..\..\Aktionen\AktionsThread.h"
  9. using namespace Framework;
  10. using namespace Network;
  11. namespace NachrichtType
  12. {
  13. const char nachricht = 0;
  14. const char freundEntfernen = 1;
  15. const char freundEinladung = 2;
  16. const char spielEinladung = 3;
  17. const char chatroomEinladung = 4;
  18. const char logout = 5;
  19. const char close = 6;
  20. }
  21. struct SpielEinladungParam
  22. {
  23. int vonAccount;
  24. int gruppeId;
  25. };
  26. struct ChatroomEinladungParam
  27. {
  28. int vonAccount;
  29. int chatroomId;
  30. };
  31. class Nachricht
  32. {
  33. private:
  34. TextFeld *titel;
  35. TextFeld *text;
  36. Knopf *close;
  37. Knopf *positiv;
  38. Knopf *negativ;
  39. LRahmen *rahmen;
  40. int höhe;
  41. int maxHöhe;
  42. bool ausgewählt;
  43. int animation;
  44. double tickVal;
  45. char typ;
  46. void *param;
  47. bool rend;
  48. int ref;
  49. public:
  50. // Konstruktor
  51. Nachricht( Schrift *zSchrift, Text *titel, Text *nachricht, Text *positiv, Text *negativ, char type, void *param );
  52. // Destruktor
  53. ~Nachricht();
  54. // nicht constant
  55. void entfernen();
  56. void setAusgewählt( bool ausgewählt );
  57. void doMausEreignis( MausEreignis &me );
  58. bool tick( double tickVal );
  59. void render( int y, Bild &zRObj );
  60. // contant
  61. bool istAusgewählt() const;
  62. int getHeight() const;
  63. // Reference Counting
  64. Nachricht *getThis();
  65. Nachricht *release();
  66. };
  67. class NachrichtenListeObj : public Zeichnung
  68. {
  69. private:
  70. RCArray< Nachricht > *members;
  71. VScrollBar *vsb;
  72. Schrift *schrift;
  73. Punkt bildschirmGröße;
  74. int anzahl;
  75. int ref;
  76. public:
  77. // Konstruktor
  78. NachrichtenListeObj( Schrift *zSchrift );
  79. // Destruktor
  80. ~NachrichtenListeObj();
  81. // nicht constant
  82. void addNachricht( Text *titel, Text *nachricht, Text *positiv, Text *negativ, char type, void *param );
  83. void removeNachricht( Nachricht *zNachricht );
  84. void removeAll();
  85. bool tick( double tickVal ) override;
  86. void doMausEreignis( MausEreignis &me ) override;
  87. void render( Bild &zRObj ) override;
  88. // contant
  89. // Reference Counting
  90. NachrichtenListeObj *getThis();
  91. NachrichtenListeObj *release();
  92. };
  93. class NachrichtenListe
  94. {
  95. private:
  96. Fenster *fenster;
  97. Knopf *minMax;
  98. NachrichtenListeObj *nachrichtenListe;
  99. Punkt bildschirmGröße;
  100. TextFeld *überschrift;
  101. Bild *minimierenBild;
  102. Bild *maximierenBild;
  103. GSL::GSLSoundV *msgSound;
  104. GSL::GSLSoundV *errSound;
  105. double tickVal;
  106. int animation;
  107. bool rend;
  108. int ref;
  109. public:
  110. // Konstruktor
  111. NachrichtenListe( Schrift *zSchrift, Fenster *zNachLoginFenster );
  112. // Destruktor
  113. ~NachrichtenListe();
  114. // nicht constant
  115. void addNachricht( Text *titel, Text *nachricht, Text *positiv = 0, Text *negativ = 0, char type = NachrichtType::nachricht, void *param = 0 );
  116. void removeNachricht( Nachricht *zNachricht );
  117. void removeAll();
  118. bool druckMinMax( MausEreignis &me );
  119. bool tick( double tickVal );
  120. // contant
  121. // Reference Counting
  122. NachrichtenListe *getThis();
  123. NachrichtenListe *release();
  124. };
  125. // Nachrichten
  126. bool NachrichtenListeMinMaxME( void *p, void *obj, MausEreignis me );
  127. #endif