• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • kasten
  • controllers
  • view
  • bookmarks
bookmarklistmodel.h
Go to the documentation of this file.
1 /*
2  This file is part of the Kasten Framework, made within the KDE community.
3 
4  Copyright 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef BOOKMARKLISTMODEL_H
24 #define BOOKMARKLISTMODEL_H
25 
26 // Okteta gui
27 #include <offsetformat.h>
28 // Qt
29 #include <QtCore/QAbstractTableModel>
30 
31 namespace Okteta {
32 class Bookmark;
33 }
34 template <class T> class QList;
35 
36 
37 namespace Kasten2
38 {
39 
40 class BookmarksTool;
41 
42 
43 class BookmarkListModel : public QAbstractTableModel
44 {
45  Q_OBJECT
46 
47  public:
48  enum ColumnIds
49  {
50  OffsetColumnId = 0,
51  TitleColumnId = 1,
52  NoOfColumnIds = 2 // TODO: what pattern is usually used to mark number of ids?
53  };
54 
55  public:
56  explicit BookmarkListModel( BookmarksTool* tool, QObject* parent = 0 );
57  virtual ~BookmarkListModel();
58 
59  public: // QAbstractTableModel API
60  virtual int rowCount( const QModelIndex& parent ) const;
61  virtual int columnCount( const QModelIndex& parent ) const;
62  virtual QVariant data( const QModelIndex& index, int role ) const;
63  virtual Qt::ItemFlags flags( const QModelIndex& index ) const;
64  virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
65  virtual bool setData( const QModelIndex& index, const QVariant& value, int role );
66 
67  public:
68  const Okteta::Bookmark& bookmark( const QModelIndex& index ) const;
69  QModelIndex index( const Okteta::Bookmark& bookmark, int column = BookmarkListModel::TitleColumnId ) const;
70  using QAbstractTableModel::index;
71 
72  private Q_SLOTS:
73  void onHasBookmarksChanged( bool hasBookmarks );
74  void onBookmarksChanged();
75  void onBookmarksChanged( const QList<int>& bookmarkIndizes );
76 // void onHeadVersionChanged( int newHeadVersionIndex );
77 // void onHeadVersionDataChanged( const DocumentVersionData &newVersionData );
78  void onOffsetCodingChanged( int offsetCoding );
79 
80  private:
81  BookmarksTool* mTool;
82 
83  Okteta::OffsetFormat::print mPrintFunction;
84  mutable char mCodedOffset[Okteta::OffsetFormat::MaxFormatWidth+1];
85 };
86 
87 }
88 
89 #endif
Kasten2::BookmarkListModel
Definition: bookmarklistmodel.h:43
Kasten2::BookmarkListModel::setData
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
Definition: bookmarklistmodel.cpp:141
Kasten2::BookmarkListModel::data
virtual QVariant data(const QModelIndex &index, int role) const
Definition: bookmarklistmodel.cpp:65
Okteta::Bookmark
Definition: bookmark.h:38
Okteta::OffsetFormat::print
void(* print)(char *Buffer, unsigned int Offset)
Definition: offsetformat.h:41
Kasten2::BookmarkListModel::index
QModelIndex index(const Okteta::Bookmark &bookmark, int column=BookmarkListModel::TitleColumnId) const
Definition: bookmarklistmodel.cpp:171
QObject
Kasten2::BookmarkListModel::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Definition: bookmarklistmodel.cpp:113
Kasten2::BookmarkListModel::ColumnIds
ColumnIds
Definition: bookmarklistmodel.h:48
Okteta::OffsetFormat::MaxFormatWidth
static const int MaxFormatWidth
Definition: offsetformat.h:45
Kasten2::BookmarkListModel::headerData
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const
Definition: bookmarklistmodel.cpp:123
Kasten2::BookmarksTool
Definition: bookmarkstool.h:47
Kasten2::BookmarkListModel::BookmarkListModel
BookmarkListModel(BookmarksTool *tool, QObject *parent=0)
Definition: bookmarklistmodel.cpp:37
Kasten2::BookmarkListModel::NoOfColumnIds
Definition: bookmarklistmodel.h:52
Kasten2::BookmarkListModel::~BookmarkListModel
virtual ~BookmarkListModel()
Definition: bookmarklistmodel.cpp:228
Kasten2::BookmarkListModel::bookmark
const Okteta::Bookmark & bookmark(const QModelIndex &index) const
Definition: bookmarklistmodel.cpp:165
Kasten2::BookmarkListModel::rowCount
virtual int rowCount(const QModelIndex &parent) const
Definition: bookmarklistmodel.cpp:55
Kasten2::BookmarkListModel::TitleColumnId
Definition: bookmarklistmodel.h:51
offsetformat.h
Kasten2::BookmarkListModel::OffsetColumnId
Definition: bookmarklistmodel.h:50
QAbstractTableModel
QList
Definition: bookmarkable.h:29
Kasten2::BookmarkListModel::columnCount
virtual int columnCount(const QModelIndex &parent) const
Definition: bookmarklistmodel.cpp:60
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal