//
//     Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
//     Earlier copyrights 1998 - 2006 Jim Bublitz also apply


//                 Generated by preSip


// This file is part of PyKDE4.

// PyKDE4 is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.

// PyKDE4 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

%ModuleHeaderCode
//ctscc
#include <ktexteditor/codecompletionmodel.h>
#include <ktexteditor/configpage.h>
#include <ktexteditor/document.h>
#include <ktexteditor/editor.h>
#include <ktexteditor/editorchooser.h>
#include <ktexteditor/plugin.h>
#include <ktexteditor/cursorfeedback.h>
#include <ktexteditor/rangefeedback.h>
#include <ktexteditor/view.h>
%End

namespace KTextEditor
{

class CodeCompletionModel : QAbstractItemModel
{
%TypeHeaderCode
#include <ktexteditor/codecompletionmodel.h>
%End


public:
                         CodeCompletionModel (QObject*);

    enum Columns
    {
        Prefix, 
        Icon, 
        Scope, 
        Name, 
        Arguments, 
        Postfix
    };

    static const int     ColumnCount;

    enum CompletionProperty
    {
        NoProperty, 
        FirstProperty, 
        Public, 
        Protected, 
        Private, 
        Static, 
        Const, 
        Namespace, 
        Class, 
        Struct, 
        Union, 
        Function, 
        Variable, 
        Enum, 
        Template, 
        TypeAlias, 
        Virtual, 
        Override, 
        Inline, 
        Friend, 
        Signal, 
        Slot, 
        LocalScope, 
        NamespaceScope, 
        GlobalScope, 
        LastProperty
    };

    typedef QFlags<KTextEditor::CodeCompletionModel::CompletionProperty> CompletionProperties;

    enum HighlightMethod
    {
        NoHighlighting, 
        InternalHighlighting, 
        CustomHighlighting
    };

    typedef QFlags<KTextEditor::CodeCompletionModel::HighlightMethod> HighlightMethods;

    enum ExtraItemDataRoles
    {
        CompletionRole, 
        ScopeIndex, 
        MatchQuality, 
        SetMatchContext, 
        HighlightingMethod, 
        CustomHighlight, 
        InheritanceDepth, 
        IsExpandable, 
        ExpandingWidget, 
        ItemSelected, 
        ArgumentHintDepth, 
        BestMatchesCount, 
        AccessibilityNext, 
        AccessibilityPrevious, 
        AccessibilityAccept
    };

    static const int     LastItemDataRole;
    void                 setRowCount (int);

    enum InvocationType
    {
        AutomaticInvocation, 
        UserInvocation, 
        ManualInvocation
    };

    virtual void         completionInvoked (KTextEditor::View*, const KTextEditor::Range&, KTextEditor::CodeCompletionModel::InvocationType);
    virtual void         executeCompletionItem (KTextEditor::Document*, const KTextEditor::Range&, int) const;
    virtual int          columnCount (const QModelIndex& = QModelIndex ()) const;
    virtual QModelIndex  index (int, int, const QModelIndex& = QModelIndex ()) const;
    virtual QMap<int, QVariant> itemData (const QModelIndex&) const;
    virtual QModelIndex  parent (const QModelIndex&) const;
    virtual int          rowCount (const QModelIndex& = QModelIndex ()) const;

// Subclasses for QObject

public:
%ConvertToSubClassCode

    if (dynamic_cast<KTextEditor::CodeCompletionModel*>(sipCpp))
        sipClass = sipClass_KTextEditor_CodeCompletionModel;
    else if (dynamic_cast<KTextEditor::ConfigPage*>(sipCpp))
        sipClass = sipClass_KTextEditor_ConfigPage;
    else if (dynamic_cast<KTextEditor::Document*>(sipCpp))
        sipClass = sipClass_KTextEditor_Document;
    else if (dynamic_cast<KTextEditor::Editor*>(sipCpp))
        sipClass = sipClass_KTextEditor_Editor;
    else if (dynamic_cast<KTextEditor::EditorChooser*>(sipCpp))
        sipClass = sipClass_KTextEditor_EditorChooser;
    else if (dynamic_cast<KTextEditor::Plugin*>(sipCpp))
        sipClass = sipClass_KTextEditor_Plugin;
    else if (dynamic_cast<KTextEditor::SmartCursorNotifier*>(sipCpp))
        sipClass = sipClass_KTextEditor_SmartCursorNotifier;
    else if (dynamic_cast<KTextEditor::SmartRangeNotifier*>(sipCpp))
        sipClass = sipClass_KTextEditor_SmartRangeNotifier;
    else if (dynamic_cast<KTextEditor::View*>(sipCpp))
        sipClass = sipClass_KTextEditor_View;
    else if (dynamic_cast<KTextEditor::View*>(sipCpp))
        sipClass = sipClass_KTextEditor_View;
    else
        sipClass = NULL;
%End


};  // class CodeCompletionModel

};  // namespace KTextEditor

