• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

NepomukDaemons

term.h

Go to the documentation of this file.
00001 /*
00002    This file is part of the Nepomuk KDE project.
00003    Copyright (C) 2007 Sebastian Trueg <trueg@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #ifndef _NEPOMUK_SEARCH_TERM_H_
00021 #define _NEPOMUK_SEARCH_TERM_H_
00022 
00023 #include <QtCore/QList>
00024 #include <QtCore/QUrl>
00025 #include <QtCore/QSharedDataPointer>
00026 
00027 #include <Soprano/LiteralValue>
00028 
00029 #include <nepomuk/nepomuk_export.h>
00030 
00031 
00032 namespace Nepomuk {
00033     namespace Search {
00044         class NEPOMUK_EXPORT Term
00045         {
00046         public:
00050             enum Type {
00051                 InvalidTerm,    
00059                 LiteralTerm,
00060 
00066                 ResourceTerm,
00067 
00071                 AndTerm,
00072 
00076                 OrTerm,
00077 
00085                 ComparisonTerm
00086             };
00087 
00088             enum Comparator {
00089                 Contains,
00090                 Equal,
00091                 Greater,
00092                 Smaller,
00093                 GreaterOrEqual,
00094                 SmallerOrEqual
00095             };
00096 
00100             Term();
00101 
00105             Term( const Term& other );
00106 
00110             Term( const Soprano::LiteralValue& value );
00111 
00115             Term( const QUrl& resource );
00116 
00124             Term( const QString& field, const Soprano::LiteralValue& value, Comparator c = Contains );
00125 
00133             Term( const QUrl& field, const Soprano::LiteralValue& value, Comparator c = Contains );
00134 
00140             Term( const QUrl& field, const QUrl& resource );
00141 
00145             ~Term();
00146 
00150             Term& operator=( const Term& other );
00151 
00155             Term& operator=( const Soprano::LiteralValue& other );
00156 
00160             bool isValid() const;
00161 
00167             Type type() const;
00168 
00174             Soprano::LiteralValue value() const;
00175 
00181             QUrl resource() const;
00182 
00188             Comparator comparator() const;
00189 
00196             QString field() const;
00197 
00203             QUrl property() const;
00204 
00210             QList<Term> subTerms() const;
00211 
00215             void setType( Type );
00216 
00220             void setValue( const Soprano::LiteralValue& );
00221 
00225             void setResource( const QUrl& );
00226 
00230             void setComparator( Comparator );
00231 
00239             void setField( const QString& );
00240             
00249             void setProperty( const QUrl& );
00250 
00256             void setSubTerms( const QList<Term>& );
00257 
00263             void addSubTerm( const Term& );
00264 
00268             bool operator==( const Term& ) const;
00269 
00270         private:
00271             class Private;
00272             QSharedDataPointer<Private> d; 
00273         };
00274 
00275         NEPOMUK_EXPORT uint qHash( const Nepomuk::Search::Term& );
00276     }
00277 }
00278 
00279 NEPOMUK_EXPORT QDebug operator<<( QDebug, const Nepomuk::Search::Term& );
00280 
00281 #endif

NepomukDaemons

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

API Reference

Skip menu "API Reference"
  • KCMShell
  • KNotify
  • KStyles
  • Nepomuk Daemons
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal