From b6eb80309781bd02b9b66808d29508f23881de66 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 30 Jun 2012 14:57:42 -0500 Subject: Extend instrument parts --- lib/libtqtrla/src/Makefile.am | 2 +- lib/libtqtrla/src/tqtrla.cpp | 48 +++++++++++++++++++++++++++++++++++++++++++ lib/libtqtrla/src/tqtrla.h | 44 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libtqtrla/src/Makefile.am b/lib/libtqtrla/src/Makefile.am index 5c8888c..bf4c571 100644 --- a/lib/libtqtrla/src/Makefile.am +++ b/lib/libtqtrla/src/Makefile.am @@ -8,4 +8,4 @@ include_HEADERS = tqtrla.h libtqtrla_la_SOURCES = tqtrla.cpp libtqtrla_la_LIBADD = -lkio $(LIB_TDEUI) -libtqtrla_la_LDFLAGS = -avoid-version -module -no-undefined $(all_libraries) \ No newline at end of file +libtqtrla_la_LDFLAGS = -avoid-version -module -no-undefined $(all_libraries) $(LIB_KPARTS) \ No newline at end of file diff --git a/lib/libtqtrla/src/tqtrla.cpp b/lib/libtqtrla/src/tqtrla.cpp index 6daded3..e3001fb 100644 --- a/lib/libtqtrla/src/tqtrla.cpp +++ b/lib/libtqtrla/src/tqtrla.cpp @@ -20,6 +20,54 @@ #include "tqtrla.h" +#include + +namespace KParts +{ + class RemoteInstrumentPartPrivate + { + public: + RemoteInstrumentPartPrivate() { + // + } + + ~RemoteInstrumentPartPrivate() { + // + } + }; + + RemoteInstrumentPart::RemoteInstrumentPart(TQObject *parent, const char *name) + : Part( parent, name ) + { + d = new RemoteInstrumentPartPrivate; + } + + RemoteInstrumentPart::~RemoteInstrumentPart() { + RemoteInstrumentPart::closeURL(); + delete d; + } + + bool RemoteInstrumentPart::openURL(const KURL &url) { + m_url = url; + return false; + } + + bool RemoteInstrumentPart::closeURL() { + return false; + } + + void RemoteInstrumentPart::close() { + TQWidget* parentWidget = dynamic_cast(parent()); + if (parentWidget) { + parentWidget->close(); + } + } + + void RemoteInstrumentPart::setStatusMessage(const TQString& message) { + emit(statusMessageSet(message)); + } +} + bool operator==( const ServiceType &s1, const ServiceType &s2 ) { bool identical = true; diff --git a/lib/libtqtrla/src/tqtrla.h b/lib/libtqtrla/src/tqtrla.h index c49c101..b43ea22 100644 --- a/lib/libtqtrla/src/tqtrla.h +++ b/lib/libtqtrla/src/tqtrla.h @@ -23,6 +23,46 @@ #include +#include + +// ============================================================================= + +namespace KParts +{ + class RemoteInstrumentPartPrivate; + + class KPARTS_EXPORT RemoteInstrumentPart : public Part + { + Q_OBJECT + + public: + RemoteInstrumentPart(TQObject *parent = 0, const char *name = 0); + virtual ~RemoteInstrumentPart(); + + public slots: + virtual bool openURL( const KURL &url ); + + public: + KURL url() const { return m_url; } + virtual bool closeURL(); + + protected slots: + void close(); + void setStatusMessage(const TQString& message); + + signals: + void statusMessageSet(const TQString&); + + protected: + KURL m_url; + + private: + RemoteInstrumentPartPrivate *d; + }; +} + +// ============================================================================= + class ServiceType { public: @@ -42,6 +82,8 @@ typedef TQValueList ServiceList; Q_EXPORT bool operator==(const ServiceType &s1, const ServiceType &s2); +// ============================================================================= + class StationType { public: @@ -59,4 +101,6 @@ Q_EXPORT TQDataStream &operator>>(TQDataStream &, StationType &); typedef TQValueList StationList; +// ============================================================================= + #endif // TQTRLA_H \ No newline at end of file -- cgit v1.2.1