~ubuntu-branches/ubuntu/trusty/presage/trusty-proposed

« back to all changes in this revision

Viewing changes to apps/gtk/gprompter/scintilla/src/ScintillaBase.h

  • Committer: Bazaar Package Importer
  • Author(s): Matteo Vescovi
  • Date: 2011-08-06 09:26:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110806092615-0wvhajaht9974ncx
Tags: upstream-0.8.6
ImportĀ upstreamĀ versionĀ 0.8.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Scintilla source code edit control
 
2
/** @file ScintillaBase.h
 
3
 ** Defines an enhanced subclass of Editor with calltips, autocomplete and context menu.
 
4
 **/
 
5
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
 
6
// The License.txt file describes the conditions under which this software may be distributed.
 
7
 
 
8
#ifndef SCINTILLABASE_H
 
9
#define SCINTILLABASE_H
 
10
 
 
11
#ifdef SCI_NAMESPACE
 
12
namespace Scintilla {
 
13
#endif
 
14
 
 
15
#ifdef SCI_LEXER
 
16
class LexState;
 
17
#endif
 
18
 
 
19
/**
 
20
 */
 
21
class ScintillaBase : public Editor {
 
22
        // Private so ScintillaBase objects can not be copied
 
23
        ScintillaBase(const ScintillaBase &);
 
24
        ScintillaBase &operator=(const ScintillaBase &);
 
25
 
 
26
protected:
 
27
        /** Enumeration of commands and child windows. */
 
28
        enum {
 
29
                idCallTip=1,
 
30
                idAutoComplete=2,
 
31
 
 
32
                idcmdUndo=10,
 
33
                idcmdRedo=11,
 
34
                idcmdCut=12,
 
35
                idcmdCopy=13,
 
36
                idcmdPaste=14,
 
37
                idcmdDelete=15,
 
38
                idcmdSelectAll=16
 
39
        };
 
40
 
 
41
        bool displayPopupMenu;
 
42
        Menu popup;
 
43
        AutoComplete ac;
 
44
 
 
45
        CallTip ct;
 
46
 
 
47
        int listType;                   ///< 0 is an autocomplete list
 
48
        int maxListWidth;               /// Maximum width of list, in average character widths
 
49
 
 
50
#ifdef SCI_LEXER
 
51
        LexState *DocumentLexState();
 
52
        void SetLexer(uptr_t wParam);
 
53
        void SetLexerLanguage(const char *languageName);
 
54
        void Colourise(int start, int end);
 
55
#endif
 
56
 
 
57
        ScintillaBase();
 
58
        virtual ~ScintillaBase();
 
59
        virtual void Initialise() = 0;
 
60
        virtual void Finalise() = 0;
 
61
 
 
62
        virtual void RefreshColourPalette(Palette &pal, bool want);
 
63
 
 
64
        virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false);
 
65
        void Command(int cmdId);
 
66
        virtual void CancelModes();
 
67
        virtual int KeyCommand(unsigned int iMessage);
 
68
 
 
69
        void AutoCompleteStart(int lenEntered, const char *list);
 
70
        void AutoCompleteCancel();
 
71
        void AutoCompleteMove(int delta);
 
72
        int AutoCompleteGetCurrent();
 
73
        int AutoCompleteGetCurrentText(char *buffer);
 
74
        void AutoCompleteCharacterAdded(char ch);
 
75
        void AutoCompleteCharacterDeleted();
 
76
        void AutoCompleteCompleted();
 
77
        void AutoCompleteMoveToCurrentWord();
 
78
        static void AutoCompleteDoubleClick(void *p);
 
79
 
 
80
        void CallTipClick();
 
81
        void CallTipShow(Point pt, const char *defn);
 
82
        virtual void CreateCallTipWindow(PRectangle rc) = 0;
 
83
 
 
84
        virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0;
 
85
        void ContextMenu(Point pt);
 
86
 
 
87
        virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
 
88
 
 
89
        void NotifyStyleToNeeded(int endStyleNeeded);
 
90
        void NotifyLexerChanged(Document *doc, void *userData);
 
91
 
 
92
public:
 
93
        // Public so scintilla_send_message can use it
 
94
        virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
 
95
};
 
96
 
 
97
#ifdef SCI_NAMESPACE
 
98
}
 
99
#endif
 
100
 
 
101
#endif