• 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
  • core
  • document
bytearraydocument.h
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Kasten module, made within the KDE community.
3 
4  Copyright 2006-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 BYTEARRAYDOCUMENT_H
24 #define BYTEARRAYDOCUMENT_H
25 
26 // lib
27 #include "oktetakastencore_export.h"
28 // #include "kbytearrayinterface.h"
29 // Kasten core
30 #include <person.h>
31 #include <userlistable.h>
32 // HACK: Both the Okteta and Kasten libs have a versionable.h
33 // and in all the installed headers the files are included without the
34 // path prefix matching the namespace. To avoid inclusion of the wrong file if
35 // Okteta include dirs listed are before the Kasten ones, workaround with a
36 // relative path matching the situation when installed
37 // Uses the special forwarding file kasten/core/versionable.h for build
38 // KF5 TODO: all includes from installed headers need to be fixed up, there is
39 // no namespace protection for all of them currently
40 #include "../versionable.h"
41 #include <abstractdocument.h>
42 // Qt
43 #include <QtCore/QString>
44 
45 namespace Okteta {
46 class AbstractByteArrayModel;
47 class PieceTableByteArrayModel;
48 }
49 
50 
51 namespace Kasten2
52 {
53 
54 class OKTETAKASTENCORE_EXPORT ByteArrayDocument : public AbstractDocument,
55  public If::Versionable,
56  public If::UserListable//,
57 // public If::ByteArray
58 {
59  Q_OBJECT
60  Q_INTERFACES(
61  Kasten2::If::Versionable
62  Kasten2::If::UserListable
63 // Kasten2::If::ByteArray
64  )
65 
66  public:
67  explicit ByteArrayDocument( const QString &initDescription );
68  ByteArrayDocument( Okteta::PieceTableByteArrayModel *byteArray, const QString &initDescription );
69  virtual ~ByteArrayDocument();
70 
71  public: // AbstractModel API
72  virtual QString title() const;
73  virtual bool isModifiable() const;
74  virtual bool isReadOnly() const;
75  virtual void setReadOnly( bool isReadOnly );
76 
77  public: // AbstractDocument API
78  virtual QString typeName() const;
79  virtual QString mimeType() const;
80  virtual ContentFlags contentFlags() const;
81 
82  public: // If::Versionable
83  virtual int versionIndex() const;
84  virtual DocumentVersionData versionData( int versionIndex ) const;
85  virtual int versionCount() const;
86  virtual void revertToVersionByIndex( int versionIndex );
87 
88  public: // If::UserListable
89  virtual Person owner() const;
90  virtual QList<Person> userList() const;
91 
92  public: // If::ByteArray
93  virtual Okteta::AbstractByteArrayModel *content() const;
94 
95  public:
96  void setTitle( const QString &title );
97 
98  void setOwner( const Person& owner );
99  void addUsers( const QList<Person>& users );
100  void removeUsers( const QList<Person>& users );
101 
102  Q_SIGNALS: // If::Versionable
103  /*virtual*/ void revertedToVersionIndex( int versionIndex );
104  /*virtual*/ void headVersionDataChanged( const Kasten2::DocumentVersionData &versionData );
105  /*virtual*/ void headVersionChanged( int newHeadVersionIndex );
106 
107  Q_SIGNALS: // If::UserListable
108  /*virtual*/ void usersAdded( const QList<Person>& newUserList );
109  /*virtual*/ void usersRemoved( const QList<Person>& newUserList );
110 
111  private Q_SLOTS:
112  void onModelModified( bool newState );
113  void onHeadVersionDescriptionChanged( const QString &newDescription );
114 
115  private:
116  Okteta::PieceTableByteArrayModel *mByteArray;
117 
118  mutable QString mTitle;
119 
120  const QString mInitDescription;
121 
122  QList<Person> mUserList;
123 };
124 
125 }
126 
127 #endif
Okteta::AbstractByteArrayModel
could it be useful to hide the data access behind an iterator? * class KDataBufferIterator { public: ...
Definition: abstractbytearraymodel.h:79
abstractdocument.h
PrimitiveType::typeName
QString typeName(PrimitiveDataType type)
Definition: primitivedatatype.cpp:68
OKTETAKASTENCORE_EXPORT
#define OKTETAKASTENCORE_EXPORT
Definition: oktetakastencore_export.h:36
Kasten2::If::Versionable
Definition: libs/kasten/core/document/versionable.h:68
userlistable.h
person.h
oktetakastencore_export.h
Kasten2::AbstractDocument
Definition: abstractdocument.h:43
Kasten2::If::UserListable
Definition: userlistable.h:42
Kasten2::ByteArrayDocument
Definition: bytearraydocument.h:54
Kasten2::DocumentVersionData
Definition: documentversiondata.h:36
Okteta::PieceTableByteArrayModel
Definition: piecetablebytearraymodel.h:44
QList
Definition: bookmarkable.h:29
Kasten2::Person
Definition: person.h:38
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