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

Nepomuk-Core

  • sources
  • kde-4.12
  • kdelibs
  • nepomuk-core
  • services
  • storage
syncresource.h
Go to the documentation of this file.
1 /*
2  This file is part of the Nepomuk KDE project.
3  Copyright (C) 2010 Vishesh Handa <handa.vish@gmail.com>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) version 3, or any
9  later version accepted by the membership of KDE e.V. (or its
10  successor approved by the membership of KDE e.V.), which shall
11  act as a proxy defined in Section 6 of version 3 of the license.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 
23 #ifndef NEPOMUK_SIMPLERESOURCEH_H
24 #define NEPOMUK_SIMPLERESOURCEH_H
25 
26 #include <KUrl>
27 
28 #include <QtCore/QList>
29 #include <QtCore/QHash>
30 #include <QtCore/QSharedDataPointer>
31 
32 
33 namespace Soprano {
34  class Node;
35  class Statement;
36  class Graph;
37 }
38 
39 namespace Nepomuk2 {
40  namespace Sync {
41 
53  class SyncResource : public QMultiHash<KUrl, Soprano::Node>
54  {
55  public :
56  SyncResource();
57  SyncResource( const KUrl & uri );
58  SyncResource( const SyncResource & rhs );
59  virtual ~SyncResource();
60 
65  static SyncResource fromStatementList(const QList<Soprano::Statement> & list);
66 
67  QList<Soprano::Statement> toStatementList() const;
68 
69  bool isFileDataObject() const;
70  bool isFolder() const;
71  bool isBlank() const;
72  KUrl nieUrl() const;
73 
74  KUrl uri() const;
75  Soprano::Node uriNode() const;
76 
82  void setUri( const Soprano::Node & node );
83 
84  QList<Soprano::Node> property( const KUrl & url ) const;
85 
89  void removeObject( const KUrl & uri );
90 
91  SyncResource& operator=( const SyncResource & rhs );
92  bool operator==( const SyncResource & res ) const;
93 
94  bool isValid() const;
95  private:
96  class Private;
97  QSharedDataPointer<Private> d;
98  };
99 
109  class ResourceHash : public QHash<KUrl, SyncResource> {
110  public :
111  static ResourceHash fromStatementList( const QList<Soprano::Statement> & list );
112  static ResourceHash fromGraph( const Soprano::Graph & graph );
113 
114  QList<Soprano::Statement> toStatementList() const;
115  };
116 
117  uint qHash(const SyncResource& res);
118  QDebug operator<<(QDebug dbg, const Nepomuk2::Sync::SyncResource& res);
119  }
120 }
121 
122 #endif // NEPOMUK_SIMPLERESOURCEH_H
QMultiHash
Nepomuk2::Sync::SyncResource::operator=
SyncResource & operator=(const SyncResource &rhs)
Definition: syncresource.cpp:63
Nepomuk2::Sync::SyncResource::SyncResource
SyncResource()
Definition: syncresource.cpp:42
Nepomuk2::Sync::qHash
uint qHash(const SyncResource &res)
Definition: syncresource.cpp:251
Nepomuk2::Sync::operator<<
QDebug operator<<(QDebug dbg, const Nepomuk2::Sync::SyncResource &res)
Definition: syncresource.cpp:267
Nepomuk2::Sync::SyncResource::~SyncResource
virtual ~SyncResource()
Definition: syncresource.cpp:59
Nepomuk2::Sync::SyncResource::removeObject
void removeObject(const KUrl &uri)
Removes all the statements whose object is uri.
Definition: syncresource.cpp:143
Nepomuk2::Sync::SyncResource::fromStatementList
static SyncResource fromStatementList(const QList< Soprano::Statement > &list)
It uses the the first element's subject as the uri and ignores all further subjects.
Definition: syncresource.cpp:164
Nepomuk2::Sync::ResourceHash::toStatementList
QList< Soprano::Statement > toStatementList() const
Definition: syncresource.cpp:227
Nepomuk2::Sync::SyncResource::nieUrl
KUrl nieUrl() const
Definition: syncresource.cpp:107
QHash
Nepomuk2::Sync::SyncResource::isValid
bool isValid() const
Definition: syncresource.cpp:239
Nepomuk2::Sync::ResourceHash::fromStatementList
static ResourceHash fromStatementList(const QList< Soprano::Statement > &list)
Definition: syncresource.cpp:198
Nepomuk2::Sync::SyncResource::operator==
bool operator==(const SyncResource &res) const
Definition: syncresource.cpp:69
Nepomuk2::Sync::SyncResource::toStatementList
QList< Soprano::Statement > toStatementList() const
Definition: syncresource.cpp:75
Nepomuk2::Sync::SyncResource::property
QList< Soprano::Node > property(const KUrl &url) const
Definition: syncresource.cpp:138
Nepomuk2::Sync::ResourceHash::fromGraph
static ResourceHash fromGraph(const Soprano::Graph &graph)
Definition: syncresource.cpp:192
Nepomuk2::Sync::SyncResource::uri
KUrl uri() const
Definition: syncresource.cpp:127
Nepomuk2::Sync::SyncResource::isFileDataObject
bool isFileDataObject() const
Definition: syncresource.cpp:101
Nepomuk2::Sync::SyncResource::isFolder
bool isFolder() const
Definition: syncresource.cpp:95
Nepomuk2::Sync::SyncResource::setUri
void setUri(const Soprano::Node &node)
If node is resource node the uri is set to the node's uri Otherwise if node is a blank node then the ...
Definition: syncresource.cpp:117
Nepomuk2::Sync::SyncResource::isBlank
bool isBlank() const
Definition: syncresource.cpp:244
Nepomuk2::Sync::SyncResource
A SyncResource is a convenient way of storing a set of properties and objects for a common subject...
Definition: syncresource.h:53
Nepomuk2::Sync::SyncResource::uriNode
Soprano::Node uriNode() const
Definition: syncresource.cpp:132
Nepomuk2::Sync::ResourceHash
A SyncResource is a convenient way of representing a list of Soprano::Statements or a Soprano::Graph...
Definition: syncresource.h:109
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk-Core

Skip menu "Nepomuk-Core"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

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