• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KMediaPlayer

  • sources
  • kde-4.14
  • kdelibs
  • interfaces
  • kmediaplayer
view.cpp
Go to the documentation of this file.
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 #include <kmediaplayer/view.h>
25 
26 struct KMediaPlayer::View::Data
27 {
28  Data() : videoWidget(0L) {}
29 
30  QWidget *videoWidget;
31 };
32 
33 KMediaPlayer::View::View(QWidget *parent)
34  : QWidget(parent)
35  , currentButtons((int)All)
36  , d(new Data())
37 {
38 }
39 
40 KMediaPlayer::View::~View(void)
41 {
42  delete d;
43 }
44 
45 int KMediaPlayer::View::buttons(void)
46 {
47  return currentButtons;
48 }
49 
50 void KMediaPlayer::View::setButtons(int buttons)
51 {
52  if(buttons != currentButtons)
53  {
54  currentButtons = buttons;
55  emit buttonsChanged(buttons);
56  }
57 }
58 
59 bool KMediaPlayer::View::button(int b)
60 {
61  return currentButtons & b;
62 }
63 
64 void KMediaPlayer::View::showButton(int b)
65 {
66  setButtons(currentButtons | b);
67 }
68 
69 void KMediaPlayer::View::hideButton(int b)
70 {
71  setButtons(currentButtons & ~b);
72 }
73 
74 void KMediaPlayer::View::toggleButton(int b)
75 {
76  setButtons(currentButtons ^ b);
77 }
78 
79 void KMediaPlayer::View::setVideoWidget(QWidget *videoWidget)
80 {
81  d->videoWidget = videoWidget;
82 }
83 
84 QWidget* KMediaPlayer::View::videoWidget()
85 {
86  return d->videoWidget;
87 }
88 
89 #include "view.moc"
QWidget
KMediaPlayer::View::setButtons
void setButtons(int)
Set which buttons to display.
Definition: view.cpp:50
view.h
KMediaPlayer::View::showButton
void showButton(int)
Display a particular button.
Definition: view.cpp:64
KMediaPlayer::View::videoWidget
QWidget * videoWidget()
Return the QWidget in which video is displayed.
Definition: view.cpp:84
KMediaPlayer::View::~View
virtual ~View(void)
Definition: view.cpp:40
KMediaPlayer::View::button
bool button(int)
Returns if a particular button is being displayed.
Definition: view.cpp:59
KMediaPlayer::View::buttons
int buttons(void)
Return which buttons are being displayed.
Definition: view.cpp:45
KMediaPlayer::View::setVideoWidget
void setVideoWidget(QWidget *videoWidget)
The implementing view should set the widget in which the video will be displayed. ...
Definition: view.cpp:79
KMediaPlayer::View::View
View(QWidget *parent)
Your typical QWidget constructor.
Definition: view.cpp:33
KMediaPlayer::View::hideButton
void hideButton(int)
Stop displaying a particular button.
Definition: view.cpp:69
KMediaPlayer::View::toggleButton
void toggleButton(int)
Toggle the display of a particular button.
Definition: view.cpp:74
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:27:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KMediaPlayer

Skip menu "KMediaPlayer"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal