Example #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());
                }
            }
        }
Example #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);
            }
Example #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());
 }
 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;
 }
Example #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;
 }
 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;
 }
Example #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;
 }
Example #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);
        }
Example #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);
        }
        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);
        }
Example #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);
        }
        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);
        }
        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);
        }
        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);
        }
        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;
 }
Example #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);
        }
Example #21
0
 public override int RowCount(Qyoto.QModelIndex parent)
 {
     if (!parent.IsValid())
     {
         return(ServiceManager.Get <AccountService>().Accounts.Count);
     }
     else
     {
         return(0);
     }
 }
Example #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();
 }
Example #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);
     }
 }
Example #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));
                }
            }
Example #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());
                }
            }
Example #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));
            }
        }
Example #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);
         }
     }
 }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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;
 }
Example #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);
 }
Example #36
0
 public override int RowCount(QModelIndex parent)
 {
     return (int) interceptor.Invoke("rowCount#", "rowCount(const QModelIndex&) const", typeof(int), typeof(QModelIndex), parent);
 }
Example #37
0
 public QModelIndex(QModelIndex other) : this((Type)null)
 {
     CreateProxy();
     interceptor.Invoke("QModelIndex#", "QModelIndex(const QModelIndex&)", typeof(void), typeof(QModelIndex), other);
 }
Example #38
0
 public override QModelIndex Parent(QModelIndex child)
 {
     return null;
 }
Example #39
0
 public override bool CanFetchMore(QModelIndex parent)
 {
     return((bool)interceptor.Invoke("canFetchMore#", "canFetchMore(const QModelIndex&) const", typeof(bool), typeof(QModelIndex), parent));
 }
Example #40
0
 public override int ColumnCount(QModelIndex parent)
 {
     return((int)interceptor.Invoke("columnCount#", "columnCount(const QModelIndex&) const", typeof(int), typeof(QModelIndex), parent));
 }
Example #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);
 }
Example #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);
 }
Example #43
0
 public override void FetchMore(QModelIndex parent)
 {
     interceptor.Invoke("fetchMore#", "fetchMore(const QModelIndex&)", typeof(void), typeof(QModelIndex), parent);
 }
Example #44
0
File: Qt.cs Project: KDE/qyoto
 public static uint QHash(QModelIndex index)
 {
     return (uint) staticInterceptor.Invoke("qHash#", "qHash(const QModelIndex&)", typeof(uint), typeof(QModelIndex), index);
 }
Example #45
0
 protected QModelIndex IndexInQuery(QModelIndex item)
 {
     return((QModelIndex)interceptor.Invoke("indexInQuery#", "indexInQuery(const QModelIndex&) const", typeof(QModelIndex), typeof(QModelIndex), item));
 }
Example #46
0
 public bool IsSelected(QModelIndex index)
 {
     return (bool) interceptor.Invoke("isSelected#", "isSelected(const QModelIndex&) const", typeof(bool), typeof(QModelIndex), index);
 }
Example #47
0
 public virtual string PathFromIndex(QModelIndex index)
 {
     return (string) interceptor.Invoke("pathFromIndex#", "pathFromIndex(const QModelIndex&) const", typeof(string), typeof(QModelIndex), index);
 }
Example #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);
 }
Example #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);
 }
Example #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));
 }
Example #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);
 }
Example #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));
 }
Example #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);
 }
Example #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));
 }
Example #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);
 }
Example #56
0
 public override QModelIndex MapToSource(QModelIndex proxyIndex)
 {
     return((QModelIndex)interceptor.Invoke("mapToSource#", "mapToSource(const QModelIndex&) const", typeof(QModelIndex), typeof(QModelIndex), proxyIndex));
 }
Example #57
0
 public override QVariant Data(QModelIndex item)
 {
     return((QVariant)interceptor.Invoke("data#", "data(const QModelIndex&) const", typeof(QVariant), typeof(QModelIndex), item));
 }
Example #58
0
 public override QModelIndex MapFromSource(QModelIndex sourceIndex)
 {
     return((QModelIndex)interceptor.Invoke("mapFromSource#", "mapFromSource(const QModelIndex&) const", typeof(QModelIndex), typeof(QModelIndex), sourceIndex));
 }
Example #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));
 }
Example #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);
 }