home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kmediaplayer / view.h < prev   
Encoding:
C/C++ Source or Header  |  2005-09-10  |  2.9 KB  |  99 lines

  1. // Copyright (C) 2002 Neil Stevens <neil@qualityassistant.com>
  2. //
  3. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4. // of this software and associated documentation files (the "Software"), to deal
  5. // in the Software without restriction, including without limitation the rights
  6. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. // copies of the Software, and to permit persons to whom the Software is
  8. // furnished to do so, subject to the following conditions:
  9. //
  10. // The above copyright notice and this permission notice shall be included in
  11. // all copies or substantial portions of the Software.
  12. //
  13. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  16. // THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  17. // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  18. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  19. //
  20. // Except as contained in this notice, the name(s) of the author(s) shall not be
  21. // used in advertising or otherwise to promote the sale, use or other dealings
  22. // in this Software without prior written authorization from the author(s).
  23.  
  24. #ifndef KMEDIAPLAYERVIEW_H
  25. #define KMEDIAPLAYERVIEW_H
  26.  
  27. #include <qwidget.h>
  28. #include <kdelibs_export.h>
  29.  
  30. namespace KMediaPlayer
  31. {
  32.  
  33. /** View is part of the user interface of a Player. */
  34. class KDE_EXPORT View : public QWidget
  35. {
  36. Q_OBJECT
  37.  
  38. public:
  39.     /** Your typical QWidget constructor. */
  40.     View(QWidget *parent, const char *name);
  41.     virtual ~View(void);
  42.  
  43.     /** The Possible buttons that can appear in the UI. */
  44.     enum Button
  45.     {
  46.         /** Button that connects to Player::play */
  47.         Play = 1,
  48.         /** Button that connects to Player::stop */
  49.         Stop = 2,
  50.         /** Button that connects to Player::pause */
  51.         Pause = 4,
  52.         /** A seeker that interfaces with Player::seek */
  53.         Seeker = 8,
  54.         /** Show all buttons. */
  55.         All = 255
  56.     };
  57.  
  58.     /** Return which buttons are being displayed. */
  59.     int buttons(void);
  60.  
  61.     /** Return the QWidget in which video is displayed.
  62.         May Return 0L if there is none. */
  63.     QWidget *videoWidget();
  64.  
  65. public slots:
  66.     /** Set which buttons to display. See Button. */
  67.     void setButtons(int);
  68.  
  69.     /** Returns if a particular button is being displayed. */
  70.     bool button(int);
  71.     /** Display a particular button. */
  72.     void showButton(int);
  73.     /** Stop displaying a particular button. */
  74.     void hideButton(int);
  75.     /** Toggle the display of a particular button. */
  76.     void toggleButton(int);
  77.  
  78. signals:
  79.     /** Emitted when the set of displayed buttons changes. */
  80.     void buttonsChanged(int);
  81.  
  82. protected:
  83.     /** The implementing view should set the widget in which
  84.         the video will be displayed. KMediaPlayer users may
  85.         reparent() it to somewhere else, for example.
  86.     */
  87.     void setVideoWidget(QWidget *videoWidget);
  88.  
  89. private:
  90.     int currentButtons;
  91.  
  92.     struct Data;
  93.     Data *d;
  94. };
  95.  
  96. }
  97.  
  98. #endif
  99.