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

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • plugins
  • runner
  • hostip
HostipPlugin.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2010 Dennis Nienhüser <earthwings@gentoo.org>
9 //
10 
11 #include "HostipPlugin.h"
12 #include "HostipRunner.h"
13 #include "MarbleGlobal.h"
14 
15 namespace Marble
16 {
17 
18 HostipPlugin::HostipPlugin( QObject *parent ) :
19  SearchRunnerPlugin( parent )
20 {
21  setSupportedCelestialBodies( QStringList() << "earth" );
22  setCanWorkOffline( false );
23 }
24 
25 QString HostipPlugin::name() const
26 {
27  return tr( "Hostip.info Search" );
28 }
29 
30 QString HostipPlugin::guiString() const
31 {
32  return tr( "Hostip.info" );
33 }
34 
35 QString HostipPlugin::nameId() const
36 {
37  return "hostip";
38 }
39 
40 QString HostipPlugin::version() const
41 {
42  return "1.0";
43 }
44 
45 QString HostipPlugin::description() const
46 {
47  return tr( "Host name and IP geolocation search using the hostip.info service" );
48 }
49 
50 QString HostipPlugin::copyrightYears() const
51 {
52  return "2010";
53 }
54 
55 QList<PluginAuthor> HostipPlugin::pluginAuthors() const
56 {
57  return QList<PluginAuthor>()
58  << PluginAuthor( QString::fromUtf8( "Dennis Nienhüser" ), "earthwings@gentoo.org" );
59 }
60 
61 SearchRunner* HostipPlugin::newRunner() const
62 {
63  return new HostipRunner;
64 }
65 
66 bool HostipPlugin::canWork() const
67 {
68  bool const smallScreen = MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen;
69  // Disabled on small screen devices to save resources
70  return !smallScreen;
71 }
72 
73 }
74 
75 Q_EXPORT_PLUGIN2( HostipPlugin, Marble::HostipPlugin )
76 
77 #include "HostipPlugin.moc"
Marble::HostipPlugin::copyrightYears
QString copyrightYears() const
Definition: HostipPlugin.cpp:50
Marble::PluginAuthor
Definition: PluginInterface.h:28
Marble::HostipPlugin::description
QString description() const
Returns a user description of the plugin.
Definition: HostipPlugin.cpp:45
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
Marble::HostipPlugin::HostipPlugin
HostipPlugin(QObject *parent=0)
Definition: HostipPlugin.cpp:18
QString::fromUtf8
QString fromUtf8(const char *str, int size)
Marble::HostipPlugin::name
QString name() const
Returns the user-visible name of the plugin.
Definition: HostipPlugin.cpp:25
HostipRunner.h
QObject
Marble::SearchRunnerPlugin
A plugin for Marble to execute a placemark search.
Definition: SearchRunnerPlugin.h:25
QString
QList
Marble::HostipPlugin::pluginAuthors
QList< PluginAuthor > pluginAuthors() const
Definition: HostipPlugin.cpp:55
MarbleGlobal.h
Marble::SearchRunnerPlugin::setSupportedCelestialBodies
void setSupportedCelestialBodies(const QStringList &celestialBodies)
Definition: SearchRunnerPlugin.cpp:59
Marble::HostipPlugin::nameId
QString nameId() const
Returns the unique name of the plugin.
Definition: HostipPlugin.cpp:35
QStringList
Q_EXPORT_PLUGIN2
#define Q_EXPORT_PLUGIN2(a, b)
Definition: marble_export.h:34
Marble::MarbleGlobal::SmallScreen
Definition: MarbleGlobal.h:287
Marble::MarbleGlobal::getInstance
static MarbleGlobal * getInstance()
Definition: MarbleGlobal.cpp:37
Marble::SearchRunnerPlugin::setCanWorkOffline
void setCanWorkOffline(bool canWorkOffline)
Definition: SearchRunnerPlugin.cpp:64
Marble::HostipPlugin
Definition: HostipPlugin.h:20
HostipPlugin.h
Marble::HostipRunner
Definition: HostipRunner.h:25
Marble::MarbleGlobal::profiles
Profiles profiles() const
Definition: MarbleGlobal.cpp:48
Marble::HostipPlugin::canWork
bool canWork() const
Returns.
Definition: HostipPlugin.cpp:66
Marble::HostipPlugin::guiString
QString guiString() const
Returns the string that should appear in the user interface.
Definition: HostipPlugin.cpp:30
Marble::HostipPlugin::version
QString version() const
Definition: HostipPlugin.cpp:40
Marble::SearchRunner
Definition: SearchRunner.h:30
Marble::HostipPlugin::newRunner
virtual SearchRunner * newRunner() const
Plugin factory method to create a new runner instance.
Definition: HostipPlugin.cpp:61
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

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