summaryrefslogtreecommitdiffstats
path: root/src/core.h
blob: c041eac07cc06c4cfa2585d316039c29fa33e4ac (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
#ifndef _CORE_H_
#define _CORE_H_

#include <tqregexp.h>
#include <kxmlguiclient.h>

#include <tdeparts/partmanager.h>


#include "kdevcore.h"

namespace MainWindowUtils{

TQString beautifyToolTip(const TQString& text);
}

/**
Core implementation.
*/
class Core : public KDevCore
{
  Q_OBJECT
  

public:

  static Core *getInstance();
  
  /**
   * Setup shourtcut tips. For every TDEAction with a shortcut,
   * appends the shortcut string, in parenthesis, to the
   * actions's tooltip. If tooltip already has any text in
   * parens, it's removed and shortcut is added instead.
   *
   * @param client
   *   Pointer to KXMLGUIClient object, which contain an collection
   *   of actions (TDEActionCollection). If the parameter is null,
   *   function is applied to the all available KXMLGUIClient objects.
   */
  static void setupShourtcutTips(KXMLGUIClient * client = 0);

  ~Core();

  virtual void running(KDevPlugin *which, bool runs);
  virtual void fillContextMenu(TQPopupMenu *popup, const Context *context);
  virtual void openProject(const TQString& projectFileName);

  void doEmitProjectOpened() { emit projectOpened(); }
  void doEmitProjectClosed() { emit projectClosed(); }
  void doEmitLanguageChanged() { emit languageChanged(); }
  void doEmitCoreInitialized() { emit coreInitialized(); }
  void doEmitProjectConfigWidget(KDialogBase *base) { emit projectConfigWidget(base); }
  void doEmitConfigWidget(KDialogBase *base) { emit configWidget(base); }
  void doEmitStopButtonPressed(KDevPlugin* which = 0) { emit stopButtonClicked( which ); }

  bool queryClose();

signals:

  void activeProcessChanged(KDevPlugin* which, bool runs);

protected:

  Core();
  
private:
  static Core *s_instance;

};


#endif