// qkeysequence.sip generated by MetaSIP on Fri Sep 28 17:07:47 2007 // // This file is part of the QtGui Python extension module. // // Copyright (c) 2007 // Phil Thompson // // This file is part of PyQt. // // This copy of PyQt is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License version 2 as published by // the Free Software Foundation and appearing in the file LICENSE included in the // packaging of this file. // // PyQt is supplied 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 // PyQt; see the file LICENSE. If not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. %ModuleCode #include %End class QKeySequence { %TypeHeaderCode #include %End %ConvertToTypeCode // Allow a StandardKey, QString or an integer whenever a QKeySequence is // expected. if (sipIsErr == NULL) { if (sipCanConvertToInstance(sipPy, sipClass_QKeySequence, SIP_NO_CONVERTORS)) return 1; #if QT_VERSION >= 0x040200 if (PyObject_TypeCheck(sipPy, sipEnum_QKeySequence_StandardKey)) return 1; #endif if (sipCanConvertToInstance(sipPy, sipClass_QString, 0)) return 1; PyErr_Clear(); PyInt_AsLong(sipPy); return !PyErr_Occurred(); } if (sipCanConvertToInstance(sipPy, sipClass_QKeySequence, SIP_NO_CONVERTORS)) { *sipCppPtr = reinterpret_cast(sipConvertToInstance(sipPy, sipClass_QKeySequence, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr)); return 0; } #if QT_VERSION >= 0x040200 if (PyObject_TypeCheck(sipPy, sipEnum_QKeySequence_StandardKey)) { *sipCppPtr = new QKeySequence((QKeySequence::StandardKey)PyInt_AsLong(sipPy)); return sipGetState(sipTransferObj); } #endif if (sipCanConvertToInstance(sipPy, sipClass_QString, 0)) { int state; QString *qs = reinterpret_cast(sipConvertToInstance(sipPy, sipClass_QString, 0, 0, &state, sipIsErr)); if (*sipIsErr) { sipReleaseInstance(qs, sipClass_QString, state); return 0; } *sipCppPtr = new QKeySequence(*qs); sipReleaseInstance(qs, sipClass_QString, state); return sipGetState(sipTransferObj); } int key = PyInt_AsLong(sipPy); *sipCppPtr = new QKeySequence(key); return sipGetState(sipTransferObj); %End %PickleCode sipRes = Py_BuildValue((char *)"iiii", sipCpp->operator[](0), sipCpp->operator[](1), sipCpp->operator[](2), sipCpp->operator[](3)); %End public: enum SequenceFormat { NativeText, PortableText, }; enum SequenceMatch { NoMatch, PartialMatch, ExactMatch, }; %If (Qt_4_2_0 -) enum StandardKey { UnknownKey, HelpContents, WhatsThis, Open, Close, Save, New, Delete, Cut, Copy, Paste, Undo, Redo, Back, Forward, Refresh, ZoomIn, ZoomOut, Print, AddTab, NextChild, PreviousChild, Find, FindNext, FindPrevious, Replace, SelectAll, Bold, Italic, Underline, MoveToNextChar, MoveToPreviousChar, MoveToNextWord, MoveToPreviousWord, MoveToNextLine, MoveToPreviousLine, MoveToNextPage, MoveToPreviousPage, MoveToStartOfLine, MoveToEndOfLine, MoveToStartOfBlock, MoveToEndOfBlock, MoveToStartOfDocument, MoveToEndOfDocument, SelectNextChar, SelectPreviousChar, SelectNextWord, SelectPreviousWord, SelectNextLine, SelectPreviousLine, SelectNextPage, SelectPreviousPage, SelectStartOfLine, SelectEndOfLine, SelectStartOfBlock, SelectEndOfBlock, SelectStartOfDocument, SelectEndOfDocument, DeleteStartOfWord, DeleteEndOfWord, DeleteEndOfLine, }; %End QKeySequence(); QKeySequence(const QKeySequence &ks); QKeySequence(int k1, int k2 = 0, int k3 = 0, int k4 = 0); QKeySequence(const QVariant &variant) /NoDerived/; %MethodCode sipCpp = new QKeySequence(qVariantValue(*a0)); %End ~QKeySequence(); uint count() const; bool isEmpty() const; QKeySequence::SequenceMatch matches(const QKeySequence &seq) const; static QKeySequence mnemonic(const QString &text); operator QString() const; operator QVariant() const; operator int() const; int operator[](uint i) const; bool operator==(const QKeySequence &other) const; bool operator!=(const QKeySequence &other) const; bool operator<(const QKeySequence &ks) const; bool operator>(const QKeySequence &other) const; bool operator<=(const QKeySequence &other) const; bool operator>=(const QKeySequence &other) const; bool isDetached() const; QString toString(QKeySequence::SequenceFormat format = QKeySequence::PortableText) const; static QKeySequence fromString(const QString &str, QKeySequence::SequenceFormat format = QKeySequence::PortableText); %If (Qt_4_2_0 -) static QList keyBindings(QKeySequence::StandardKey key); %End }; QDataStream &operator<<(QDataStream &in, const QKeySequence &ks /Constrained/); QDataStream &operator>>(QDataStream &out, QKeySequence &ks /Constrained/); %If (Qt_4_3_0 -) void qSwap(QKeySequence &value1, QKeySequence &value2); %End