summaryrefslogtreecommitdiffstats
path: root/kopete/kopete/kopeteapplication.h
blob: 06888371b0daa67808b1522a29da9c4c0ab04ca5 (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
/*
    kopete.h

    Kopete Instant Messenger Main Class

    Copyright (c) 2001-2002 by Duncan Mac-Vicar Prett   <duncan@kde.org>

    Kopete    (c) 2002-2003 by the Kopete developers  <kopete-devel@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.                                   *
    *                                                                       *
    *************************************************************************
*/

#ifndef KOPETEAPPLICATION_H
#define KOPETEAPPLICATION_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <tqguardedptr.h>

#include <kuniqueapplication.h>

class KopeteWindow;
class TQSessionManager;
class TQMimeSourceFactory;

namespace Kopete
{
	class MimeTypeHandler;
}

/**
 * @author Duncan Mac-Vicar P. <duncan@kde.org>
 */
class KopeteApplication : public KUniqueApplication
{
	Q_OBJECT
  

public:
	KopeteApplication();
	~KopeteApplication();

	/**
	 * Method to return whether or not we're shutting down
	 * or not at this point.
	 */
	bool isShuttingDown() const { return m_isShuttingDown; }

	virtual int newInstance();

public slots:
	/**
	 * Quit Kopete, closing all the windows, which causes application shutdown
	 * This method marks Kopete as 'shutting down' to avoid
	 * showing the message box that Kopete will be left running in the
	 * system tray before calling tqApp->quit().
	 */
	void quitKopete();

	virtual void commitData( TQSessionManager &sm );
	/**
	 * Load all plugins
	 */
	void slotLoadPlugins();

private slots:
	/**
	 * auto-connect
	 */
	void slotAllPluginsLoaded();
private:
	// The main window might get deleted behind our back (W_DestructiveClose),
	// so use a guarded pointer
	TQGuardedPtr<KopeteWindow> m_mainWindow;
	bool m_isShuttingDown;
	Kopete::MimeTypeHandler *m_emoticonHandler;
	TQMimeSourceFactory *m_mimeFactory;

private:
	void handleURLArgs();
};

#endif

// vim: set noet ts=4 sts=4 sw=4: