From 4aed2c8219774f5d797760606b8489a92ddc5163 Mon Sep 17 00:00:00 2001
From: toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>
Date: Wed, 25 Nov 2009 17:56:58 +0000
Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
 BUG:215923

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
---
 kicker/applets/swallow/swallow.h | 114 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 114 insertions(+)
 create mode 100644 kicker/applets/swallow/swallow.h

(limited to 'kicker/applets/swallow/swallow.h')

diff --git a/kicker/applets/swallow/swallow.h b/kicker/applets/swallow/swallow.h
new file mode 100644
index 000000000..8e472f415
--- /dev/null
+++ b/kicker/applets/swallow/swallow.h
@@ -0,0 +1,114 @@
+/*
+ *  Copyright (c) 2000 Matthias H�lzer-Kl�pfel <hoelzer@kde.org>
+                  2000 Carsten Pfeiffer <pfeiffer@kde.org>
+ *
+ *  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; if not, write to the Free Software
+ */
+
+#ifndef __swallow_h__
+#define __swallow_h__
+
+
+#include <qevent.h>
+#include <qptrlist.h>
+#include <qxembed.h>
+
+#include <kpanelapplet.h>
+
+class QBoxLayout;
+class KConfig;
+class KProcess;
+class KWinModule;
+
+class SwallowApp;
+
+typedef struct _SwallowCommand {
+    QString cmdline;
+    QString title;
+} SwallowCommand;
+
+typedef QPtrList<SwallowCommand> SwallowCommandList;
+typedef QPtrListIterator<SwallowCommand> SwallowCommandListIterator;
+typedef QPtrList<SwallowApp> SwallowAppList;
+
+class SwallowApplet : public KPanelApplet
+{
+    Q_OBJECT
+
+public:
+    SwallowApplet( const QString& configFile, QWidget *parent,
+                          const char *name = 0L );
+    ~SwallowApplet();
+
+    // returns 0L if we don't have a SwallowApplet object yet,
+    // but who cares
+    static KWinModule * winModule() { return wModule; }
+    static void removeApplet( SwallowApp * );
+
+public: // for KPanelApplet
+    int widthForHeight( int w );
+    int heightForWidth( int h );
+
+    void windowAdded(WId win);
+    void processExited(KProcess *proc);
+
+public slots:
+    virtual void preferences();
+
+private slots:
+    void embedded( SwallowApp * );
+
+private:
+    void layoutApps();
+    SwallowCommandList* readConfig();
+    void createApps( SwallowCommandList * );
+
+
+    static SwallowApplet *self;
+    static SwallowAppList *appList;
+    static SwallowAppList *embeddedList;
+    static KWinModule *wModule;
+
+    SwallowCommandList * m_swcList;
+    QBoxLayout *m_layout;
+
+};
+
+
+class SwallowApp : public QXEmbed
+{
+    Q_OBJECT
+	
+public:
+    SwallowApp( const SwallowCommand * swc, QWidget* parent = 0,
+		const char* name = 0);
+    ~SwallowApp();
+
+    float sizeRatio() const { return wh_ratio; }
+
+signals:
+    void embedded( SwallowApp * );
+
+protected slots:
+    void windowAdded(WId win);
+    void processExited(KProcess *proc);
+
+private:
+    KProcess   	*process;
+    QString  	winTitle;
+    float 	wh_ratio;
+
+};
+
+#endif // __swallow_h__
-- 
cgit v1.2.1