Exemplo n.º 1
0
        public override QModelIndex Parent(Qyoto.QModelIndex child)
        {
            if (!child.IsValid())
            {
                return(new QModelIndex());
            }

            if (child.InternalPointer() is Account)
            {
                return(new QModelIndex());
            }
            else
            {
                BookmarkConference bmark   = (BookmarkConference)child.InternalPointer();
                Account            account = m_AccountService.Accounts.FirstOrDefault(a => a.BookmarkManager.Conferences.Contains(bmark));
                if (account != null)
                {
                    return(CreateIndex(m_AccountService.Accounts.IndexOf(account), 0, account));
                }
                else
                {
                    return(new QModelIndex());
                }
            }
        }
Exemplo n.º 2
0
            public override QSize SizeHint(Qyoto.QStyleOptionViewItem option, Qyoto.QModelIndex index)
            {
                var hint = base.SizeHint(option, index);

                hint.SetHeight(hint.Height() + 12);
                return(hint);
            }
Exemplo n.º 3
0
 public override QVariant Data(Qyoto.QModelIndex index, int role)
 {
     if (index.IsValid())
     {
         Account account = (Account)index.InternalPointer();
         if (account != null)
         {
             if (index.Column() == 0)
             {
                 if (role == (int)Qt.ItemDataRole.DisplayRole)
                 {
                     return(account.Jid.ToString());
                 }
                 else if (role == (int)Qt.ItemDataRole.CheckStateRole)
                 {
                     return((int)Qt.CheckState.Checked);
                 }
             }
             else if (index.Column() == 1)
             {
                 if (role == (int)Qt.ItemDataRole.DisplayRole)
                 {
                     return(account.ConnectionState.ToString());
                 }
             }
         }
     }
     return(new QVariant());
 }
Exemplo n.º 4
0
 public override QModelIndex Parent(QModelIndex index)
 {
     IntPtr ret = QAbstractItemModelParent((IntPtr) GCHandle.Alloc(this), (IntPtr) GCHandle.Alloc(index));
     QModelIndex result = (QModelIndex) ((GCHandle) ret).Target;
     ((GCHandle) ret).Free();
     return result;
 }
 public override QModelIndex Parent(QModelIndex child)
 {
     GCHandle ret = (GCHandle) QAbstractItemModelParent((IntPtr) GCHandle.Alloc(this),
                                 (IntPtr) GCHandle.Alloc(child));
     QModelIndex ix = (QModelIndex) ret.Target;
     ret.Free();
     return ix;
 }
Exemplo n.º 6
0
 public override QModelIndex MapFromSource(QModelIndex sourceIndex)
 {
     GCHandle ret = (GCHandle) QAbstractProxyModelMapFromSource((IntPtr) GCHandle.Alloc(this),
                                     (IntPtr) GCHandle.Alloc(sourceIndex));
     QModelIndex ix = (QModelIndex) ret.Target;
     ret.SynchronizedFree();
     return ix;
 }
Exemplo n.º 7
0
 public override QRect VisualRect(QModelIndex index)
 {
     GCHandle ret = (GCHandle) QAbstractItemViewVisualRect((IntPtr) GCHandle.Alloc(this),
                                 (IntPtr) GCHandle.Alloc(index));
     QRect r = (QRect) ret.Target;
     ret.Free();
     return r;
 }
 public override QModelIndex MapToSource(QModelIndex proxyIndex)
 {
     GCHandle ret = (GCHandle) QAbstractProxyModelMapToSource((IntPtr) GCHandle.Alloc(this),
                                 (IntPtr) GCHandle.Alloc(proxyIndex));
     QModelIndex ix = (QModelIndex) ret.Target;
     ret.Free();
     return ix;
 }
 public override QModelIndex Index(int row, int column, QModelIndex parent)
 {
     GCHandle ret = (GCHandle) QAbstractItemModelIndex((IntPtr) GCHandle.Alloc(this), row, column,
                         (IntPtr) GCHandle.Alloc(parent));
     QModelIndex ix = (QModelIndex) ret.Target;
     ret.Free();
     return ix;
 }
Exemplo n.º 10
0
 public override QVariant Data(QModelIndex index, int role)
 {
     GCHandle ret = (GCHandle) QAbstractItemModelData((IntPtr) GCHandle.Alloc(this),
                                 (IntPtr) GCHandle.Alloc(index), role);
     QVariant v = (QVariant) ret.Target;
     ret.SynchronizedFree();
     return v;
 }
Exemplo n.º 11
0
        public override QModelIndex Parent(QModelIndex index)
        {
            IntPtr      ret    = QAbstractItemModelParent((IntPtr)GCHandle.Alloc(this), (IntPtr)GCHandle.Alloc(index));
            QModelIndex result = (QModelIndex)((GCHandle)ret).Target;

            ((GCHandle)ret).SynchronizedFree();
            return(result);
        }
Exemplo n.º 12
0
        public override QVariant Data(QModelIndex index, int role)
        {
            GCHandle ret = (GCHandle)QAbstractItemModelData((IntPtr)GCHandle.Alloc(this),
                                                            (IntPtr)GCHandle.Alloc(index), role);
            QVariant v = (QVariant)ret.Target;

            ret.SynchronizedFree();
            return(v);
        }
Exemplo n.º 13
0
        public override QModelIndex Parent(QModelIndex child)
        {
            GCHandle ret = (GCHandle)QAbstractItemModelParent((IntPtr)GCHandle.Alloc(this),
                                                              (IntPtr)GCHandle.Alloc(child));
            QModelIndex ix = (QModelIndex)ret.Target;

            ret.SynchronizedFree();
            return(ix);
        }
Exemplo n.º 14
0
        protected QModelIndex CreateIndex(int row, int column, object ptr)
        {
            IntPtr ret = AbstractItemModelCreateIndex((IntPtr)GCHandle.Alloc(this),
                                                      row, column, (IntPtr)GetIndexHandle(ptr));
            QModelIndex result = (QModelIndex)((GCHandle)ret).Target;

            ((GCHandle)ret).SynchronizedFree();
            return(result);
        }
Exemplo n.º 15
0
        public override QRect VisualRect(QModelIndex index)
        {
            GCHandle ret = (GCHandle)QAbstractItemViewVisualRect((IntPtr)GCHandle.Alloc(this),
                                                                 (IntPtr)GCHandle.Alloc(index));
            QRect r = (QRect)ret.Target;

            ret.SynchronizedFree();
            return(r);
        }
Exemplo n.º 16
0
        public override QModelIndex IndexAt(QPoint point)
        {
            GCHandle ret = (GCHandle)QAbstractItemViewIndexAt((IntPtr)GCHandle.Alloc(this),
                                                              (IntPtr)GCHandle.Alloc(point));
            QModelIndex i = (QModelIndex)ret.Target;

            ret.SynchronizedFree();
            return(i);
        }
Exemplo n.º 17
0
        public override QModelIndex MapToSource(QModelIndex proxyIndex)
        {
            GCHandle ret = (GCHandle)QAbstractProxyModelMapToSource((IntPtr)GCHandle.Alloc(this),
                                                                    (IntPtr)GCHandle.Alloc(proxyIndex));
            QModelIndex ix = (QModelIndex)ret.Target;

            ret.SynchronizedFree();
            return(ix);
        }
Exemplo n.º 18
0
        public override QModelIndex Index(int row, int column, QModelIndex parent)
        {
            GCHandle ret = (GCHandle)QAbstractItemModelIndex((IntPtr)GCHandle.Alloc(this), row, column,
                                                             (IntPtr)GCHandle.Alloc(parent));
            QModelIndex ix = (QModelIndex)ret.Target;

            ret.SynchronizedFree();
            return(ix);
        }
 public override QSize SizeHint(QStyleOptionViewItem option, QModelIndex index)
 {
     GCHandle ret = (GCHandle) QAbstractItemDelegateSizeHint((IntPtr) GCHandle.Alloc(this),
                                 (IntPtr) GCHandle.Alloc(option),
                                 (IntPtr) GCHandle.Alloc(index));
     QSize s = (QSize) ret.Target;
     ret.Free();
     return s;
 }
Exemplo n.º 20
0
        public override QSize SizeHint(QStyleOptionViewItem option, QModelIndex index)
        {
            GCHandle ret = (GCHandle)QAbstractItemDelegateSizeHint((IntPtr)GCHandle.Alloc(this),
                                                                   (IntPtr)GCHandle.Alloc(option),
                                                                   (IntPtr)GCHandle.Alloc(index));
            QSize s = (QSize)ret.Target;

            ret.SynchronizedFree();
            return(s);
        }
Exemplo n.º 21
0
 public override int RowCount(Qyoto.QModelIndex parent)
 {
     if (!parent.IsValid())
     {
         return(ServiceManager.Get <AccountService>().Accounts.Count);
     }
     else
     {
         return(0);
     }
 }
Exemplo n.º 22
0
 public override QVariant Data(QModelIndex index, int role)
 {
     object item = index.InternalPointer();
     if (role == (int)Qt.ItemDataRole.DisplayRole) {
         if (item is Account)
             return ((Account)item).Jid.Bare;
         else if (item is BookmarkConference) {
             BookmarkConference conf = (BookmarkConference)item;
             return String.Format("{0} ({1})", conf.ConferenceName, conf.JID);
         }
     }
     return new QVariant();
 }
Exemplo n.º 23
0
 public override uint Flags(Qyoto.QModelIndex index)
 {
     if (index.Column() == 0)
     {
         return((uint)Qt.ItemFlag.ItemIsUserCheckable |
                (uint)Qt.ItemFlag.ItemIsSelectable |
                (uint)Qt.ItemFlag.ItemIsEnabled);
     }
     else
     {
         return((uint)Qt.ItemFlag.ItemIsSelectable);
     }
 }
Exemplo n.º 24
0
            public override QModelIndex Index(int row, int column, Qyoto.QModelIndex parent)
            {
                var accounts = ServiceManager.Get <AccountService>().Accounts;

                if (accounts.Count >= row + 1)
                {
                    Account account = accounts[row];
                    return(CreateIndex(row, column, account));
                }
                else
                {
                    return(CreateIndex(-1, -1));
                }
            }
Exemplo n.º 25
0
            public override QVariant Data(Qyoto.QModelIndex index, int role)
            {
                Addin addin = m_Addins[index.Row()];

                if (role == (int)Qt.ItemDataRole.DisplayRole)
                {
                    return(addin.Name);
                }
                else if (role == (int)Qt.ItemDataRole.CheckStateRole)
                {
                    return(addin.Enabled ? (int)Qt.CheckState.Checked : (int)Qt.CheckState.Unchecked);
                }
                else
                {
                    return(new QVariant());
                }
            }
Exemplo n.º 26
0
        public override QModelIndex Index(int row, int column, Qyoto.QModelIndex parent)
        {
            if (!HasIndex(row, column, parent))
            {
                return(new QModelIndex());
            }

            if (!parent.IsValid())
            {
                Account account = m_AccountService.Accounts[row];
                return(CreateIndex(row, column, account));
            }
            else
            {
                Account            account = (Account)parent.InternalPointer();
                BookmarkConference bmark   = account.BookmarkManager.Conferences.ElementAt(row);
                return(CreateIndex(row, column, bmark));
            }
        }
Exemplo n.º 27
0
 public override int RowCount(Qyoto.QModelIndex parent)
 {
     if (!parent.IsValid())
     {
         return(m_AccountService.Accounts.Count);
     }
     else
     {
         if (parent.InternalPointer() is Account)
         {
             Account account = (Account)parent.InternalPointer();
             return(account.BookmarkManager.Count);
         }
         else
         {
             return(0);
         }
     }
 }
Exemplo n.º 28
0
 protected virtual void InitStyleOption(QStyleOptionViewItem option, QModelIndex index)
 {
     interceptor.Invoke("initStyleOption##", "initStyleOption(QStyleOptionViewItem*, const QModelIndex&) const", typeof(void), typeof(QStyleOptionViewItem), option, typeof(QModelIndex), index);
 }
Exemplo n.º 29
0
 public override QWidget CreateEditor(QWidget parent, QStyleOptionViewItem option, QModelIndex index)
 {
     return (QWidget) interceptor.Invoke("createEditor###", "createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const", typeof(QWidget), typeof(QWidget), parent, typeof(QStyleOptionViewItem), option, typeof(QModelIndex), index);
 }
Exemplo n.º 30
0
 public override void UpdateEditorGeometry(QWidget editor, QStyleOptionViewItem option, QModelIndex index)
 {
     interceptor.Invoke("updateEditorGeometry###", "updateEditorGeometry(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const", typeof(void), typeof(QWidget), editor, typeof(QStyleOptionViewItem), option, typeof(QModelIndex), index);
 }
Exemplo n.º 31
0
 protected new virtual bool EditorEvent(QEvent arg1, QAbstractItemModel model, QStyleOptionViewItem option, QModelIndex index)
 {
     return (bool) interceptor.Invoke("editorEvent####", "editorEvent(QEvent*, QAbstractItemModel*, const QStyleOptionViewItem&, const QModelIndex&)", typeof(bool), typeof(QEvent), arg1, typeof(QAbstractItemModel), model, typeof(QStyleOptionViewItem), option, typeof(QModelIndex), index);
 }
Exemplo n.º 32
0
 public override void SetModelData(QWidget editor, QAbstractItemModel model, QModelIndex index)
 {
     interceptor.Invoke("setModelData###", "setModelData(QWidget*, QAbstractItemModel*, const QModelIndex&) const", typeof(void), typeof(QWidget), editor, typeof(QAbstractItemModel), model, typeof(QModelIndex), index);
 }
Exemplo n.º 33
0
 public override QSize SizeHint(QStyleOptionViewItem option, QModelIndex index)
 {
     return (QSize) interceptor.Invoke("sizeHint##", "sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const", typeof(QSize), typeof(QStyleOptionViewItem), option, typeof(QModelIndex), index);
 }
 public override QVariant Data(QModelIndex index, int role)
 {
     return null;
 }
Exemplo n.º 35
0
 public bool IsColumnSelected(int column, QModelIndex parent)
 {
     return (bool) interceptor.Invoke("isColumnSelected$#", "isColumnSelected(int, const QModelIndex&) const", typeof(bool), typeof(int), column, typeof(QModelIndex), parent);
 }
Exemplo n.º 36
0
 public override int RowCount(QModelIndex parent)
 {
     return (int) interceptor.Invoke("rowCount#", "rowCount(const QModelIndex&) const", typeof(int), typeof(QModelIndex), parent);
 }
Exemplo n.º 37
0
 public QModelIndex(QModelIndex other) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QModelIndex#", "QModelIndex(const QModelIndex&)", typeof(void), typeof(QModelIndex), other);
 }
Exemplo n.º 38
0
 public override QModelIndex Parent(QModelIndex child)
 {
     return null;
 }
Exemplo n.º 39
0
 public override bool CanFetchMore(QModelIndex parent)
 {
     return((bool)interceptor.Invoke("canFetchMore#", "canFetchMore(const QModelIndex&) const", typeof(bool), typeof(QModelIndex), parent));
 }
Exemplo n.º 40
0
 public override int ColumnCount(QModelIndex parent)
 {
     return((int)interceptor.Invoke("columnCount#", "columnCount(const QModelIndex&) const", typeof(int), typeof(QModelIndex), parent));
 }
Exemplo n.º 41
0
 public override void Paint(QPainter painter, QStyleOptionViewItem option, QModelIndex index)
 {
     interceptor.Invoke("paint###", "paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const", typeof(void), typeof(QPainter), painter, typeof(QStyleOptionViewItem), option, typeof(QModelIndex), index);
 }
Exemplo n.º 42
0
 public override void SetEditorData(QWidget editor, QModelIndex index)
 {
     interceptor.Invoke("setEditorData##", "setEditorData(QWidget*, const QModelIndex&) const", typeof(void), typeof(QWidget), editor, typeof(QModelIndex), index);
 }
Exemplo n.º 43
0
 public override void FetchMore(QModelIndex parent)
 {
     interceptor.Invoke("fetchMore#", "fetchMore(const QModelIndex&)", typeof(void), typeof(QModelIndex), parent);
 }
Exemplo n.º 44
0
Arquivo: Qt.cs Projeto: KDE/qyoto
 public static uint QHash(QModelIndex index)
 {
     return (uint) staticInterceptor.Invoke("qHash#", "qHash(const QModelIndex&)", typeof(uint), typeof(QModelIndex), index);
 }
Exemplo n.º 45
0
 protected QModelIndex IndexInQuery(QModelIndex item)
 {
     return((QModelIndex)interceptor.Invoke("indexInQuery#", "indexInQuery(const QModelIndex&) const", typeof(QModelIndex), typeof(QModelIndex), item));
 }
Exemplo n.º 46
0
 public bool IsSelected(QModelIndex index)
 {
     return (bool) interceptor.Invoke("isSelected#", "isSelected(const QModelIndex&) const", typeof(bool), typeof(QModelIndex), index);
 }
Exemplo n.º 47
0
 public virtual string PathFromIndex(QModelIndex index)
 {
     return (string) interceptor.Invoke("pathFromIndex#", "pathFromIndex(const QModelIndex&) const", typeof(string), typeof(QModelIndex), index);
 }
Exemplo n.º 48
0
 public virtual void Select(QModelIndex index, uint command)
 {
     interceptor.Invoke("select#$", "select(const QModelIndex&, QItemSelectionModel::SelectionFlags)", typeof(void), typeof(QModelIndex), index, typeof(uint), command);
 }
Exemplo n.º 49
0
 public bool ColumnIntersectsSelection(int column, QModelIndex parent)
 {
     return (bool) interceptor.Invoke("columnIntersectsSelection$#", "columnIntersectsSelection(int, const QModelIndex&) const", typeof(bool), typeof(int), column, typeof(QModelIndex), parent);
 }
Exemplo n.º 50
0
 public override QVariant Data(QModelIndex item, int role)
 {
     return((QVariant)interceptor.Invoke("data#$", "data(const QModelIndex&, int) const", typeof(QVariant), typeof(QModelIndex), item, typeof(int), role));
 }
Exemplo n.º 51
0
 public bool IsRowSelected(int row, QModelIndex parent)
 {
     return (bool) interceptor.Invoke("isRowSelected$#", "isRowSelected(int, const QModelIndex&) const", typeof(bool), typeof(int), row, typeof(QModelIndex), parent);
 }
Exemplo n.º 52
0
 public override bool SetData(QModelIndex item, QVariant value)
 {
     return((bool)interceptor.Invoke("setData##", "setData(const QModelIndex&, const QVariant&)", typeof(bool), typeof(QModelIndex), item, typeof(QVariant), value));
 }
Exemplo n.º 53
0
 public bool RowIntersectsSelection(int row, QModelIndex parent)
 {
     return (bool) interceptor.Invoke("rowIntersectsSelection$#", "rowIntersectsSelection(int, const QModelIndex&) const", typeof(bool), typeof(int), row, typeof(QModelIndex), parent);
 }
Exemplo n.º 54
0
 protected virtual bool LessThan(QModelIndex left, QModelIndex right)
 {
     return((bool)interceptor.Invoke("lessThan##", "lessThan(const QModelIndex&, const QModelIndex&) const", typeof(bool), typeof(QModelIndex), left, typeof(QModelIndex), right));
 }
Exemplo n.º 55
0
 public void SetCurrentIndex(QModelIndex index, uint command)
 {
     interceptor.Invoke("setCurrentIndex#$", "setCurrentIndex(const QModelIndex&, QItemSelectionModel::SelectionFlags)", typeof(void), typeof(QModelIndex), index, typeof(uint), command);
 }
Exemplo n.º 56
0
 public override QModelIndex MapToSource(QModelIndex proxyIndex)
 {
     return((QModelIndex)interceptor.Invoke("mapToSource#", "mapToSource(const QModelIndex&) const", typeof(QModelIndex), typeof(QModelIndex), proxyIndex));
 }
Exemplo n.º 57
0
 public override QVariant Data(QModelIndex item)
 {
     return((QVariant)interceptor.Invoke("data#", "data(const QModelIndex&) const", typeof(QVariant), typeof(QModelIndex), item));
 }
Exemplo n.º 58
0
 public override QModelIndex MapFromSource(QModelIndex sourceIndex)
 {
     return((QModelIndex)interceptor.Invoke("mapFromSource#", "mapFromSource(const QModelIndex&) const", typeof(QModelIndex), typeof(QModelIndex), sourceIndex));
 }
Exemplo n.º 59
0
 public override bool RemoveColumns(int column, int count, QModelIndex parent)
 {
     return((bool)interceptor.Invoke("removeColumns$$#", "removeColumns(int, int, const QModelIndex&)", typeof(bool), typeof(int), column, typeof(int), count, typeof(QModelIndex), parent));
 }
Exemplo n.º 60
0
 /// <remarks>
 ///  Returns the item at the given <code>index.</code>
 ///      </remarks>        <short>    Returns the item at the given <code>index.</code></short>
 public Akonadi.Item ItemForIndex(QModelIndex index)
 {
     return (Akonadi.Item) interceptor.Invoke("itemForIndex#", "itemForIndex(const QModelIndex&) const", typeof(Akonadi.Item), typeof(QModelIndex), index);
 }