OSDN Git Service

Documentation: More on code assist
[qt-creator-jp/qt-creator-jp.git] / src / plugins / texteditor / codeassist / iassistproposal.cpp
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 **
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 **
23 ** Other Usage
24 **
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at info@qt.nokia.com.
30 **
31 **************************************************************************/
32
33 #include "iassistproposal.h"
34
35 using namespace TextEditor;
36
37 /*!
38     \group CodeAssist
39     \title Code Assist for Editors
40
41     Code assist is available in the form of completions and refactoring actions pop-ups
42     which are triggered under particular circumstances. This group contains the classes
43     used to provide such support.
44
45     Completions can be of a variety of kind like function hints, snippets, and regular
46     context-aware content. The later are usually represented by semantic proposals, but
47     it is also possible that they are simply plain text like in the fake vim mode.
48
49     Completions also have the possibility to run asynchronously in a separate thread and
50     then not blocking the GUI. This is the default behavior.
51 */
52
53 /*!
54     \class TextEditor::IAssistProposal
55     \brief The IAssistProposal class acts as an interface for representing an assist proposal.
56     \ingroup CodeAssist
57
58     Known implenters of this interface are FunctionHintProposal and GenericProposal. The
59     former is recommended to be used when assisting function call constructs (overloads
60     and parameters) while the latter is quite generic so that it could be used to propose
61     snippets, refactoring operations (quickfixes), and contextual content (the member of
62     class or a string existent in the document, for example).
63
64     This class is part of the CodeAssist API.
65
66     \sa IAssistProposalWidget, IAssistModel
67 */
68
69 IAssistProposal::IAssistProposal()
70 {}
71
72 IAssistProposal::~IAssistProposal()
73 {}
74
75 /*!
76     \fn bool TextEditor::IAssistProposal::isFragile() const
77
78     Returns whether this is a fragile proposal. When a proposal is fragile it means that
79     it will be replaced by a new proposal in the case one is created, even if due to an
80     idle editor.
81 */
82
83 /*!
84     \fn int TextEditor::IAssistProposal::basePosition() const
85
86     Returns the position from which this proposal starts.
87 */
88
89 /*!
90     \fn bool TextEditor::IAssistProposal::isCorrective() const
91
92     Returns whether this proposal is also corrective. This could happen in C++, for example,
93     when a dot operator (.) needs to be replaced by an arrow operator (->) before the proposal
94     is displayed.
95 */
96
97 /*!
98     \fn void TextEditor::IAssistProposal::makeCorrection(BaseTextEditor *editor)
99
100     This allows a correction to be made in the case this is a corrective proposal.
101 */
102
103 /*!
104     \fn IAssistModel *TextEditor::IAssistProposal::model() const
105
106     Returns the model associated with this proposal.
107
108     Although the IAssistModel from this proposal may be used on its own, it needs to be
109     consistent with the widget returned by createWidget().
110
111     \sa createWidget()
112 */
113
114 /*!
115     \fn IAssistProposalWidget *TextEditor::IAssistProposal::createWidget() const
116
117     Returns the widget associated with this proposal. The IAssistProposalWidget implementor
118     recommended for function hint proposals is FunctionHintProposalWidget. For snippets,
119     refactoring operations (quickfixes), and contextual content the recommeded implementor
120     is GenericProposalWidget.
121 */