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());
                }
            }
        }
            public override QSize SizeHint(Qyoto.QStyleOptionViewItem option, Qyoto.QModelIndex index)
            {
                var hint = base.SizeHint(option, index);

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