summaryrefslogtreecommitdiffstats
path: root/ksim/monitors/mail
diff options
context:
space:
mode:
Diffstat (limited to 'ksim/monitors/mail')
-rw-r--r--ksim/monitors/mail/Makefile.am15
-rw-r--r--ksim/monitors/mail/ksimmail.cpp160
-rw-r--r--ksim/monitors/mail/ksimmail.h90
-rw-r--r--ksim/monitors/mail/mail.desktop119
4 files changed, 384 insertions, 0 deletions
diff --git a/ksim/monitors/mail/Makefile.am b/ksim/monitors/mail/Makefile.am
new file mode 100644
index 0000000..bf89a1d
--- /dev/null
+++ b/ksim/monitors/mail/Makefile.am
@@ -0,0 +1,15 @@
+kde_module_LTLIBRARIES = ksim_mail.la
+ksim_mail_la_SOURCES = ksimmail.cpp
+
+ksim_mail_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
+ksim_mail_la_LIBADD = $(LIB_KIO) ../../library/libksimcore.la
+
+EXTRA_DIST = mail.desktop
+
+INCLUDES= -I$(top_srcdir)/ksim/library \
+ $(all_includes)
+
+METASOURCES = AUTO
+
+mon_DATA = mail.desktop
+mondir = $(kde_datadir)/ksim/monitors
diff --git a/ksim/monitors/mail/ksimmail.cpp b/ksim/monitors/mail/ksimmail.cpp
new file mode 100644
index 0000000..6ca1142
--- /dev/null
+++ b/ksim/monitors/mail/ksimmail.cpp
@@ -0,0 +1,160 @@
+/*
+ Copyright (c) 2002 Malte Starostik <[email protected]>
+
+ This program 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 2 of the License, or (at your option) any later version.
+
+ This program 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 this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+// $Id$
+
+#include <qbitmap.h>
+#include <qlayout.h>
+#include <qtimer.h>
+
+#include <kaboutapplication.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+#include <label.h>
+#include <themeloader.h>
+#include <themetypes.h>
+
+#include "ksimmail.moc"
+
+KSIM_INIT_PLUGIN( MailPlugin );
+
+MailPlugin::MailPlugin( const char* name )
+ : KSim::PluginObject( name )
+{
+ setConfigFileName(instanceName());
+}
+
+MailPlugin::~MailPlugin()
+{
+}
+
+KSim::PluginView* MailPlugin::createView( const char* name )
+{
+ return new MailView( this, name );
+}
+
+KSim::PluginPage* MailPlugin::createConfigPage( const char* name )
+{
+ return new MailConfig( this, name );
+}
+
+void MailPlugin::showAbout()
+{
+ KAboutData about( instanceName(),
+ I18N_NOOP( "KSim Mail Plugin" ), "0.1",
+ I18N_NOOP( "A mail monitor plugin for KSim" ),
+ KAboutData::License_GPL, "(c) 2002 Malte Starostik" );
+ about.addAuthor( "Malte Starostik", I18N_NOOP( "Author" ), "[email protected]" );
+
+ KAboutApplication( &about ).exec();
+}
+
+MailView::MailView( KSim::PluginObject* parent, const char* name )
+ : KSim::PluginView( parent, name )
+{
+ QVBoxLayout* layout = new QVBoxLayout( this );
+
+ MailLabel* label = new MailLabel( this );
+ layout->addWidget( label, 0, AlignHCenter );
+}
+
+MailView::~MailView()
+{
+}
+
+void MailView::reparseConfig()
+{
+}
+
+void MailView::updateDisplay()
+{
+}
+
+MailLabel::MailLabel( QWidget* parent )
+ : KSim::Label( KSim::Types::Mail, parent )
+{
+// label->setPixmap( KSim::ThemeLoader::self().current().krellMail() );
+ configureObject( false );
+ QTimer* timer = new QTimer( this );
+ connect( timer, SIGNAL( timeout() ), SLOT( animation() ) );
+ timer->start( 100 );
+}
+
+MailLabel::~MailLabel()
+{
+}
+
+void MailLabel::configureObject( bool repaint )
+{
+ m_envelope.load( themeLoader().current().mailPixmap() );
+ m_frames = themeLoader().current().mailFrames();
+ m_delay = themeLoader().current().mailDelay();
+
+ if ( !m_frames ) m_frames = 18;
+ if ( !m_delay ) m_delay = 1;
+
+ setPixmap( frame( m_envelope, 1 ) );
+
+ KSim::Label::configureObject( repaint );
+}
+
+void MailLabel::paintEvent( QPaintEvent* e )
+{
+ KSim::Label::paintEvent( e );
+}
+
+void MailLabel::animation()
+{
+ static int f = 1;
+ setPixmap( frame( m_envelope, f ) );
+ if ( f++ >= m_frames ) f = 1;
+}
+
+QPixmap MailLabel::frame( const QPixmap& source, int number ) const
+{
+ QPixmap result( source.width(), source.height() / m_frames );
+ bitBlt( &result, 0, 0, &source, 0, number * source.height() / m_frames );
+ if ( source.mask() )
+ {
+ QBitmap mask( result.size() );
+ bitBlt( &mask, 0, 0, source.mask(), 0, number * source.height() / m_frames );
+ result.setMask( mask );
+ }
+ return result;
+}
+
+MailConfig::MailConfig( KSim::PluginObject* parent, const char* name )
+ : KSim::PluginPage( parent, name )
+{
+}
+
+MailConfig::~MailConfig()
+{
+}
+
+void MailConfig::saveConfig()
+{
+}
+
+void MailConfig::readConfig()
+{
+}
+
+// vim: ts=4 sw=4 noet
diff --git a/ksim/monitors/mail/ksimmail.h b/ksim/monitors/mail/ksimmail.h
new file mode 100644
index 0000000..fd8790a
--- /dev/null
+++ b/ksim/monitors/mail/ksimmail.h
@@ -0,0 +1,90 @@
+/*
+ Copyright (c) 2002 Malte Starostik <[email protected]>
+
+ This program 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 2 of the License, or (at your option) any later version.
+
+ This program 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 this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+// $Id$
+
+#ifndef __ksimmail_h__
+#define __ksimmail_h__
+
+#include <pluginmodule.h>
+
+class MailPlugin : public KSim::PluginObject
+{
+public:
+ MailPlugin( const char* name );
+ ~MailPlugin();
+
+ virtual KSim::PluginView* createView( const char* );
+ virtual KSim::PluginPage* createConfigPage( const char* );
+
+ virtual void showAbout();
+};
+
+class MailView : public KSim::PluginView
+{
+ Q_OBJECT
+public:
+ MailView( KSim::PluginObject* parent, const char* name );
+ ~MailView();
+
+ virtual void reparseConfig();
+
+private slots:
+ void updateDisplay();
+};
+
+class MailLabel : public KSim::Label
+{
+ Q_OBJECT
+public:
+ MailLabel( QWidget* parent );
+ virtual ~MailLabel();
+
+ virtual void configureObject( bool );
+
+protected:
+ virtual void paintEvent( QPaintEvent* );
+
+private slots:
+ void animation();
+
+private:
+ QPixmap frame( const QPixmap& source, int number ) const;
+
+private:
+ QPixmap m_envelope;
+ QPixmap m_penguin;
+ int m_frames;
+ int m_delay;
+};
+
+class MailConfig : public KSim::PluginPage
+{
+ Q_OBJECT
+public:
+ MailConfig( KSim::PluginObject* parent, const char* name );
+ ~MailConfig();
+
+ virtual void saveConfig();
+ virtual void readConfig();
+};
+
+#endif
+
+// vim: ts=4 sw=4 noet
diff --git a/ksim/monitors/mail/mail.desktop b/ksim/monitors/mail/mail.desktop
new file mode 100644
index 0000000..f65ed27
--- /dev/null
+++ b/ksim/monitors/mail/mail.desktop
@@ -0,0 +1,119 @@
+[Desktop Entry]
+Comment=Mail Monitor Plugin
+Comment[af]=Pos Monitor Inplak
+Comment[ar]=ملحق مراقبة البريد
+Comment[bg]=Мониторинг на електронната поща
+Comment[bs]=Dodatak za praćenje pošte
+Comment[ca]=Monitor de correu
+Comment[cs]=Modul pro monitorování pošty
+Comment[cy]=Atodyn Monitro Post
+Comment[da]=Postovervågnings-plugin
+Comment[de]=Hilfsprogramm zur Mailüberwachung
+Comment[el]=Πρόσθετο εποπτείας αλληλογραφίας
+Comment[eo]=Disk-observa kromaĵo
+Comment[es]=Extensión de monitorización de correo
+Comment[et]=E-posti monitooring
+Comment[eu]=Postaren Plugin Begiralea
+Comment[fa]=وصلۀ نمایشگر نامه
+Comment[fi]=Sähköpostin monitorointisovelma
+Comment[fr]=Module de surveillance de boîtes aux lettres
+Comment[ga]=Breiseán Monatóireachta Ríomhphoist
+Comment[he]=תוסף צג דואר
+Comment[hi]=डाक मॉनीटर प्लगइन
+Comment[hu]=E-mail-figyelő bővítőmodul
+Comment[is]=Pósteftirlitsforrit
+Comment[it]=Plugin di controllo posta
+Comment[ja]=メールモニタプラグイン
+Comment[ka]= ფოსტის მონიტორის მოდული
+Comment[kk]=Поштаны бақылау модулі
+Comment[km]=កម្មវិធី​ជំនួយ​របស់​កម្មវិធី​ត្រួតពិនិត្យ​សំបុត្រ
+Comment[lt]=Pašto stebėtojo priedas
+Comment[mk]=Приклучок за следење на е-поштата
+Comment[ms]=Plug masuk Pemerhati Mel
+Comment[nb]=Programtillegg for E-postovervåking
+Comment[nds]=Nettpost-Kiekmoduul
+Comment[ne]=मेल मोनिटर प्लगइन
+Comment[nl]=Mail monitor-plugin
+Comment[nn]=Programtillegg for e-postovervaking
+Comment[pa]=ਪੱਤਰ ਨਿਗਰਾਨ ਪਲੱਗਿੰਨ
+Comment[pl]=Stan skrzynki pocztowej
+Comment[pt]='Plugin' de Monitorização do Correio
+Comment[pt_BR]=Plug-in de monitoramento de e-mail
+Comment[ro]=Modul monitorizare e-mail
+Comment[ru]=Монитор почты
+Comment[sk]=Modul pre monitorovanie pošty
+Comment[sl]=Vstavek za opazovanje pošte
+Comment[sr]=Прикључак за надгледање поште
+Comment[sr@Latn]=Priključak za nadgledanje pošte
+Comment[sv]=Insticksprogram för e-postövervakning
+Comment[ta]= அஞ்சல் கண்காணி சொருகுப்பொருள்
+Comment[tg]=Модули Дидабони Пост
+Comment[th]=ปลั๊กอินตรวจสอบจดหมาย
+Comment[tr]=Posta İzleyici Eklentisi
+Comment[uk]=Втулок датчика пошти
+Comment[uz]=Xat-xabarni nazorat qilish plagini
+Comment[uz@cyrillic]=Хат-хабарни назорат қилиш плагини
+Comment[wa]=Tchôke-divins di corwaitaedje di l' emilaedje
+Comment[xh]=Iplagi efakiweyo Monitor Yeposi
+Comment[zh_CN]=邮件监视器插件
+Comment[zh_TW]=電子郵件監視器外掛程式
+Comment[zu]=I-plugin Yomlawuli Weposi
+Icon=kmail
+Name=Mail
+Name[af]=Pos
+Name[ar]=البريد
+Name[bg]=Поща
+Name[br]=Lizher
+Name[ca]=Correu
+Name[cs]=Pošta
+Name[cy]=Post
+Name[da]=Post
+Name[el]=Αλληλογραφία
+Name[eo]=Retpoŝto
+Name[es]=Correo
+Name[et]=Kirjad
+Name[eu]=Posta
+Name[fa]=نامه
+Name[fi]=Sähköposti
+Name[fr]=Courrier
+Name[ga]=Ríomhphost
+Name[he]=דואר
+Name[hi]=डाक
+Name[hr]=Pošta
+Name[is]=Póstur
+Name[it]=Posta
+Name[ja]=メール
+Name[ka]=ფოსტა
+Name[kk]=Пошта
+Name[km]=សំបុត្រ
+Name[lt]=Paštas
+Name[lv]=Pasts
+Name[mk]=Е-пошта
+Name[mt]=Imejl
+Name[nb]=E-Post
+Name[nds]=Nettpost
+Name[ne]=मेल
+Name[nn]=E-post
+Name[pa]=ਪੱਤਰ
+Name[pl]=Poczta
+Name[pt]=E-mail
+Name[pt_BR]=E-mail
+Name[ru]=Почта
+Name[sk]=Pošta
+Name[sl]=Pošta
+Name[sr]=Пошта
+Name[sr@Latn]=Pošta
+Name[sv]=E-post
+Name[ta]= அஞ்சல்
+Name[tg]=Пост
+Name[th]=จดหมาย
+Name[tr]=E-posta
+Name[uk]=Пошта
+Name[uz]=Xat-xabar
+Name[uz@cyrillic]=Хат-хабар
+Name[wa]=Emilaedje
+Name[xh]=Iposi
+Name[zh_CN]=邮件
+Name[zh_TW]=電子郵件
+Name[zu]=Iposi
+X-KSIM-LIBRARY=mail