~ubuntu-branches/ubuntu/raring/juffed/raring

« back to all changes in this revision

Viewing changes to src/app/qsci/JuffScintilla.h

  • Committer: Bazaar Package Importer
  • Author(s): Maia Kozheva
  • Date: 2011-04-30 13:43:26 UTC
  • mfrom: (2.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110430134326-0bnvvo5z2medbdxi
Tags: 0.9.1137-1
* New upstream release.
* Remove debian/juffed.1, added upstream (in debian.in).
* Remove debian/patches/static.patch: we can now bundle the .so after
  upstream has resolved soname issues.
* debian/control:
  - Bump Standards-Version to 0.9.2.
  - Update homepage.
  - Do not build-depend on chrpath, not needed anymore.
* debian/rules:
  - Remove chrpath rule, not needed anymore.
* Add juffed-dev and juffed-plugins packages.
* Do not install the libkeybindings.so plugin: causes a segfault on my
  amd64 machine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
JuffEd - An advanced text editor
 
3
Copyright 2007-2010 Mikhail Murzin
 
4
 
 
5
This program is free software; you can redistribute it and/or
 
6
modify it under the terms of the GNU General Public License 
 
7
version 2 as 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; if not, write to the Free Software
 
16
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
17
*/
 
18
 
 
19
#ifndef _JUFF_SCINTILLA_H_
 
20
#define _JUFF_SCINTILLA_H_
 
21
 
 
22
#include "Types.h"
 
23
 
 
24
#include <Qsci/qsciscintilla.h>
 
25
 
 
26
#include <QtGui/QDragEnterEvent>
 
27
#include <QtGui/QDropEvent>
 
28
#include <QtGui/QMenu>
 
29
 
 
30
class JuffScintilla : public QsciScintilla {
 
31
Q_OBJECT
 
32
public:
 
33
        enum HLMode {
 
34
                HLCurrentWord,
 
35
                HLSearch
 
36
        };
 
37
        JuffScintilla();
 
38
        virtual ~JuffScintilla();
 
39
        
 
40
        virtual void cut();
 
41
        virtual void paste();
 
42
        
 
43
        void showLineNumbers(bool);
 
44
        bool lineNumbersVisible() const;
 
45
 
 
46
        QString wordUnderCursor();
 
47
        
 
48
        // TODO : refactor this method
 
49
        void highlightText(HLMode, const Juff::SearchParams&);
 
50
        void highlight(HLMode, int, int, int, int);
 
51
 
 
52
signals:
 
53
        void contextMenuCalled(int, int);
 
54
        void focusReceived();
 
55
        void markersMenuRequested(const QPoint&);
 
56
        void escapePressed();
 
57
 
 
58
protected slots:
 
59
        void updateLineNumbers();
 
60
 
 
61
protected:
 
62
        virtual void dragEnterEvent(QDragEnterEvent* e);
 
63
        virtual void dropEvent(QDropEvent* e);
 
64
        virtual void contextMenuEvent(QContextMenuEvent* e);
 
65
        virtual void focusInEvent(QFocusEvent* e);
 
66
        virtual void focusOutEvent(QFocusEvent* e);
 
67
        virtual void keyPressEvent(QKeyEvent*);
 
68
        virtual void wheelEvent(QWheelEvent*);
 
69
 
 
70
private:
 
71
        void cancelRectInput();
 
72
        void getOrderedSelection(int&, int&, int&, int&);
 
73
        void deleteRectSelection();
 
74
        void deleteRectSelection(int, int, int, int);
 
75
        long curPos() const;
 
76
        void highlight(int start, int end, int ind);
 
77
        void clearHighlighting();
 
78
        void initHighlightingStyle(int id, const QColor &color);
 
79
//      bool findML(const QString& s, const DocFindFlags& flags);
 
80
 
 
81
        QMenu* contextMenu_;
 
82
        bool showLineNumbers_;
 
83
};
 
84
 
 
85
#endif