Added some ownCloud plugin class files.

This commit is contained in:
Martin Rotter 2016-02-09 08:36:01 +01:00
parent 1eba731aae
commit 5f5e7a1f89
9 changed files with 250 additions and 3 deletions

View File

@ -360,6 +360,7 @@ file( GLOB APP_SOURCES_GL
"src/services/tt-rss/*.cpp"
"src/services/tt-rss/gui/*.cpp"
"src/services/tt-rss/network/*.cpp"
"src/services/owncloud/*.cpp"
"src/network-web/*.cpp"
"src/network-web/adblock/*.cpp"
"src/*.cpp")
@ -389,6 +390,7 @@ file( GLOB APP_HEADERS
"src/services/tt-rss/*.h"
"src/services/tt-rss/gui/*.h"
"src/services/tt-rss/network/*.h"
"src/services/owncloud/*.h"
"src/network-web/*.h"
"src/network-web/adblock/*.h")

View File

@ -40,6 +40,7 @@
#define SERVICE_CODE_STD_RSS "std-rss"
#define SERVICE_CODE_TT_RSS "tt-rss"
#define SERVICE_CODE_OWNCLOUD "owncloud"
#define ARGUMENTS_LIST_SEPARATOR "\n"

View File

@ -32,6 +32,7 @@
#include "services/standard/standardserviceroot.h"
#include "services/standard/standardserviceentrypoint.h"
#include "services/tt-rss/ttrssserviceentrypoint.h"
#include "services/owncloud/owncloudserviceentrypoint.h"
#include <QSessionManager>
#include <QThread>
@ -59,6 +60,7 @@ QList<ServiceEntryPoint*> Application::feedServices() {
// NOTE: All installed services create their entry points here.
m_feedServices.append(new StandardServiceEntryPoint());
m_feedServices.append(new TtRssServiceEntryPoint());
m_feedServices.append(new OwnCloudServiceEntryPoint());
}
return m_feedServices;

View File

@ -0,0 +1,7 @@
#ifndef OWNCLOUD_DEFINITIONS_H
#define OWNCLOUD_DEFINITIONS_H
#define API_VERSION "1.2"
#endif // OWNCLOUD_DEFINITIONS_H

View File

@ -0,0 +1,69 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2016 by Martin Rotter <rotter.martinos@gmail.com>
//
// RSS Guard is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// RSS Guard 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#include "services/owncloud/owncloudserviceentrypoint.h"
#include "definitions/definitions.h"
#include "miscellaneous/application.h"
#include "miscellaneous/iconfactory.h"
#include "services/owncloud/definitions.h"
OwnCloudServiceEntryPoint::OwnCloudServiceEntryPoint() {
}
OwnCloudServiceEntryPoint::~OwnCloudServiceEntryPoint() {
}
ServiceRoot *OwnCloudServiceEntryPoint::createNewRoot() const {
// TODO: TODO
return NULL;
}
QList<ServiceRoot*> OwnCloudServiceEntryPoint::initializeSubtree() const {
// TODO: TODO
return QList<ServiceRoot*>();
}
bool OwnCloudServiceEntryPoint::isSingleInstanceService() const {
return false;
}
QString OwnCloudServiceEntryPoint::name() const {
return QSL("ownCloud News");
}
QString OwnCloudServiceEntryPoint::code() const {
return SERVICE_CODE_OWNCLOUD;
}
QString OwnCloudServiceEntryPoint::description() const {
return QObject::tr("The News app is an RSS/Atom feed aggregator. It is part of ownCloud suite. This plugin implements %1 API.").arg(API_VERSION);
}
QString OwnCloudServiceEntryPoint::version() const {
return APP_VERSION;
}
QString OwnCloudServiceEntryPoint::author() const {
return APP_AUTHOR;
}
QIcon OwnCloudServiceEntryPoint::icon() const {
return qApp->icons()->fromTheme(QSL("application-owncloud"));
}

View File

@ -0,0 +1,40 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2016 by Martin Rotter <rotter.martinos@gmail.com>
//
// RSS Guard is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// RSS Guard 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#ifndef OWNCLOUDSERVICEENTRYPOINT_H
#define OWNCLOUDSERVICEENTRYPOINT_H
#include "services/abstract/serviceentrypoint.h"
class OwnCloudServiceEntryPoint : public ServiceEntryPoint {
public:
explicit OwnCloudServiceEntryPoint();
virtual ~OwnCloudServiceEntryPoint();
ServiceRoot *createNewRoot() const;
QList<ServiceRoot*> initializeSubtree() const;
bool isSingleInstanceService() const;
QString name() const;
QString code() const;
QString description() const;
QString version() const;
QString author() const;
QIcon icon() const;
};
#endif // OWNCLOUDSERVICEENTRYPOINT_H

View File

@ -0,0 +1,77 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2016 by Martin Rotter <rotter.martinos@gmail.com>
//
// RSS Guard is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// RSS Guard 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#include "services/owncloud/owncloudserviceroot.h"
#include "definitions/definitions.h"
OwnCloudServiceRoot::OwnCloudServiceRoot(RootItem *parent) : ServiceRoot(parent) {
}
OwnCloudServiceRoot::~OwnCloudServiceRoot() {
}
bool OwnCloudServiceRoot::supportsFeedAdding() const {
// TODO: TODO
return false;
}
bool OwnCloudServiceRoot::supportsCategoryAdding() const {
// TODO: TODO
return false;
}
QList<QAction*> OwnCloudServiceRoot::addItemMenu() {
// TODO: TODO
return QList<QAction*>();
}
QList<QAction*> OwnCloudServiceRoot::serviceMenu() {
// TODO: TODO
return QList<QAction*>();
}
RecycleBin *OwnCloudServiceRoot::recycleBin() const {
// TODO: TODO
return NULL;
}
void OwnCloudServiceRoot::start(bool freshly_activated) {
// TODO: TODO
}
void OwnCloudServiceRoot::stop() {
// TODO: TODO
}
QString OwnCloudServiceRoot::code() const {
return SERVICE_CODE_OWNCLOUD;
}
bool OwnCloudServiceRoot::loadMessagesForItem(RootItem *item, QSqlTableModel *model) {
// TODO: TODO
return false;
}
void OwnCloudServiceRoot::addNewFeed(const QString &url) {
// TODO: TODO
}
void OwnCloudServiceRoot::addNewCategory() {
// TODO: TODO
}

View File

@ -0,0 +1,49 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2016 by Martin Rotter <rotter.martinos@gmail.com>
//
// RSS Guard is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// RSS Guard 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with RSS Guard. If not, see <http://www.gnu.org/licenses/>.
#ifndef OWNCLOUDSERVICEROOT_H
#define OWNCLOUDSERVICEROOT_H
#include "services/abstract/serviceroot.h"
class OwnCloudServiceRoot : public ServiceRoot {
public:
explicit OwnCloudServiceRoot(RootItem *parent = NULL);
virtual ~OwnCloudServiceRoot();
bool supportsFeedAdding() const;
bool supportsCategoryAdding() const;
QList<QAction*> addItemMenu();
QList<QAction*> serviceMenu();
RecycleBin *recycleBin() const;
void start(bool freshly_activated);
void stop();
QString code() const;
bool loadMessagesForItem(RootItem *item, QSqlTableModel *model);
public slots:
void addNewFeed(const QString &url);
void addNewCategory();
};
#endif // OWNCLOUDSERVICEROOT_H

View File

@ -1,5 +1,5 @@
#ifndef DEFINITIONS_H
#define DEFINITIONS_H
#ifndef TTRSS_DEFINITIONS_H
#define TTRSS_DEFINITIONS_H
#define MINIMAL_API_LEVEL 9
#define CONTENT_TYPE "application/json; charset=utf-8"
@ -44,4 +44,4 @@
#define UFF_FEED_NOT_FOUND "FEED_NOT_FOUND"
#define UFF_OK "OK"
#endif // DEFINITIONS_H
#endif // TTRSS_DEFINITIONS_H