srcfilewin.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. ktigcc - TIGCC IDE for KDE
  3. Copyright (C) 2007 Kevin Kofler
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software Foundation,
  14. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #pragma once
  17. #include "ui_srcfilewin.h"
  18. namespace KTextEditor {
  19. class Document;
  20. class View;
  21. class Cursor;
  22. }
  23. class SourceFileWindow : public QMainWindow, public Ui::SourceFileWindow
  24. {
  25. Q_OBJECT
  26. public:
  27. SourceFileWindow(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = Qt::WType_TopLevel);
  28. ~SourceFileWindow();
  29. virtual void initBase();
  30. void * createView(const QString &fileName, const QString &hlModeName, unsigned tabWidth);
  31. virtual int savePrompt(void);
  32. virtual void applyPreferences();
  33. public slots:
  34. virtual void destroy();
  35. virtual void te_popup_aboutToShow();
  36. virtual void te_popup_activated( int index );
  37. virtual void shortcut_0_activated();
  38. virtual void shortcut_1_activated();
  39. virtual void shortcut_2_activated();
  40. virtual void shortcut_3_activated();
  41. virtual void shortcut_4_activated();
  42. virtual void shortcut_5_activated();
  43. virtual void shortcut_6_activated();
  44. virtual void shortcut_7_activated();
  45. virtual void shortcut_8_activated();
  46. virtual void shortcut_9_activated();
  47. virtual void shortcut_10_activated();
  48. virtual void fileSave();
  49. virtual void fileSaveAs();
  50. virtual void fileAddToProject();
  51. virtual void fileCompile();
  52. virtual void filePrint();
  53. virtual void filePrintQuickly();
  54. virtual void editUndo();
  55. virtual void editRedo();
  56. virtual void editClear();
  57. virtual void editCut();
  58. virtual void editCopy();
  59. virtual void editPaste();
  60. virtual void editSelectAll();
  61. virtual void editIncreaseIndent();
  62. virtual void editDecreaseIndent();
  63. virtual void findFind();
  64. virtual void findFind_next();
  65. virtual void findFind_highlight( const QString & text, int matchingindex, int matchedlength );
  66. virtual void findFind_stop();
  67. virtual void findReplace();
  68. virtual void findReplace_next();
  69. virtual void findReplace_highlight( const QString & text, int matchingindex, int matchedlength );
  70. virtual void findReplace_replace( const QString & text, int replacementIndex, int replacedLength, int matchedLength );
  71. virtual void findReplace_stop();
  72. virtual void findFunctions();
  73. virtual void findFunctions_functionListBox_highlighted( int index );
  74. virtual void findFunctions_functionListBox_selected( int index );
  75. virtual void findFunctions_prototypeButton_clicked();
  76. virtual void findFunctions_implementationButton_clicked();
  77. virtual void findFunctionsPopup_aboutToShow();
  78. virtual void findFunctionsPopup_aboutToHide();
  79. virtual void findFunctionsPopup_aboutToHide_async();
  80. virtual void findFunctionsPopup_activated( int id );
  81. virtual void findOpenFileAtCursor();
  82. virtual void findFindSymbolDeclaration();
  83. virtual void resizeEvent( QResizeEvent * event );
  84. virtual void statusBar_messageChanged(const QString &message);
  85. virtual void current_view_cursorPositionChanged(KTextEditor::View *view, const KTextEditor::Cursor &newPosition);
  86. virtual void current_view_textChanged(KTextEditor::Document *document);
  87. virtual void current_view_undoChanged();
  88. virtual void current_view_selectionChanged(KTextEditor::View *view);
  89. virtual void current_view_textInserted(KTextEditor::View *view, const KTextEditor::Cursor &position, const QString &text);
  90. virtual void clipboard_dataChanged();
  91. virtual void KDirWatch_dirty( const QString & fileName );
  92. virtual void completionPopup_closed();
  93. protected:
  94. virtual void closeEvent(QCloseEvent *e);
  95. protected slots:
  96. virtual void languageChange();
  97. private:
  98. void removeTrailingSpacesFromView(void *view);
  99. void findReplace_next(bool firstTime);
  100. void updateSizes();
  101. void updateRightStatusLabel();
  102. void current_view_newLineHook();
  103. void shortcutActivated(int index);
  104. };