Some todo notes for bible html rendering and text display
[kworship.git] / kworship / DesktopView.h
blob67b146be9e116fcf7b5747da235468284c33a1ce
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 private slots:
103 * Private slots
106 /// Indicates that a screen has been resized.
107 void resizeScreen(int screen);
109 private:
112 * Variables
115 /// Desktop rectangle size.
116 QRectF m_desktopRect;
118 /// Whether to allow multiple screens to be selected.
119 bool m_multiSelect;
121 /// Whether to allow no screen to be selected.
122 bool m_noSelect;
124 /// Which screen is selected when in singleselect.
125 int m_selectedScreen;
127 /// Which screens are selected when in multiselect.
128 QVector<bool> m_selectedScreens;
131 * Private functions
134 /// Setup the display.
135 void setup();
137 /// Change selection of a screen.
138 void selectScreen(int screen, bool newSelected);
140 /// Update a single selection status.
141 void singleSelectRestatus();
144 #endif // _DesktopView_h_