summaryrefslogtreecommitdiffstats
path: root/superkaramba/src/karambaapp.h
blob: e709ecd35003d92342892a2dd4e4ea402be58d68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/***************************************************************************
 *   Copyright (C) 2003-2004 Adam Geitgey <adam@rootnode.org>              *
 *   Copyright (C) 2003 Hans Karlsson <karlsson.h@home.se>                 *
 *                                                                         *
 *   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.                                   *
 ***************************************************************************/

#ifndef KARAMBAAPP_H
#define KARAMBAAPP_H

#include "kapplication.h"
#include <kdeversion.h>
#include <ksystemtray.h>

#undef KDE_3_2
#undef KDE_3_3
#if defined(KDE_MAKE_VERSION)
#if TDE_VERSION >= KDE_MAKE_VERSION(3,2,0)
#define KDE_3_2
#endif
#if TDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
#define KDE_3_3
#endif
#endif

#define karambaApp ((KarambaApplication*)tqApp)

class karamba;
class KarambaIface;
class KCmdLineArgs;
class ThemesDlg;
class dcopIface_stub;
class KHelpMenu;
class KAboutData;

class KarambaApplication : public KApplication
{
    Q_OBJECT
  TQ_OBJECT

    friend class KarambaIface;

  private:
    static int fd;
    KHelpMenu* m_helpMenu;

    void showKarambaMenuExtension(bool show = true);
    void setToolTip(const TQString &tip = TQString());

  protected:
    KarambaIface* iface;
    ThemesDlg* themeListWindow;
    dcopIface_stub* dcopIfaceStub;
    TQObjectList *karambaList;
    KSystemTray* sysTrayIcon;

  public:
    KarambaApplication();
    ~KarambaApplication();

    TQString getMainKaramba();
    TQStringList getKarambas();
    bool themeExists(TQString pretty_name);
    void initDcopStub(TQCString app = "");
    void setUpSysTray(KAboutData* about);
    void checkPreviousSession(KApplication &app, TQStringList &lst);
    void checkCommandLine(KCmdLineArgs *args, TQStringList &lst);
    bool startThemes(TQStringList &lst);
    KarambaIface* dcopIface() { return iface; };
    dcopIface_stub* dcopStub() { return dcopIfaceStub; };
    TQWidget* parentWindow() { return (TQWidget*)themeListWindow; };

    void addKaramba(karamba* k, bool reloading = false);
    void deleteKaramba(karamba* k, bool reloading = false);
    bool hasKaramba(karamba* k);

    static bool lockKaramba();
    static void unlockKaramba();
    static void checkSuperKarambaDir();

  public slots:
    void buildToolTip();
    void globalQuitSuperKaramba();
    void globalShowThemeDialog();
    void globalHideSysTray(bool hide = true);

  protected slots:
    void quitSuperKaramba();
    void showThemeDialog();
    void hideSysTray(bool hide = true);
};

#endif // KARAMBAAPP_H