TemplateWindow.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2009-2010, Pier Luigi Fiorini. All rights reserved.
  3. * Copyright 2021, Jaidyn Levesque. All rights reserved.
  4. * Distributed under the terms of the MIT License.
  5. */
  6. #ifndef _TEMPLATE_WINDOW_H
  7. #define _TEMPLATE_WINDOW_H
  8. #include <String.h>
  9. #include <Window.h>
  10. #include "ProtocolTemplate.h"
  11. #include "Server.h"
  12. class BAlert;
  13. class BMenu;
  14. class BMenuField;
  15. class BTextControl;
  16. class ProtocolSettings;
  17. class TemplateView;
  18. class TemplateWindow : public BWindow {
  19. public:
  20. /*! Get template from selected account's protocol
  21. * via ChatProtocol::SettingsTemplate() */
  22. TemplateWindow(const char* title,
  23. const char* templateType, BMessage* msg,
  24. Server* server, bigtime_t instance = -1);
  25. /*! Use only the given template. */
  26. TemplateWindow(const char* title,
  27. ProtocolTemplate* temp, BMessage* msg,
  28. Server* server, bigtime_t instance = -1);
  29. virtual void MessageReceived(BMessage* msg);
  30. void SetTarget(BHandler* target);
  31. private:
  32. void _InitInterface(bigtime_t instance);
  33. void _LoadTemplate();
  34. Server* fServer;
  35. int64 fSelectedAcc;
  36. BMenuField* fMenuField;
  37. ProtocolTemplate* fTemplate;
  38. BString fTemplateType;
  39. TemplateView* fTemplateView;
  40. BButton* fOkButton;
  41. BMessage* fMessage;
  42. BHandler* fTarget;
  43. };
  44. #endif // _TEMPLATE_WINDOW_H