browserbuttons.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef BROWSERBUTTONS_H
  2. #define BROWSERBUTTONS_H
  3. #include <QWidget>
  4. #include <QToolBar>
  5. #include <QToolButton>
  6. #include <QFrame>
  7. #include <qtextbrowser.h>
  8. #include <qdirmodel.h>
  9. #include <QMenu>
  10. #include <QToolButton>
  11. #include <QVBoxLayout>
  12. #include <QSpacerItem>
  13. #include <QLineEdit>
  14. #include <QHBoxLayout>
  15. #include <QLabel>
  16. /*! \class BrowserButtons
  17. \brief Draws file browser buttons.
  18. BrowserButtons class is used to draw all file browser required buttons. Depending on the device type it does some specific
  19. adaptations:
  20. - For mobile devices buttons sizes are fixed
  21. - For desktop PCs some more butons are added
  22. For desktop environment BrowserButtons::tbView is shown by default but it has to be connected to a slot, is not connected by default
  23. BrowserButtons::tbExit is hidden by default but is connectedo to application's exit slot
  24. */
  25. class BrowserButtons : public QToolBar
  26. {
  27. Q_OBJECT
  28. public:
  29. //! Class constructor
  30. /*!
  31. This function adds the buttons and sets common sizes
  32. */
  33. explicit BrowserButtons(QWidget *parent = 0);
  34. //! Buttons container
  35. QFrame *tButtons;
  36. //! Horizontal layout for displaying buttons in the container
  37. QHBoxLayout *layout;
  38. //! Go to previous url button
  39. QToolButton *tbPrev;
  40. //! Go to next url button
  41. QToolButton *tbNext;
  42. //! Go to on level up button
  43. QToolButton *tbUp;
  44. //! Go to defined home url button
  45. QToolButton *tbHome;
  46. //! Button to change between icon or list view modes
  47. QToolButton *tbView;
  48. //! Button for maximizing the window. It is shown by default but needs to be connected to a slot
  49. QToolButton *tbFull;
  50. //! Exit button. This button is hidden by default by connected to application's exit slot
  51. QToolButton *tbExit;
  52. private:
  53. signals:
  54. public slots:
  55. /*!
  56. Performs some actions to adapt the layout to mobile devices
  57. */
  58. void setMobileGUI();
  59. /*!
  60. Performs some actions to adapt the layout to desktop PCs, i.e. it adds some more buttons
  61. */
  62. void setDesktopGUI();
  63. };
  64. #endif // BROWSERBUTTONS_H