~ubuntu-branches/debian/sid/universalindentgui/sid

« back to all changes in this revision

Viewing changes to src/MainWindow.h~

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-05-22 08:49:27 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120522084927-oijnyby6gedsinbh
Tags: 1.2.0-1
* New upstream release.
* Drop 02_fix_gcc_4.5_build.patch - merged upstream.
* Update debian/contol:
  - bump debhelper to 9.
  - bump Standards-Version to 3.9.3 (no changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2006-2008 by Thomas Schweitzer                          *
3
 
 *   thomas-schweitzer(at)arcor.de                                         *
4
 
 *                                                                         *
5
 
 *   This program is free software; you can redistribute it and/or modify  *
6
 
 *   it under the terms of the GNU General Public License version 2.0 as   *
7
 
 *   published by the Free Software Foundation.                            *
8
 
 *                                                                         *
9
 
 *   This program is distributed in the hope that it will be useful,       *
10
 
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 
 *   GNU General Public License for more details.                          *
13
 
 *                                                                         *
14
 
 *   You should have received a copy of the GNU General Public License     *
15
 
 *   along with this program in the file LICENSE.GPL; if not, write to the *
16
 
 *   Free Software Foundation, Inc.,                                       *
17
 
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 
 ***************************************************************************/
19
 
 
20
 
#ifndef MAINWINDOW_H
21
 
#define MAINWINDOW_H
22
 
 
23
 
#include "ui_MainWindow.h"
24
 
#include "ui_toolBarWidget.h"
25
 
#include "AboutDialog.h"
26
 
#include "AboutDialogGraphicsView.h"
27
 
#include "uiguisettings.h"
28
 
#include "uiguisettingsdialog.h"
29
 
#include "UiguiHighlighter.h"
30
 
#include "IndentHandler.h"
31
 
#include "updatecheckdialog.h"
32
 
 
33
 
#include <QWidget>
34
 
#include <QString>
35
 
#include <QScrollBar>
36
 
#include <QTextCursor>
37
 
#include <QFileDialog>
38
 
#include <QTextStream>
39
 
#include <QPrinter>
40
 
#include <QPrintDialog>
41
 
#include <QCloseEvent>
42
 
#include <QHelpEvent>
43
 
#include <QToolTip>
44
 
#include <QTranslator>
45
 
#include <QLocale>
46
 
#include <QTextCodec>
47
 
#include <QDate>
48
 
 
49
 
#include <Qsci/qsciscintilla.h>
50
 
#include <Qsci/qsciprinter.h>
51
 
 
52
 
class MainWindow : public QMainWindow, private Ui::MainWindowUi
53
 
{
54
 
    Q_OBJECT
55
 
 
56
 
public:
57
 
    //! Constructor
58
 
    MainWindow(QString file2OpenOnStart = "", QWidget *parent = 0);
59
 
 
60
 
private:
61
 
    QString loadFile(QString filePath);
62
 
    QString openFileDialog(QString dialogHeaderStr, QString startPath, QString fileMaskStr);
63
 
    void updateWindowTitle();
64
 
    void loadLastOpenedFile();
65
 
    void saveSettings();
66
 
    bool maybeSave();
67
 
    void createEncodingMenu();
68
 
    void createHighlighterMenu();
69
 
    bool initApplicationLanguage();
70
 
    void initMainWindow();
71
 
    void initToolBar();
72
 
    void initTextEditor();
73
 
    void initSyntaxHighlighter();
74
 
    void initIndenter();
75
 
    void changeEvent(QEvent *event);
76
 
    void dragEnterEvent(QDragEnterEvent *event);
77
 
    void dropEvent(QDropEvent *event);
78
 
 
79
 
        QsciScintilla *qSciSourceCodeEditor;
80
 
        UiguiSettings *settings;
81
 
 
82
 
    QString version;
83
 
    QString revision;
84
 
    QString buildDateStr;
85
 
 
86
 
        QString currentEncoding;
87
 
    QString sourceFileContent;
88
 
    QString sourceFormattedContent;
89
 
    QString sourceViewContent;
90
 
    UiguiHighlighter *highlighter;
91
 
    QScrollBar *textEditVScrollBar;
92
 
    AboutDialog *aboutDialog;
93
 
    AboutDialogGraphicsView *aboutDialogGraphicsView;
94
 
        UiguiSettingsDialog *settingsDialog;
95
 
    int textEditLastScrollPos;
96
 
    int currentIndenterID;
97
 
        bool loadLastSourceCodeFileOnStartup;
98
 
    QString currentSourceFile;
99
 
    QString currentSourceFileExtension;
100
 
    QString savedSourceContent;
101
 
    QActionGroup *encodingActionGroup;
102
 
    QActionGroup *saveEncodedActionGroup;
103
 
    QActionGroup *highlighterActionGroup;
104
 
    QTranslator *uiGuiTranslator;
105
 
    QTranslator *qTTranslator;
106
 
    bool isFirstRunOfThisVersion;
107
 
 
108
 
    bool sourceCodeChanged;
109
 
    bool scrollPositionChanged;
110
 
    bool indentSettingsChanged;
111
 
    bool previewToggled;
112
 
        QStringList encodingsList;
113
 
 
114
 
    Ui::toolBarWidget *toolBarWidget;
115
 
    IndentHandler *indentHandler;
116
 
    UpdateCheckDialog *updateCheckDialog;
117
 
    QLabel *textEditLineColumnInfoLabel;
118
 
 
119
 
protected:
120
 
    void closeEvent( QCloseEvent *event );
121
 
    bool eventFilter(QObject *obj, QEvent *event);
122
 
 
123
 
private slots:
124
 
    void openSourceFileDialog(QString fileName = "");
125
 
    bool saveasSourceFileDialog(QAction *chosenEncodingAction = NULL);
126
 
    void saveAsOtherEncoding(QAction *chosenEncodingAction);
127
 
    bool saveSourceFile();
128
 
    void callIndenter();
129
 
    void updateSourceView();
130
 
    void turnHighlightOnOff(bool turnOn);
131
 
        void setWhiteSpaceVisibility(bool visible);
132
 
        void sourceCodeChangedHelperSlot();
133
 
    void sourceCodeChangedSlot();
134
 
    void indentSettingsChangedSlot();
135
 
    void previewTurnedOnOff(bool turnOn);
136
 
    void exportToPDF();
137
 
    void exportToHTML();
138
 
        void languageChanged(int languageIndex);
139
 
    void encodingChanged(QAction *encodingAction);
140
 
        void numberOfLinesChanged();
141
 
    void updateRecentlyOpenedList();
142
 
    void openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction);
143
 
    void clearRecentlyOpenedList();
144
 
        void showAboutDialog();
145
 
    void setStatusBarCursorPosInfo(int line, int column);
146
 
};
147
 
 
148
 
#endif // MAINWINDOW_H