FreundesListe.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. #ifndef FreundesListe_H
  2. #define FreundesListe_H
  3. #include <Klient.h>
  4. #include <Zeichnung.h>
  5. #include <Fenster.h>
  6. #include <Array.h>
  7. #include <Knopf.h>
  8. #include <Thread.h>
  9. #include <Rahmen.h>
  10. using namespace Framework;
  11. class FreundData : public Thread
  12. {
  13. private:
  14. LRahmen* rahmen;
  15. AlphaFeld* auswahlBuffer;
  16. TextFeld* name;
  17. TextFeld* status;
  18. Knopf* entfernen;
  19. Knopf* ansehen;
  20. Knopf* nachricht;
  21. Knopf* einladen;
  22. int accountId;
  23. bool einladenSichtbar;
  24. bool online;
  25. bool ausgewählt;
  26. int höhe;
  27. int animation;
  28. unsigned char auswahlAlpha;
  29. double tickVal;
  30. bool rend;
  31. public:
  32. // Konstruktor
  33. FreundData(int accountId, LRahmen* rahmen, AlphaFeld* auswahlBuffer);
  34. // Destruktor
  35. ~FreundData();
  36. // nicht constant
  37. void thread();
  38. void setName(const char* txt);
  39. void setStatus(const char* txt);
  40. void setOnline(bool online);
  41. void setAusgewählt(bool ausw);
  42. void remove();
  43. void zeigeEinladeKnopf(bool zeigen);
  44. void doPublicMausEreignis(MausEreignis& me);
  45. bool tick(double tickVal);
  46. void render(int yPos, Bild& zRObj);
  47. // constant
  48. bool istOnline() const;
  49. bool istAusgewählt() const;
  50. const char* zName() const;
  51. Text* getName() const;
  52. const char* zStatus() const;
  53. Text* getStatus() const;
  54. int getAccountId() const;
  55. int getHeight() const;
  56. };
  57. class FreundesListeObj : public Zeichnung
  58. {
  59. private:
  60. RCArray< FreundData >* members;
  61. LRahmen* memberRahmen;
  62. AlphaFeld* auswahlBuffer;
  63. VScrollBar* vsb;
  64. Punkt bildschirmGröße;
  65. bool einladenSichtbar;
  66. int memberNummer;
  67. public:
  68. // Konstruktor
  69. FreundesListeObj();
  70. // Destruktor
  71. ~FreundesListeObj();
  72. // nicht constant
  73. void addMember(int accountId);
  74. void removeMember(int accountId);
  75. void removeMember(FreundData* member);
  76. void removeAll();
  77. void setName(int accountId, const char* txt);
  78. void setStatus(int accountId, const char* txt);
  79. void setOnline(int accountId, bool online);
  80. void zeigeEinladeKnopf(bool zeigen);
  81. bool tick(double tickVal) override;
  82. void doPublicMausEreignis(MausEreignis& me) override;
  83. void render(Bild& zRObj) override;
  84. // constant
  85. bool istFreund(int accId) const;
  86. };
  87. class FreundesListe : public Thread
  88. {
  89. private:
  90. Fenster* fenster;
  91. TextFeld* überschrift;
  92. TextFeld* accountName;
  93. Knopf* minMax;
  94. Knopf* neuerFreund;
  95. Knopf* neuerChat;
  96. FreundesListeObj* freundesListe;
  97. Punkt bildschirmGröße;
  98. Fenster* neuerFreundFenster;
  99. TextFeld* neuerFreundSpielerName;
  100. Knopf* neuerFreundFertig;
  101. Fenster* neuerChatFenster;
  102. TextFeld* neuerChatName;
  103. Knopf* neuerChatFertig;
  104. TextFeld* neuesChatroomName;
  105. Knopf* neuesChatroomFertig;
  106. Bild* minimierenBild;
  107. Bild* maximierenBild;
  108. int animation;
  109. double tickVal;
  110. bool neuerFreundSichtbar;
  111. bool neuerChatSichtbar;
  112. bool rend;
  113. public:
  114. // Konstruktor
  115. FreundesListe(Fenster* zNachLoginFenster);
  116. // Destruktor
  117. ~FreundesListe();
  118. // nicht constant
  119. void addMember(int accountId);
  120. void removeMember(int accountId);
  121. void removeMember(FreundData* member);
  122. void removeAll();
  123. void setName(int accountId, const char* txt);
  124. void setStatus(int accountId, const char* txt);
  125. void setOnline(int accountId, bool online);
  126. void setAnimation(int animation);
  127. void thread();
  128. void zeigeEinladeKnopf(bool zeigen);
  129. bool tick(double tickVal);
  130. bool druckMinMax(MausEreignis& me);
  131. bool druckName(TastaturEreignis& te);
  132. bool druckNeuerFreund(MausEreignis& me);
  133. bool druckNeuerChat(MausEreignis& me);
  134. bool druckNeuerFreundSpielerName(TastaturEreignis& te);
  135. bool druckNeuerFreundFertig(MausEreignis& me);
  136. bool druckNeuerChatName(TastaturEreignis& te);
  137. bool druckNeuerChatFertig(MausEreignis& me);
  138. bool druckNeuesChatroomName(TastaturEreignis& te);
  139. bool druckNeuesChatroomFertig(MausEreignis& me);
  140. // constant
  141. bool istFreund(int accId) const;
  142. };
  143. // Nachrichten
  144. bool freundesListeMinMaxME(void* p, void* obj, MausEreignis me);
  145. bool freundesListeNameTE(void* p, void* obj, TastaturEreignis te);
  146. bool freundesListeNeuerFreundME(void* p, void* obj, MausEreignis me);
  147. bool freundesListeNeuerChatME(void* p, void* obj, MausEreignis me);
  148. bool freundesListeNeuerFreundSpielerNameTE(void* p, void* obj, TastaturEreignis te);
  149. bool freundesListeNeuerFreundFertigME(void* p, void* obj, MausEreignis me);
  150. bool freundesListeNeuerChatNameTE(void* p, void* obj, TastaturEreignis te);
  151. bool freundesListeNeuerChatFertigME(void* p, void* obj, MausEreignis me);
  152. bool freundesListeNeuesChatroomNameTE(void* p, void* obj, TastaturEreignis te);
  153. bool freundesListeNeuesChatroomFertigME(void* p, void* obj, MausEreignis me);
  154. #endif