ChatList.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*\
  2. |*| Copyright 2015 bill-auger <https://github.com/bill-auger/av-caster/issues>
  3. |*|
  4. |*| This file is part of the AvCaster program.
  5. |*|
  6. |*| AvCaster is free software: you can redistribute it and/or modify
  7. |*| it under the terms of the GNU Lesser General Public License version 3
  8. |*| as published by the Free Software Foundation.
  9. |*|
  10. |*| AvCaster is distributed in the hope that it will be useful,
  11. |*| but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. |*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. |*| GNU Lesser General Public License for more details.
  14. |*|
  15. |*| You should have received a copy of the GNU Lesser General Public License
  16. |*| along with AvCaster. If not, see <http://www.gnu.org/licenses/>.
  17. \*/
  18. #ifndef _CHATLIST_H_
  19. #define _CHATLIST_H_
  20. //[Headers] -- You can add your own extra header files here --
  21. #include "ChatListItem.h"
  22. //[/Headers]
  23. //==============================================================================
  24. /**
  25. //[Comments]
  26. ChatList is the GUI container for ChatListItem instances
  27. //[/Comments]
  28. */
  29. class ChatList : public Component,
  30. public ValueTree::Listener
  31. {
  32. public:
  33. //==============================================================================
  34. ChatList (ValueTree chatters_store);
  35. ~ChatList();
  36. //==============================================================================
  37. //[UserMethods] -- You can add your own custom methods in this section.
  38. //[/UserMethods]
  39. void paint (Graphics& g);
  40. void resized();
  41. private:
  42. //[UserVariables] -- You can add your own custom variables in this section.
  43. void valueTreeChildAdded (ValueTree& chatters_store , ValueTree& chatter_store) override ;
  44. void valueTreeChildRemoved(ValueTree& chatters_store , ValueTree& chatter_store) override ;
  45. void createChatListItem(int child_idx) ;
  46. int sortedChildIdx (ValueTree& a_parent_node , ValueTree& a_node) ;
  47. void refresh () ;
  48. // unused ValueTree::Listener interface implementations
  49. void valueTreePropertyChanged( ValueTree& a_node , const Identifier& a_key) override { UNUSED(a_node) ; UNUSED(a_key) ; } ;
  50. void valueTreeChildOrderChanged(ValueTree& a_parent_node) override { UNUSED(a_parent_node) ; } ;
  51. void valueTreeParentChanged( ValueTree& a_node) override { UNUSED(a_node) ; } ;
  52. void valueTreeRedirected( ValueTree& a_node) override { UNUSED(a_node) ; } ;
  53. ValueTree chattersStore ;
  54. //[/UserVariables]
  55. //==============================================================================
  56. ScopedPointer<GroupComponent> chattersGroup;
  57. ScopedPointer<ChatListItem> dummyChatListItem;
  58. //==============================================================================
  59. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChatList)
  60. };
  61. //[EndFile] You can add extra defines here...
  62. //[/EndFile]
  63. #endif // _CHATLIST_H_