vidwin.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (C) 2011 Teluu Inc. (http://www.teluu.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef VIDWIN_H
  19. #define VIDWIN_H
  20. #include <pjsua.h>
  21. #include <QWidget>
  22. #include <QBoxLayout>
  23. class VidWin : public QWidget
  24. {
  25. Q_OBJECT
  26. public:
  27. VidWin(const pjmedia_vid_dev_hwnd *hwnd,
  28. QWidget* parent = 0,
  29. Qt::WindowFlags f = 0);
  30. virtual ~VidWin();
  31. QSize sizeHint() const { return size_hint; }
  32. void putIntoLayout(QBoxLayout *layout);
  33. protected:
  34. virtual bool event(QEvent *e);
  35. private:
  36. pjmedia_vid_dev_hwnd hwnd;
  37. void *orig_parent;
  38. QSize size_hint;
  39. void attach();
  40. void detach();
  41. void set_size();
  42. void get_size();
  43. void show_sdl(bool visible=true);
  44. };
  45. #endif