5c7120a00cefe631d5706efb6a1a3b3a0396fdaa
[qtmeetings] / src / UserInterface / Components / MeetingRoomCombo.h
1 #ifndef MEETINGROOMCOMBO_H_\r
2 #define MEETINGROOMCOMBO_H_\r
3 \r
4 #include "ObservedWidget.h"\r
5 #include <QWidget>\r
6 #include <QList>\r
7 \r
8 class QComboBox;\r
9 class Room;\r
10 \r
11 //! Userinterface class. Displays a list of selectable meeting rooms.\r
12 /*!\r
13  * Userinterface class. Displays a list of selectable meeting rooms. Customized QComboBox which hides\r
14  * all the not needed functionality of the "base" class.\r
15  */\r
16 class MeetingRoomCombo : public ObservedWidget\r
17 {\r
18         Q_OBJECT\r
19 \r
20 public:\r
21         //! Constructor.\r
22         /*!\r
23          * Constructs the MeetingRoomCombo.\r
24          * \param aRooms List of available rooms.\r
25          * \param aParent parent of the widget\r
26          */\r
27         MeetingRoomCombo( QList<Room*> aRooms, QWidget *aParent = 0 );\r
28         //! Destructor.\r
29         virtual ~MeetingRoomCombo();\r
30 \r
31         //! Number of rooms.\r
32         /*!\r
33          * \return Number of rooms.\r
34          */\r
35         int count();\r
36         //! Current index\r
37         /*!\r
38          * \return Index of currently selected item.\r
39          */\r
40         int currentIndex();\r
41         //! Current room\r
42         /*!\r
43          * \return Pointer to the room currently selected.\r
44          */\r
45         Room* currentRoom();\r
46 \r
47 public slots:\r
48         //! Sets the current room\r
49         /*!\r
50          *  Sets the current room to match aIndex.\r
51          * \param aIndex index of item to be selected.\r
52          */\r
53         void setCurrentIndex( int aIndex );\r
54         //! Sets the current room\r
55         /*!\r
56          *  Sets the current room to be aRoom.\r
57          * \param aRoom Pointer to the room to be selected.\r
58          */\r
59         void setCurrentRoom( Room *aRoom );\r
60         //! Sets the current room\r
61         /*!\r
62          *  Sets the current room based on room's name.\r
63          * \param aName Name of the room to be selected.\r
64          */\r
65         void setCurrentRoomBy( const QString &aName );\r
66 \r
67         //! Searches for the room.\r
68         /*!\r
69          *  Searches for the room "aRoom".\r
70          * \param aRoom Pointer to the room to be searched.\r
71          * \return Index of room if found. Otherwise negative.\r
72          */\r
73         int findRoom( Room *aRoom );\r
74         //! Searches for the room.\r
75         /*!\r
76          *  Searches for the room by its name.\r
77          * \param aName Name of the room to be searched.\r
78          * \return Index of room if found. Otherwise negative.\r
79          */\r
80         int findRoomBy( const QString &aName );\r
81 \r
82 signals:\r
83         //! Signals change of the current room.\r
84         /*!\r
85          *  Signal is emided when room is changed.\r
86          * \param aNewIndex Index of the item now selected.\r
87          */\r
88         void currentIndexChanged( int aNewIndex );\r
89         //! Signals change of the current room.\r
90         /*!\r
91          *  Signal is emided when room is changed.\r
92          * \param aNewRoom Pointer to the room now selected.\r
93          */\r
94         void currentRoomChanged( Room *aNewRoom );\r
95 \r
96 private:\r
97         //! Combobox containing the names of the rooms.\r
98         QComboBox *iRoomCombo;\r
99         //! List of rooms.\r
100         QList<Room*> iRooms;\r
101 };\r
102 \r
103 #endif /*MEETINGROOMCOMBO_H_*/\r