You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
458 lines
11 KiB
458 lines
11 KiB
13 years ago
|
// This is the SIP interface definition for QIconView, QIconViewItem, QIconDrag
|
||
|
// and QIconDragItem.
|
||
|
//
|
||
|
// Copyright (c) 2007
|
||
|
// Riverbank Computing Limited <info@riverbankcomputing.co.uk>
|
||
|
//
|
||
|
// 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 as published by the Free
|
||
|
// Software Foundation; either version 2, or (at your option) any later
|
||
|
// version.
|
||
|
//
|
||
|
// 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.
|
||
|
|
||
|
|
||
|
%ExportedDoc
|
||
|
<Sect2><Title>QIconView (Qt v2.1+)</Title>
|
||
|
<FuncSynopsis>
|
||
|
<FuncDef>QIconViewItem *<Function>makeRowLayout</Function></FuncDef>
|
||
|
<ParamDef>QIconViewItem *<Parameter>begin</Parameter></ParamDef>
|
||
|
<ParamDef>int &<Parameter>y</Parameter></ParamDef>
|
||
|
</FuncSynopsis>
|
||
|
<Para>
|
||
|
Not yet implemented.
|
||
|
</Para>
|
||
|
</Sect2>
|
||
|
|
||
|
<Sect2><Title>QIconViewItem (Qt v2.1+)</Title>
|
||
|
<Para>
|
||
|
<Literal>QIconViewItem</Literal> is fully implemented.
|
||
|
</Para>
|
||
|
</Sect2>
|
||
|
|
||
|
<Sect2><Title>QIconDrag (Qt v2.1+)</Title>
|
||
|
<Para>
|
||
|
<Literal>QIconDrag</Literal> is fully implemented.
|
||
|
</Para>
|
||
|
</Sect2>
|
||
|
|
||
|
<Sect2><Title>QIconDragItem (Qt v2.1+)</Title>
|
||
|
<Para>
|
||
|
<Literal>QIconDragItem</Literal> is fully implemented.
|
||
|
</Para>
|
||
|
</Sect2>
|
||
|
%End
|
||
|
|
||
|
|
||
|
%If (Qt_ICONVIEW)
|
||
|
%If (Qt_2_1_0 -)
|
||
|
|
||
|
%If (Qt_DRAGANDDROP)
|
||
|
|
||
|
class QIconDragItem
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <qiconview.h>
|
||
|
%End
|
||
|
|
||
|
public:
|
||
|
QIconDragItem();
|
||
|
|
||
|
virtual QByteArray data() const;
|
||
|
virtual void setData(const QByteArray &);
|
||
|
};
|
||
|
|
||
|
|
||
|
class QIconDrag : QDragObject
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <qiconview.h>
|
||
|
%End
|
||
|
|
||
|
public:
|
||
|
QIconDrag(QWidget * /TransferThis/,const char * = 0);
|
||
|
|
||
|
void append(const QIconDragItem &,const QRect &,const QRect &);
|
||
|
|
||
|
virtual const char* format(int) const;
|
||
|
static bool canDecode(QMimeSource *);
|
||
|
virtual QByteArray encodedData(const char *) const;
|
||
|
|
||
|
private:
|
||
|
%If (Qt_3_1_0 -)
|
||
|
QIconDrag(const QIconDrag &);
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
%End
|
||
|
|
||
|
|
||
|
class QIconViewItem : Qt
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <qiconview.h>
|
||
|
%End
|
||
|
|
||
|
public:
|
||
|
QIconViewItem(QIconView * /TransferThis/);
|
||
|
QIconViewItem(QIconView * /TransferThis/,QIconViewItem *);
|
||
|
QIconViewItem(QIconView * /TransferThis/,const QString &);
|
||
|
QIconViewItem(QIconView * /TransferThis/,QIconViewItem *,
|
||
|
const QString &);
|
||
|
QIconViewItem(QIconView * /TransferThis/,const QString &,
|
||
|
const QPixmap &);
|
||
|
QIconViewItem(QIconView * /TransferThis/,QIconViewItem *,
|
||
|
const QString &,const QPixmap &);
|
||
|
%If (Qt_3_0_0 -)
|
||
|
QIconViewItem(QIconView * /TransferThis/,const QString &,
|
||
|
const QPicture &);
|
||
|
QIconViewItem(QIconView * /TransferThis/,QIconViewItem *,
|
||
|
const QString &,const QPicture &);
|
||
|
%End
|
||
|
|
||
|
virtual void setRenameEnabled(bool);
|
||
|
virtual void setDragEnabled(bool);
|
||
|
virtual void setDropEnabled(bool);
|
||
|
|
||
|
virtual QString text() const;
|
||
|
virtual QPixmap *pixmap() const;
|
||
|
%If (Qt_3_0_0 -)
|
||
|
virtual QPicture *picture() const;
|
||
|
%End
|
||
|
virtual QString key() const;
|
||
|
|
||
|
bool renameEnabled() const;
|
||
|
bool dragEnabled() const;
|
||
|
bool dropEnabled() const;
|
||
|
|
||
|
QIconView *iconView() const;
|
||
|
QIconViewItem *prevItem() const;
|
||
|
QIconViewItem *nextItem() const;
|
||
|
|
||
|
int index() const;
|
||
|
|
||
|
virtual void setSelected(bool,bool);
|
||
|
virtual void setSelected(bool);
|
||
|
virtual void setSelectable(bool);
|
||
|
|
||
|
bool isSelected() const;
|
||
|
bool isSelectable() const;
|
||
|
|
||
|
virtual void repaint();
|
||
|
|
||
|
%If (- Qt_3_0_0)
|
||
|
virtual void move(int,int);
|
||
|
%End
|
||
|
%If (Qt_3_0_0 -)
|
||
|
virtual bool move(int,int);
|
||
|
%End
|
||
|
virtual void moveBy(int,int);
|
||
|
%If (- Qt_3_0_0)
|
||
|
virtual void move(const QPoint &);
|
||
|
%End
|
||
|
%If (Qt_3_0_0 -)
|
||
|
virtual bool move(const QPoint &);
|
||
|
%End
|
||
|
virtual void moveBy(const QPoint &);
|
||
|
|
||
|
QRect rect() const;
|
||
|
int x() const;
|
||
|
int y() const;
|
||
|
int width() const;
|
||
|
int height() const;
|
||
|
QSize size() const;
|
||
|
QPoint pos() const;
|
||
|
QRect textRect(bool = 1) const;
|
||
|
QRect pixmapRect(bool = 1) const;
|
||
|
%If (- Qt_3_0_0)
|
||
|
bool contains(QPoint) const;
|
||
|
bool intersects(QRect) const;
|
||
|
%End
|
||
|
%If (Qt_3_0_0 -)
|
||
|
bool contains(const QPoint &) const;
|
||
|
bool intersects(const QRect &) const;
|
||
|
%End
|
||
|
|
||
|
virtual bool acceptDrop(const QMimeSource *) const;
|
||
|
|
||
|
void rename();
|
||
|
|
||
|
virtual int compare(QIconViewItem *) const;
|
||
|
|
||
|
virtual void setText(const QString &);
|
||
|
virtual void setPixmap(const QPixmap &);
|
||
|
%If (Qt_3_0_0 -)
|
||
|
virtual void setPicture(const QPicture &);
|
||
|
%End
|
||
|
virtual void setText(const QString &,bool,bool = 1);
|
||
|
virtual void setPixmap(const QPixmap &,bool,bool = 1);
|
||
|
virtual void setKey(const QString &);
|
||
|
|
||
|
%If (Qt_3_0_0 -)
|
||
|
virtual int rtti() const;
|
||
|
%End
|
||
|
|
||
|
protected:
|
||
|
virtual void removeRenameBox();
|
||
|
virtual void calcRect(const QString & = QString::null);
|
||
|
virtual void paintItem(QPainter *,const QColorGroup &);
|
||
|
virtual void paintFocus(QPainter *,const QColorGroup &);
|
||
|
%If (Qt_DRAGANDDROP)
|
||
|
virtual void dropped(QDropEvent *,const QValueList<QIconDragItem> &);
|
||
|
%End
|
||
|
virtual void dragEntered();
|
||
|
virtual void dragLeft();
|
||
|
void setItemRect(const QRect &);
|
||
|
void setTextRect(const QRect &);
|
||
|
void setPixmapRect(const QRect &);
|
||
|
void calcTmpText();
|
||
|
%If (Qt_3_1_0 -)
|
||
|
QString tempText() const;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|
||
|
class QIconView : QScrollView
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <qiconview.h>
|
||
|
%End
|
||
|
|
||
|
public:
|
||
|
enum SelectionMode {
|
||
|
Single,
|
||
|
Multi,
|
||
|
Extended,
|
||
|
NoSelection
|
||
|
};
|
||
|
|
||
|
enum Arrangement {
|
||
|
LeftToRight,
|
||
|
TopToBottom
|
||
|
};
|
||
|
|
||
|
enum ResizeMode {
|
||
|
Fixed,
|
||
|
Adjust
|
||
|
};
|
||
|
|
||
|
enum ItemTextPos {
|
||
|
Bottom,
|
||
|
Right
|
||
|
};
|
||
|
|
||
|
QIconView(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0);
|
||
|
|
||
|
virtual void insertItem(QIconViewItem *,QIconViewItem * = 0);
|
||
|
virtual void takeItem(QIconViewItem *);
|
||
|
|
||
|
int index(const QIconViewItem *) const;
|
||
|
|
||
|
QIconViewItem *firstItem() const;
|
||
|
QIconViewItem *lastItem() const;
|
||
|
QIconViewItem *currentItem() const;
|
||
|
virtual void setCurrentItem(QIconViewItem *);
|
||
|
virtual void setSelected(QIconViewItem *,bool,bool = 0);
|
||
|
|
||
|
uint count() const;
|
||
|
|
||
|
virtual void showEvent(QShowEvent *);
|
||
|
|
||
|
virtual void setSelectionMode(SelectionMode);
|
||
|
SelectionMode selectionMode() const;
|
||
|
|
||
|
QIconViewItem *findItem(const QPoint &) const;
|
||
|
%If (- Qt_3_0_0)
|
||
|
QIconViewItem *findItem(const QString &) const;
|
||
|
%End
|
||
|
%If (Qt_3_0_0 -)
|
||
|
QIconViewItem *findItem(const QString &,
|
||
|
ComparisonFlags = BeginsWith) const;
|
||
|
%End
|
||
|
virtual void selectAll(bool);
|
||
|
virtual void clearSelection();
|
||
|
virtual void invertSelection();
|
||
|
|
||
|
virtual void repaintItem(QIconViewItem *);
|
||
|
%If (Qt_3_1_0 -)
|
||
|
void repaintSelectedItems();
|
||
|
%End
|
||
|
|
||
|
void ensureItemVisible(QIconViewItem *);
|
||
|
QIconViewItem* findFirstVisibleItem(const QRect &) const;
|
||
|
QIconViewItem* findLastVisibleItem(const QRect &) const;
|
||
|
|
||
|
virtual void clear();
|
||
|
|
||
|
virtual void setGridX(int);
|
||
|
virtual void setGridY(int);
|
||
|
int gridX() const;
|
||
|
int gridY() const;
|
||
|
virtual void setSpacing(int);
|
||
|
int spacing() const;
|
||
|
virtual void setItemTextPos(ItemTextPos);
|
||
|
ItemTextPos itemTextPos() const;
|
||
|
virtual void setItemTextBackground(const QBrush &);
|
||
|
QBrush itemTextBackground() const;
|
||
|
virtual void setArrangement(Arrangement);
|
||
|
Arrangement arrangement() const;
|
||
|
virtual void setResizeMode(ResizeMode);
|
||
|
ResizeMode resizeMode() const;
|
||
|
virtual void setMaxItemWidth(int);
|
||
|
int maxItemWidth() const;
|
||
|
virtual void setMaxItemTextLength(int);
|
||
|
int maxItemTextLength() const;
|
||
|
virtual void setAutoArrange(bool);
|
||
|
bool autoArrange() const;
|
||
|
virtual void setShowToolTips(bool);
|
||
|
bool showToolTips() const;
|
||
|
|
||
|
void setSorting(bool,bool = 1);
|
||
|
bool sorting() const;
|
||
|
bool sortDirection() const;
|
||
|
|
||
|
virtual void setItemsMovable(bool);
|
||
|
bool itemsMovable() const;
|
||
|
virtual void setWordWrapIconText(bool);
|
||
|
bool wordWrapIconText() const;
|
||
|
|
||
|
bool eventFilter(QObject *,QEvent *);
|
||
|
|
||
|
QSize minimumSizeHint() const;
|
||
|
%If (- Qt_3_0_0)
|
||
|
QSizePolicy sizePolicy() const;
|
||
|
%End
|
||
|
QSize sizeHint() const;
|
||
|
|
||
|
virtual void sort(bool = 1);
|
||
|
|
||
|
virtual void setFont(const QFont &);
|
||
|
virtual void setPalette(const QPalette &);
|
||
|
|
||
|
%If (Qt_3_0_0 -)
|
||
|
bool isRenaming() const;
|
||
|
%End
|
||
|
|
||
|
public slots:
|
||
|
virtual void arrangeItemsInGrid(const QSize &,bool = 1);
|
||
|
virtual void arrangeItemsInGrid(bool = 1);
|
||
|
virtual void setContentsPos(int,int);
|
||
|
virtual void updateContents();
|
||
|
|
||
|
signals:
|
||
|
void selectionChanged();
|
||
|
void selectionChanged(QIconViewItem *);
|
||
|
void currentChanged(QIconViewItem *);
|
||
|
void clicked(QIconViewItem *);
|
||
|
void clicked(QIconViewItem *,const QPoint &);
|
||
|
void pressed(QIconViewItem *);
|
||
|
void pressed(QIconViewItem *,const QPoint &);
|
||
|
|
||
|
void doubleClicked(QIconViewItem *);
|
||
|
void returnPressed(QIconViewItem *);
|
||
|
void rightButtonClicked(QIconViewItem *,const QPoint &);
|
||
|
void rightButtonPressed(QIconViewItem *,const QPoint &);
|
||
|
void mouseButtonPressed(int,QIconViewItem *,const QPoint &);
|
||
|
void mouseButtonClicked(int,QIconViewItem *,const QPoint &);
|
||
|
%If (Qt_3_0_0 -)
|
||
|
void contextMenuRequested(QIconViewItem *,const QPoint &);
|
||
|
%End
|
||
|
%If (Qt_DRAGANDDROP)
|
||
|
void dropped(QDropEvent *,const QValueList<QIconDragItem> &);
|
||
|
%End
|
||
|
void moved();
|
||
|
void onItem(QIconViewItem *);
|
||
|
void onViewport();
|
||
|
void itemRenamed(QIconViewItem *,const QString &);
|
||
|
void itemRenamed(QIconViewItem *);
|
||
|
|
||
|
protected slots:
|
||
|
virtual void doAutoScroll();
|
||
|
virtual void adjustItems();
|
||
|
virtual void slotUpdate();
|
||
|
|
||
|
protected:
|
||
|
%If (- Qt_3_0_0)
|
||
|
virtual void drawContents(QPainter *,int,int,int,int);
|
||
|
virtual void contentsMousePressEvent(QMouseEvent *);
|
||
|
virtual void contentsMouseReleaseEvent(QMouseEvent *);
|
||
|
virtual void contentsMouseMoveEvent(QMouseEvent *);
|
||
|
virtual void contentsMouseDoubleClickEvent(QMouseEvent *);
|
||
|
%End
|
||
|
%If (Qt_3_0_0 -)
|
||
|
void drawContents(QPainter *,int,int,int,int);
|
||
|
void contentsMousePressEvent(QMouseEvent *);
|
||
|
void contentsMouseReleaseEvent(QMouseEvent *);
|
||
|
void contentsMouseMoveEvent(QMouseEvent *);
|
||
|
void contentsMouseDoubleClickEvent(QMouseEvent *);
|
||
|
void contentsContextMenuEvent(QContextMenuEvent *);
|
||
|
%End
|
||
|
|
||
|
%If (- Qt_3_0_0)
|
||
|
%If (Qt_DRAGANDDROP)
|
||
|
virtual void contentsDragEnterEvent(QDragEnterEvent *);
|
||
|
virtual void contentsDragMoveEvent(QDragMoveEvent *);
|
||
|
virtual void contentsDragLeaveEvent(QDragLeaveEvent *);
|
||
|
virtual void contentsDropEvent(QDropEvent *);
|
||
|
%End
|
||
|
|
||
|
virtual void resizeEvent(QResizeEvent *);
|
||
|
virtual void keyPressEvent(QKeyEvent *);
|
||
|
virtual void focusInEvent(QFocusEvent *);
|
||
|
virtual void focusOutEvent(QFocusEvent *);
|
||
|
virtual void enterEvent(QEvent *);
|
||
|
%End
|
||
|
%If (Qt_3_0_0 -)
|
||
|
%If (Qt_DRAGANDDROP)
|
||
|
void contentsDragEnterEvent(QDragEnterEvent *);
|
||
|
void contentsDragMoveEvent(QDragMoveEvent *);
|
||
|
void contentsDragLeaveEvent(QDragLeaveEvent *);
|
||
|
void contentsDropEvent(QDropEvent *);
|
||
|
%End
|
||
|
|
||
|
void resizeEvent(QResizeEvent *);
|
||
|
void keyPressEvent(QKeyEvent *);
|
||
|
void focusInEvent(QFocusEvent *);
|
||
|
void focusOutEvent(QFocusEvent *);
|
||
|
void enterEvent(QEvent *);
|
||
|
%End
|
||
|
|
||
|
virtual void drawRubber(QPainter *);
|
||
|
%If (Qt_DRAGANDDROP)
|
||
|
virtual QDragObject *dragObject();
|
||
|
virtual void startDrag();
|
||
|
%End
|
||
|
virtual void insertInGrid(QIconViewItem *);
|
||
|
virtual void drawBackground(QPainter *,const QRect &);
|
||
|
|
||
|
void emitSelectionChanged(QIconViewItem * = 0);
|
||
|
void emitRenamed(QIconViewItem *);
|
||
|
|
||
|
%If (- Qt_3_0_0)
|
||
|
// QIconViewItem *makeRowLayout(QIconViewItem *,int &);
|
||
|
%End
|
||
|
%If (Qt_3_0_0 -)
|
||
|
// QIconViewItem *makeRowLayout(QIconViewItem *,int &,bool &);
|
||
|
%End
|
||
|
|
||
|
void styleChange(QStyle &);
|
||
|
%If (Qt_3_0_0 -)
|
||
|
void windowActivationChange(bool);
|
||
|
%End
|
||
|
|
||
|
private:
|
||
|
QIconView(const QIconView &);
|
||
|
};
|
||
|
|
||
|
%End
|
||
|
%End
|