1 #ifndef MEETINGROOMCOMBO_H_
\r
2 #define MEETINGROOMCOMBO_H_
\r
4 #include "ObservedWidget.h"
\r
11 //! Userinterface class. Displays a list of selectable meeting rooms.
\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
16 class MeetingRoomCombo : public ObservedWidget
\r
23 * Constructs the MeetingRoomCombo.
\r
24 * \param aRooms List of available rooms.
\r
25 * \param aParent parent of the widget
\r
27 MeetingRoomCombo( QList<Room*> aRooms, QWidget *aParent = 0 );
\r
29 virtual ~MeetingRoomCombo();
\r
31 //! Number of rooms.
\r
33 * \return Number of rooms.
\r
38 * \return Index of currently selected item.
\r
43 * \return Pointer to the room currently selected.
\r
45 Room* currentRoom();
\r
48 //! Sets the current room
\r
50 * Sets the current room to match aIndex.
\r
51 * \param aIndex index of item to be selected.
\r
53 void setCurrentIndex( int aIndex );
\r
54 //! Sets the current room
\r
56 * Sets the current room to be aRoom.
\r
57 * \param aRoom Pointer to the room to be selected.
\r
59 void setCurrentRoom( Room *aRoom );
\r
60 //! Sets the current room
\r
62 * Sets the current room based on room's name.
\r
63 * \param aName Name of the room to be selected.
\r
65 void setCurrentRoomBy( const QString &aName );
\r
67 //! Searches for the room.
\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
73 int findRoom( Room *aRoom );
\r
74 //! Searches for the room.
\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
80 int findRoomBy( const QString &aName );
\r
83 //! Signals change of the current room.
\r
85 * Signal is emided when room is changed.
\r
86 * \param aNewIndex Index of the item now selected.
\r
88 void currentIndexChanged( int aNewIndex );
\r
89 //! Signals change of the current room.
\r
91 * Signal is emided when room is changed.
\r
92 * \param aNewRoom Pointer to the room now selected.
\r
94 void currentRoomChanged( Room *aNewRoom );
\r
97 //! Combobox containing the names of the rooms.
\r
98 QComboBox *iRoomCombo;
\r
100 QList<Room*> iRooms;
\r
103 #endif /*MEETINGROOMCOMBO_H_*/
\r