srcfilewin.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 View;
  20. class Cursor;
  21. }
  22. class SourceFileWindow : public QMainWindow, public Ui::SourceFileWindow
  23. {
  24. Q_OBJECT
  25. public:
  26. SourceFileWindow(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = Qt::WType_TopLevel);
  27. ~SourceFileWindow();
  28. virtual void initBase();
  29. void * createView(const QString &fileName, const QString &hlModeName, unsigned tabWidth);
  30. virtual int savePrompt(void);
  31. virtual void applyPreferences();
  32. public slots:
  33. virtual void destroy();
  34. virtual void te_popup_aboutToShow();
  35. virtual void te_popup_activated( int index );
  36. virtual void accel_activated( int index );
  37. virtual void fileSave();
  38. virtual void fileSaveAs();
  39. virtual void fileAddToProject();
  40. virtual void fileCompile();
  41. virtual void filePrint();
  42. virtual void filePrintQuickly();
  43. virtual void editUndo();
  44. virtual void editRedo();
  45. virtual void editClear();
  46. virtual void editCut();
  47. virtual void editCopy();
  48. virtual void editPaste();
  49. virtual void editSelectAll();
  50. virtual void editIncreaseIndent();
  51. virtual void editDecreaseIndent();
  52. virtual void findFind();
  53. virtual void findFind_next();
  54. virtual void findFind_highlight( const QString & unused_text, int matchingindex, int matchedlength );
  55. virtual void findFind_stop();
  56. virtual void findReplace();
  57. virtual void findReplace_next();
  58. virtual void findReplace_highlight( const QString & unused_text, int matchingindex, int matchedlength );
  59. virtual void findReplace_replace( const QString & text, int replacementIndex, int replacedLength, int matchedLength );
  60. virtual void findReplace_stop();
  61. virtual void findFunctions();
  62. virtual void findFunctions_functionListBox_highlighted( int index );
  63. virtual void findFunctions_functionListBox_selected( int index );
  64. virtual void findFunctions_prototypeButton_clicked();
  65. virtual void findFunctions_implementationButton_clicked();
  66. virtual void findFunctionsPopup_aboutToShow();
  67. virtual void findFunctionsPopup_aboutToHide();
  68. virtual void findFunctionsPopup_aboutToHide_async();
  69. virtual void findFunctionsPopup_activated( int id );
  70. virtual void findOpenFileAtCursor();
  71. virtual void findFindSymbolDeclaration();
  72. virtual void resizeEvent( QResizeEvent * event );
  73. virtual void statusBar_messageChanged( const QString & message );
  74. virtual void current_view_cursorPositionChanged();
  75. virtual void current_view_textChanged();
  76. virtual void current_view_undoChanged();
  77. virtual void current_view_selectionChanged();
  78. virtual void current_view_textInserted(KTextEditor::View *view, const KTextEditor::Cursor &position, const QString &text);
  79. virtual void clipboard_dataChanged();
  80. virtual void KDirWatch_dirty( const QString & fileName );
  81. virtual void completionPopup_closed();
  82. protected:
  83. virtual void closeEvent( QCloseEvent * e );
  84. protected slots:
  85. virtual void languageChange();
  86. private:
  87. void removeTrailingSpacesFromView( void * view );
  88. void findReplace_next( bool firstTime );
  89. void updateSizes();
  90. void updateRightStatusLabel();
  91. void current_view_newLineHook();
  92. };