|
|
@ -24,7 +24,7 @@
|
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class KCompletion : TQObject
|
|
|
|
class TDECompletion : TQObject
|
|
|
|
{
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <kcompletion.h>
|
|
|
|
#include <kcompletion.h>
|
|
|
@ -40,7 +40,7 @@ public:
|
|
|
|
Weighted
|
|
|
|
Weighted
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
KCompletion ();
|
|
|
|
TDECompletion ();
|
|
|
|
virtual TQString makeCompletion (const TQString&);
|
|
|
|
virtual TQString makeCompletion (const TQString&);
|
|
|
|
TQStringList substringCompletion (const TQString&) const;
|
|
|
|
TQStringList substringCompletion (const TQString&) const;
|
|
|
|
TQString previousMatch ();
|
|
|
|
TQString previousMatch ();
|
|
|
@ -54,14 +54,14 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
virtual void setCompletionMode (TDEGlobalSettings::Completion);
|
|
|
|
virtual void setCompletionMode (TDEGlobalSettings::Completion);
|
|
|
|
TDEGlobalSettings::Completion completionMode () const;
|
|
|
|
TDEGlobalSettings::Completion completionMode () const;
|
|
|
|
virtual void setOrder (KCompletion::CompOrder);
|
|
|
|
virtual void setOrder (TDECompletion::CompOrder);
|
|
|
|
CompOrder order () const;
|
|
|
|
CompOrder order () const;
|
|
|
|
virtual void setIgnoreCase (bool);
|
|
|
|
virtual void setIgnoreCase (bool);
|
|
|
|
bool ignoreCase () const;
|
|
|
|
bool ignoreCase () const;
|
|
|
|
TQStringList allMatches ();
|
|
|
|
TQStringList allMatches ();
|
|
|
|
TQStringList allMatches (const TQString&);
|
|
|
|
TQStringList allMatches (const TQString&);
|
|
|
|
//ig KCompletionMatches allWeightedMatches ();
|
|
|
|
//ig TDECompletionMatches allWeightedMatches ();
|
|
|
|
//ig KCompletionMatches allWeightedMatches (const TQString&);
|
|
|
|
//ig TDECompletionMatches allWeightedMatches (const TQString&);
|
|
|
|
virtual void setEnableSounds (bool);
|
|
|
|
virtual void setEnableSounds (bool);
|
|
|
|
bool isSoundsEnabled () const;
|
|
|
|
bool isSoundsEnabled () const;
|
|
|
|
bool hasMultipleMatches () const;
|
|
|
|
bool hasMultipleMatches () const;
|
|
|
@ -87,18 +87,18 @@ signals:
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
virtual void postProcessMatch (TQString*);
|
|
|
|
virtual void postProcessMatch (TQString*);
|
|
|
|
virtual void postProcessMatches (TQStringList*);
|
|
|
|
virtual void postProcessMatches (TQStringList*);
|
|
|
|
//ig virtual void postProcessMatches (KCompletionMatches*) const;
|
|
|
|
//ig virtual void postProcessMatches (TDECompletionMatches*) const;
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
//igx virtual void virtual_hook (int, void*);
|
|
|
|
//igx virtual void virtual_hook (int, void*);
|
|
|
|
|
|
|
|
|
|
|
|
}; // class KCompletion
|
|
|
|
}; // class TDECompletion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//ig class KCompletionMatches : KCompletionMatchesList;
|
|
|
|
//ig class TDECompletionMatches : TDECompletionMatchesList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class KCompletionBase
|
|
|
|
class TDECompletionBase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <kcompletion.h>
|
|
|
|
#include <kcompletion.h>
|
|
|
@ -115,10 +115,10 @@ public:
|
|
|
|
SubstringCompletion
|
|
|
|
SubstringCompletion
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef TQMap<KCompletionBase::KeyBindingType,TDEShortcut> KeyBindingMap;
|
|
|
|
typedef TQMap<TDECompletionBase::KeyBindingType,TDEShortcut> KeyBindingMap;
|
|
|
|
KCompletionBase ();
|
|
|
|
TDECompletionBase ();
|
|
|
|
KCompletion* completionObject (bool = 1);
|
|
|
|
TDECompletion* completionObject (bool = 1);
|
|
|
|
virtual void setCompletionObject (KCompletion*, bool = 1);
|
|
|
|
virtual void setCompletionObject (TDECompletion*, bool = 1);
|
|
|
|
virtual void setHandleSignals (bool);
|
|
|
|
virtual void setHandleSignals (bool);
|
|
|
|
bool isCompletionObjectAutoDeleted () const;
|
|
|
|
bool isCompletionObjectAutoDeleted () const;
|
|
|
|
void setAutoDeleteCompletionObject (bool);
|
|
|
|
void setAutoDeleteCompletionObject (bool);
|
|
|
@ -127,27 +127,27 @@ public:
|
|
|
|
bool emitSignals () const;
|
|
|
|
bool emitSignals () const;
|
|
|
|
virtual void setCompletionMode (TDEGlobalSettings::Completion);
|
|
|
|
virtual void setCompletionMode (TDEGlobalSettings::Completion);
|
|
|
|
TDEGlobalSettings::Completion completionMode () const;
|
|
|
|
TDEGlobalSettings::Completion completionMode () const;
|
|
|
|
bool setKeyBinding (KCompletionBase::KeyBindingType, const TDEShortcut&);
|
|
|
|
bool setKeyBinding (TDECompletionBase::KeyBindingType, const TDEShortcut&);
|
|
|
|
const TDEShortcut& getKeyBinding (KCompletionBase::KeyBindingType) const;
|
|
|
|
const TDEShortcut& getKeyBinding (TDECompletionBase::KeyBindingType) const;
|
|
|
|
void useGlobalKeyBindings ();
|
|
|
|
void useGlobalKeyBindings ();
|
|
|
|
virtual void setCompletedText (const TQString&) = 0;
|
|
|
|
virtual void setCompletedText (const TQString&) = 0;
|
|
|
|
virtual void setCompletedItems (const TQStringList&) = 0;
|
|
|
|
virtual void setCompletedItems (const TQStringList&) = 0;
|
|
|
|
KCompletion* compObj () const;
|
|
|
|
TDECompletion* compObj () const;
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
KCompletionBase::KeyBindingMap getKeyBindings () const;
|
|
|
|
TDECompletionBase::KeyBindingMap getKeyBindings () const;
|
|
|
|
void setDelegate (KCompletionBase*);
|
|
|
|
void setDelegate (TDECompletionBase*);
|
|
|
|
KCompletionBase* delegate () const;
|
|
|
|
TDECompletionBase* delegate () const;
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
//igx virtual void virtual_hook (int, void*);
|
|
|
|
//igx virtual void virtual_hook (int, void*);
|
|
|
|
|
|
|
|
|
|
|
|
}; // class KCompletionBase
|
|
|
|
}; // class TDECompletionBase
|
|
|
|
|
|
|
|
|
|
|
|
//ig typedef KSortableValueList<TQString> KCompletionMatchesList;
|
|
|
|
//ig typedef KSortableValueList<TQString> TDECompletionMatchesList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%MappedType KCompletionBase::KeyBindingMap
|
|
|
|
%MappedType TDECompletionBase::KeyBindingMap
|
|
|
|
//converts a Python dict of int:TDEShortcut
|
|
|
|
//converts a Python dict of int:TDEShortcut
|
|
|
|
{
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
%TypeHeaderCode
|
|
|
@ -167,8 +167,8 @@ protected:
|
|
|
|
|
|
|
|
|
|
|
|
// Get it.
|
|
|
|
// Get it.
|
|
|
|
|
|
|
|
|
|
|
|
const TQMap<KCompletionBase::KeyBindingType,TDEShortcut> map = *sipCpp;
|
|
|
|
const TQMap<TDECompletionBase::KeyBindingType,TDEShortcut> map = *sipCpp;
|
|
|
|
TQMap<KCompletionBase::KeyBindingType,TDEShortcut>::ConstIterator it;
|
|
|
|
TQMap<TDECompletionBase::KeyBindingType,TDEShortcut>::ConstIterator it;
|
|
|
|
|
|
|
|
|
|
|
|
PyObject *key;
|
|
|
|
PyObject *key;
|
|
|
|
PyObject *value;
|
|
|
|
PyObject *value;
|
|
|
@ -197,7 +197,7 @@ protected:
|
|
|
|
if (sipIsErr == NULL)
|
|
|
|
if (sipIsErr == NULL)
|
|
|
|
return PyDict_Check(sipPy);
|
|
|
|
return PyDict_Check(sipPy);
|
|
|
|
|
|
|
|
|
|
|
|
TQMap<KCompletionBase::KeyBindingType,TDEShortcut> *kbmap = new TQMap<KCompletionBase::KeyBindingType,TDEShortcut>;
|
|
|
|
TQMap<TDECompletionBase::KeyBindingType,TDEShortcut> *kbmap = new TQMap<TDECompletionBase::KeyBindingType,TDEShortcut>;
|
|
|
|
|
|
|
|
|
|
|
|
PyObject *key, *value;
|
|
|
|
PyObject *key, *value;
|
|
|
|
SIP_SSIZE_T pos = 0;
|
|
|
|
SIP_SSIZE_T pos = 0;
|
|
|
@ -215,7 +215,7 @@ protected:
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
kbmap->insert ((KCompletionBase::KeyBindingType)PyInt_AS_LONG (key), *cValue);
|
|
|
|
kbmap->insert ((TDECompletionBase::KeyBindingType)PyInt_AS_LONG (key), *cValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
*sipCppPtr = kbmap;
|
|
|
|
*sipCppPtr = kbmap;
|
|
|
|