/* This file is part of KDevelop Copyright 2001-2002 Matthias Hoelzer-Kluepfel Copyright 2001-2002 Bernd Gehrmann Copyright 2001 Sandy Meier Copyright 2002 Daniel Engelschalt Copyright 2002 Simon Hausmann Copyright 2002-2003 Roberto Raggi Copyright 2003 Mario Scalas Copyright 2003 Harald Fernengel Copyright 2003,2006 Hamish Rodda Copyright 2004 Alexander Dymo Copyright 2006 Adam Treat This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "context.h" #include #include #include namespace KDevelop { Context::Context() : d(0) {} Context::~Context() {} bool Context::hasType( int aType ) const { return aType == this->type(); } class FileContextPrivate { public: FileContextPrivate( const KUrl::List &urls ) : m_urls( urls ) {} KUrl::List m_urls; }; FileContext::FileContext( const KUrl::List &urls ) : Context(), d( new FileContextPrivate( urls ) ) {} FileContext::~FileContext() { delete d; } int FileContext::type() const { return Context::FileContext; } KUrl::List FileContext::urls() const { return d->m_urls; } class ProjectItemContextPrivate { public: ProjectItemContextPrivate( const QList &items ) : m_items( items ) {} QList m_items; }; ProjectItemContext::ProjectItemContext( const QList &items ) : Context(), d( new ProjectItemContextPrivate( items ) ) {} ProjectItemContext::~ProjectItemContext() { delete d; } int ProjectItemContext::type() const { return Context::ProjectItemContext; } QList ProjectItemContext::items() const { return d->m_items; } class OpenWithContextPrivate { public: OpenWithContextPrivate(const KUrl::List& urls, const KMimeType::Ptr& mimeType) : m_urls( urls ) , m_mimeType( mimeType ) {} KUrl::List m_urls; KMimeType::Ptr m_mimeType; }; OpenWithContext::OpenWithContext(const KUrl::List& urls, const KMimeType::Ptr& mimeType) : Context() , d(new OpenWithContextPrivate(urls, mimeType)) { } int OpenWithContext::type() const { return Context::OpenWithContext; } KUrl::List OpenWithContext::urls() const { return d->m_urls; } KMimeType::Ptr OpenWithContext::mimeType() const { return d->m_mimeType; } }