Silence some unused parameter warnings
[kworship.git] / kworship / DesktopView.h
blob46b4e23df0b11ba3418513f35f423683baf7ace7
1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * KWorship is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * KWorship 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 KWorship. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef _DesktopView_h_
21 #define _DesktopView_h_
23 /**
24 * @file DesktopView.h
25 * @brief Preview of the screens on the desktop.
26 * @author James Hogan <james@albanarts.com>
29 #include <QGraphicsView>
30 #include <QVector>
32 /** Screens preview widget.
33 * @todo Ensure works well with out of range screen id in multiselect mode
35 class DesktopView : public QGraphicsView
37 Q_OBJECT
38 public:
41 * Constructors + destructor
44 /// Primary constructor.
45 DesktopView(QWidget* parent);
47 /// Destructor.
48 ~DesktopView();
51 * Properties
54 Q_PROPERTY(int selectedScreen READ selectedScreen WRITE setSelectedScreen)
57 * Main interface
60 /// Find whether a screen is selected.
61 bool isScreenSelected(int screen) const;
63 /// Find which single screen is selected.
64 int selectedScreen() const;
66 public slots:
69 * Public slots
72 /// Set the selected screen.
73 void setSelectedScreen(int selectedScreen);
75 signals:
78 * Public signals
81 /// A screen selection has changed.
82 void screenSelected(int screen, bool selected);
84 /// Current single select screen has changed.
85 void screenChanged(int screen);
87 /// Status message has changed.
88 void statusChanged(QString status);
90 protected:
93 * Events
96 void resizeEvent(QResizeEvent*);
98 void mousePressEvent(QMouseEvent* event);
100 void changeEvent(QEvent *event);
102 private slots:
105 * Private slots
108 /// Indicates that a screen has been resized.
109 void resizeScreen(int screen);
111 private:
114 * Variables
117 /// Desktop rectangle size.
118 QRectF m_desktopRect;
120 /// Whether to allow multiple screens to be selected.
121 bool m_multiSelect;
123 /// Whether to allow no screen to be selected.
124 bool m_noSelect;
126 /// Which screen is selected when in singleselect.
127 int m_selectedScreen;
129 /// Which screens are selected when in multiselect.
130 QVector<bool> m_selectedScreens;
133 * Private functions
136 /// Setup the display.
137 void setup();
139 /// Change selection of a screen.
140 void selectScreen(int screen, bool newSelected);
142 /// Update a single selection status.
143 void singleSelectRestatus();
146 #endif // _DesktopView_h_