ChatList.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*\
  2. |*| Copyright 2015-2016 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 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 General Public License for more details.
  14. |*|
  15. |*| You should have received a copy of the GNU 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 ();
  35. ~ChatList();
  36. //==============================================================================
  37. //[UserMethods] -- You can add your own custom methods in this section.
  38. private:
  39. friend class MainContent ;
  40. void valueTreeChildAdded (ValueTree& a_parent_node , ValueTree& a_node ) override ;
  41. void valueTreeChildRemoved (ValueTree& a_parent_node , ValueTree& a_node , int idx) override ;
  42. void valueTreePropertyChanged(ValueTree& a_node , const Identifier& a_key ) override ;
  43. void initialize (ValueTree network_store , ValueTree chatters_store) ;
  44. void createChatListItem(int child_idx) ;
  45. int sortedChatterIdx (ValueTree& chatter_store) ;
  46. void refresh () ;
  47. // unused ValueTree::Listener interface implementations
  48. void valueTreeChildOrderChanged(ValueTree& /*a_parent_node*/ , int /*prev_idx*/ , int /*curr_idx*/) override {}
  49. void valueTreeParentChanged (ValueTree& /*a_node*/ ) override {}
  50. void valueTreeRedirected (ValueTree& /*a_node*/ ) override {}
  51. //[/UserMethods]
  52. void paint (Graphics& g) override;
  53. void resized() override;
  54. private:
  55. //[UserVariables] -- You can add your own custom variables in this section.
  56. ValueTree networkStore ;
  57. ValueTree chattersStore ;
  58. OwnedArray<ChatListItem> chatListItems ;
  59. //[/UserVariables]
  60. //==============================================================================
  61. ScopedPointer<GroupComponent> chattersGroup;
  62. ScopedPointer<ChatListItem> dummyChatListItem;
  63. //==============================================================================
  64. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ChatList)
  65. };
  66. //[EndFile] You can add extra defines here...
  67. //[/EndFile]
  68. #endif // _CHATLIST_H_