bibletime
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.

cplainwritewindow.h 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 CPLAINWRITEWINDOW_H
  10. #define CPLAINWRITEWINDOW_H
  11. //BibleTime includes
  12. #include "cwritewindow.h"
  13. //TQt includes
  14. #include <tqwidget.h>
  15. class TDEAction;
  16. class TDEToggleAction;
  17. /** The write window class which offers a plain editor for source code editing.
  18. * @author The BibleTime team
  19. */
  20. class CPlainWriteWindow : public CWriteWindow {
  21. Q_OBJECT
  22. public:
  23. CPlainWriteWindow( ListCSwordModuleInfo modules, CMDIArea* parent, const char *name = 0 );
  24. virtual ~CPlainWriteWindow();
  25. /**
  26. * Store the settings of this window in the given CProfileWindow object.
  27. */
  28. virtual void storeProfileSettings( Profile::CProfileWindow* profileWindow );
  29. /**
  30. * Store the settings of this window in the given profile window.
  31. */
  32. virtual void applyProfileSettings( Profile::CProfileWindow* profileWindow );
  33. /**
  34. * Setups the popup menu of this display widget.
  35. */
  36. virtual void setupPopupMenu();
  37. virtual const bool syncAllowed() const;
  38. protected: // Protected methods
  39. /**
  40. * Initialize the state of this widget.
  41. */
  42. virtual void initView();
  43. virtual void initConnections();
  44. virtual void initToolbars();
  45. virtual const CDisplayWindow::WriteWindowType writeWindowType() {
  46. return CDisplayWindow::PlainTextWindow;
  47. };
  48. /**
  49. * Initializes the intern keyboard actions.
  50. */
  51. virtual void initActions();
  52. /**
  53. * Insert the keyboard accelerators of this window into the given TDEAccel object.
  54. */
  55. static void insertKeyboardActions( TDEActionCollection* const a );
  56. private:
  57. struct {
  58. TDEAction* saveText;
  59. TDEAction* deleteEntry;
  60. TDEAction* restoreText;
  61. TDEToggleAction* syncWindow;
  62. }
  63. m_actions;
  64. protected slots: // Protected slots
  65. /**
  66. * Saves the text for the current key. Directly writes the changed text into the module.
  67. */
  68. virtual void saveCurrentText( const TQString& );
  69. /**
  70. * Is called when the current text was changed.
  71. */
  72. virtual void textChanged();
  73. /**
  74. * Loads the original text from the module.
  75. */
  76. virtual void restoreText();
  77. /**
  78. * Deletes the module entry and clears the edit widget.
  79. */
  80. virtual void deleteEntry();
  81. };
  82. #endif