Bibletime – a bible study tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cbuttons.h 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*********
  2. *
  3. * This file is part of BibleTime's source code, http://www.bibletime.info/.
  4. *
  5. * Copyright 1999-2006 by the BibleTime developers.
  6. * The BibleTime source code is licensed under the GNU General Public License version 2.0.
  7. *
  8. **********/
  9. #ifndef CBUTTONS_H
  10. #define CBUTTONS_H
  11. //BibleTime includes
  12. #include "backend/cswordbackend.h"
  13. #include "backend/cswordmoduleinfo.h"
  14. //QT includes
  15. #include <tqdict.h>
  16. //KDE includes
  17. #include <ktoolbarbutton.h>
  18. class TDEPopupMenu;
  19. /** This class manages the transliteration of the selected modules.
  20. * @author The BibleTime team
  21. */
  22. // class CTransliterationButton : public TDEToolBarButton {
  23. // Q_OBJECT
  24. //
  25. // public:
  26. // CTransliterationButton(CSwordBackend::FilterOptions* displayOptions, TQWidget *parent, const char *name=0);
  27. // ~CTransliterationButton();
  28. // /**
  29. // * Setup the menu entries.
  30. // */
  31. // void populateMenu();
  32. // /**
  33. // * Resets the buttons with the list of used modules.
  34. // */
  35. // void reset( ListCSwordModuleInfo& modules );
  36. //
  37. // protected slots: // Protected slots
  38. // void optionSelected(int);
  39. //
  40. // private:
  41. // TDEPopupMenu* m_popup;
  42. // CSwordBackend::FilterOptions* m_filterOptions;
  43. //
  44. // signals:
  45. // void sigChanged();
  46. // };
  47. /** This class manages the display options of the selected modules.
  48. * @author The BibleTime team
  49. */
  50. class CDisplaySettingsButton : public TDEToolBarButton {
  51. Q_OBJECT
  52. public:
  53. CDisplaySettingsButton(CSwordBackend::DisplayOptions *displaySettings, CSwordBackend::FilterOptions *settings, const ListCSwordModuleInfo& useModules, TQWidget *parent=0, const char *name=0);
  54. void reset(const ListCSwordModuleInfo& useModules);
  55. /**
  56. * Sets the item at position pos to the satet given as 2nd paramter.
  57. */
  58. void setItemStatus( const int pos, const bool checked );
  59. /**
  60. * Returns the number of usable menu items in the setttings menu.
  61. */
  62. const int menuItemCount();
  63. /**
  64. * Returns the status of the item at position "index"
  65. */
  66. const bool itemStatus( const int index );
  67. /**
  68. * Sets the status to changed. The signal changed will be emitted.
  69. */
  70. void setChanged();
  71. signals:
  72. void sigChanged(void);
  73. protected slots:
  74. void optionToggled(int ID);
  75. protected:
  76. CSwordBackend::FilterOptions* m_moduleSettings;
  77. CSwordBackend::DisplayOptions* m_displaySettings;
  78. CSwordBackend::FilterOptions m_available;
  79. ListCSwordModuleInfo m_modules;
  80. TQDict<int> m_dict;
  81. TDEPopupMenu* m_popup;
  82. int populateMenu();
  83. bool isOptionAvailable( const CSwordModuleInfo::FilterTypes option);
  84. int addMenuEntry( const TQString name, const int* option, const bool available);
  85. };
  86. #endif