~ubuntu-branches/ubuntu/wily/tora/wily-proposed

« back to all changes in this revision

Viewing changes to src/qscintilla2/Qt4/Qsci/qsciabstractapis.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Meskes
  • Date: 2009-11-19 15:18:19 UTC
  • mfrom: (1.2.9 upstream) (3.3.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091119151819-me89ezmxzkvl0lws
Tags: 2.1.1-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// This module defines interface to the QsciAbstractAPIs class.
 
2
//
 
3
// Copyright (c) 2008 Riverbank Computing Limited <info@riverbankcomputing.com>
 
4
// 
 
5
// This file is part of QScintilla.
 
6
// 
 
7
// This file may be used under the terms of the GNU General Public
 
8
// License versions 2.0 or 3.0 as published by the Free Software
 
9
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
 
10
// included in the packaging of this file.  Alternatively you may (at
 
11
// your option) use any later version of the GNU General Public
 
12
// License if such license has been publicly approved by Riverbank
 
13
// Computing Limited (or its successors, if any) and the KDE Free Qt
 
14
// Foundation. In addition, as a special exception, Riverbank gives you
 
15
// certain additional rights. These rights are described in the Riverbank
 
16
// GPL Exception version 1.1, which can be found in the file
 
17
// GPL_EXCEPTION.txt in this package.
 
18
// 
 
19
// Please review the following information to ensure GNU General
 
20
// Public Licensing requirements will be met:
 
21
// http://trolltech.com/products/qt/licenses/licensing/opensource/. If
 
22
// you are unsure which license is appropriate for your use, please
 
23
// review the following information:
 
24
// http://trolltech.com/products/qt/licenses/licensing/licensingoverview
 
25
// or contact the sales department at sales@riverbankcomputing.com.
 
26
// 
 
27
// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
 
28
// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
 
29
// A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
 
30
// granted herein.
 
31
// 
 
32
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
33
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
34
 
 
35
 
 
36
#ifndef QSCIABSTRACTAPIS_H
 
37
#define QSCIABSTRACTAPIS_H
 
38
 
 
39
#ifdef __APPLE__
 
40
extern "C++" {
 
41
#endif
 
42
 
 
43
#include <qobject.h>
 
44
#include <qstringlist.h>
 
45
 
 
46
#include <QList>
 
47
 
 
48
#include <Qsci/qsciglobal.h>
 
49
#include <Qsci/qsciscintilla.h>
 
50
 
 
51
 
 
52
class QsciLexer;
 
53
 
 
54
 
 
55
//! \brief The QsciAbstractAPIs class represents the interface to the textual
 
56
//! API information used in call tips and for auto-completion.  A sub-class
 
57
//! will provide the actual implementation of the interface.
 
58
//!
 
59
//! API information is specific to a particular language lexer but can be
 
60
//! shared by multiple instances of the lexer.
 
61
class QSCINTILLA_EXPORT QsciAbstractAPIs : public QObject
 
62
{
 
63
    Q_OBJECT
 
64
 
 
65
public:
 
66
    //! Constructs a QsciAbstractAPIs instance attached to lexer \a lexer.  \a
 
67
    //! lexer becomes the instance's parent object although the instance can
 
68
    //! also be subsequently attached to other lexers.
 
69
    QsciAbstractAPIs(QsciLexer *lexer);
 
70
 
 
71
    //! Destroy the QsciAbstractAPIs instance.
 
72
    virtual ~QsciAbstractAPIs();
 
73
 
 
74
    //! Return the lexer that the instance is attached to.
 
75
    QsciLexer *lexer() const;
 
76
 
 
77
    //! Update the list \a list with API entries derived from \a context.  \a
 
78
    //! context is the list of words in the text preceding the cursor position.
 
79
    //! The characters that make up a word and the characters that separate
 
80
    //! words are defined by the lexer.  The last word is a partial word and
 
81
    //! may be empty if the user has just entered a word separator.
 
82
    virtual void updateAutoCompletionList(const QStringList &context,
 
83
            QStringList &list) = 0;
 
84
 
 
85
    //! This is called when the user selects the entry \a selection from the
 
86
    //! auto-completion list.  A sub-class can use this as a hint to provide
 
87
    //! more specific API entries in future calls to
 
88
    //! updateAutoCompletionList().  The default implementation does nothing.
 
89
    virtual void autoCompletionSelected(const QString &selection);
 
90
 
 
91
    //! Return the call tips valid for the context \a context.  (Note that the
 
92
    //! last word of the context will always be empty.)  \a commas is the number
 
93
    //! of commas the user has typed after the context and before the cursor
 
94
    //! position.  The exact position of the list of call tips can be adjusted
 
95
    //! by specifying a corresponding left character shift in \a shifts.  This
 
96
    //! is normally done to correct for any displayed context according to \a
 
97
    //! style.
 
98
    //!
 
99
    //! \sa updateAutoCompletionList()
 
100
    virtual QStringList callTips(const QStringList &context, int commas,
 
101
            QsciScintilla::CallTipsStyle style,
 
102
            QList<int> &shifts) = 0;
 
103
 
 
104
private:
 
105
    QsciLexer *lex;
 
106
 
 
107
    QsciAbstractAPIs(const QsciAbstractAPIs &);
 
108
    QsciAbstractAPIs &operator=(const QsciAbstractAPIs &);
 
109
};
 
110
 
 
111
#ifdef __APPLE__
 
112
}
 
113
#endif
 
114
 
 
115
#endif