QCodeEdit  2.2
qcodeedit.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
4 **
5 ** This file is part of the Edyuk project <http://edyuk.org>
6 **
7 ** This file may be used under the terms of the GNU General Public License
8 ** version 3 as published by the Free Software Foundation and appearing in the
9 ** file GPL.txt included in the packaging of this file.
10 **
11 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13 **
14 ****************************************************************************/
15 
16 #ifndef _QCODE_EDIT_H_
17 #define _QCODE_EDIT_H_
18 
19 #include "qce-config.h"
20 
26 #include <QList>
27 #include <QPointer>
28 #include <QGenericArgument>
29 
30 class QMenu;
31 class QPanel;
32 class QEditor;
33 class QWidget;
34 class QString;
35 class QAction;
36 class QPanelLayout;
37 class QPanelWatcher;
38 
39 #define Q_COMMAND QList<QGenericArgument>()
40 
42 {
43  friend class QPanelWatcher;
44 
45  public:
46  enum Position
47  {
48  West,
49  North,
50  South,
51  East
52  };
53 
54  QCodeEdit(QWidget *p = 0);
55  QCodeEdit(bool actions, QWidget *p = 0);
56  QCodeEdit(const QString& layout, QWidget *p = 0);
57  QCodeEdit(const QString& layout, bool actions, QWidget *p = 0);
58  virtual ~QCodeEdit();
59 
60  QEditor* editor() const;
61  QPanelLayout* panelLayout() const;
62 
63  QAction* addPanel(QPanel *panel, Position pos, bool _add = false);
64  QAction* addPanel(const QString& name, Position pos, bool _add = false);
65 
66  bool hasPanel(const QString& type) const;
67  QList<QPanel*> panels(const QString& type = QString()) const;
68 
69  QAction* toggleViewAction(QPanel *p) const;
70 
71  void sendPanelCommand( const QString& type,
72  const char *signature,
73  const QList<QGenericArgument>& args = Q_COMMAND);
74 
75  static QCodeEdit* manager(QEditor *e);
76  static QEditor* managed(const QString& f);
77 
78  //protected:
80  QCodeEdit(QEditor *e, const QString& l);
81 
82  private:
83  QPanelWatcher *m_watcher;
84  QPointer<QEditor> m_editor;
85  QPointer<QPanelLayout> m_layout;
86 
87  QMenu *m_panelsMenu;
88  QList<QAction*> m_actions;
89 
90  static QList<QCodeEdit*> m_instances;
91 };
92 
93 #endif // _QCODE_EDIT_H_
#define QCE_EXPORT
Macro needed for cross-platform shared libraries creation.
Definition: qce-config.h:40
Utility file for shared library creation.
Helper class for panels displayed by QCodeEdit.
Definition: qpanel.h:40
A text editing widget.
Definition: qeditor.h:55
Definition: qcodeedit.cpp:49
A specialized layout taking care of panel display.
Definition: qpanellayout.h:33
A thin layer over QEditor.
Definition: qcodeedit.h:41