summaryrefslogtreecommitdiffstats
path: root/knode/knglobals.h
blob: 72ffa1f07c7d405fa34722e3a675d9742d740016 (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
97
98
/*
    knglobals.h

    KNode, the KDE newsreader
    Copyright (c) 1999-2005 the KNode authors.
    See file AUTHORS for details

    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.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
*/

#ifndef KNGLOBALS_H
#define KNGLOBALS_H

#include <kconfig.h>
#include "resource.h"

#include <kdepimmacros.h>

class KInstance;
class KNConfigManager;
class KNNetAccess;
class KNProgress;
class KNAccountManager;
class KNGroupManager;
class KNArticleManager;
class KNArticleFactory;
class KNFolderManager;
class TQWidget;
class KNFilterManager;
class KNMainWidget;
class KNScoringManager;
class KNMemoryManager;
class KXMLGUIClient;
namespace Kpgp {
   class Module;
}
namespace KNode {
  class ArticleWidget;
}


/** idea: Previously the manager classes were available
    via KNodeApp. Now they can be accessed directly,
    this removes many header dependencies.
    (knode.h isn't include everywhere) */
class KDE_EXPORT KNGlobals {
  public:
    KNGlobals();
    ~KNGlobals();

    /** topWidget == top, used for message boxes, */
    TQWidget               *topWidget;
    /** no need to include knode.h everywhere */
    KNMainWidget          *top;
    KXMLGUIClient         *guiClient;
    KNode::ArticleWidget  *artWidget;
    KNArticleFactory      *artFactory;
    Kpgp::Module          *pgp;
    KConfig               *config();
    KInstance             *instance;

    KNConfigManager       *configManager();
    KNNetAccess           *netAccess();
    KNAccountManager      *accountManager();
    KNGroupManager        *groupManager();
    KNArticleManager      *articleManager();
    KNFilterManager       *filterManager();
    KNFolderManager       *folderManager();
    KNScoringManager      *scoringManager();
    KNMemoryManager       *memoryManager();

    /** forwarded to top->seStatusMsg() if available */
    void seStatusMsg(const TQString& text = TQString::null, int id = SB_MAIN);

private:
    KSharedConfig::Ptr c_onfig;

    KNNetAccess           *mNetAccess;
    KNConfigManager       *mCfgManager;
    KNAccountManager      *mAccManager;
    KNGroupManager        *mGrpManager;
    KNArticleManager      *mArtManager;
    KNFilterManager       *mFilManager;
    KNFolderManager       *mFolManager;
    static KNScoringManager  *mScoreManager;
    KNMemoryManager       *mMemManager;
};


extern KNGlobals knGlobals KDE_EXPORT;

#endif