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