kexi

formscript.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef FORMSCRIPT_H
21#define FORMSCRIPT_H
22
23#include "kexievents.h"
24
25#include <tqobject.h>
26#include <tqstring.h>
27#include <ksharedptr.h>
28
29class ScriptManager;
30
31namespace KFormDesigner {
32 class Form;
33}
34
35namespace Kross {
36 namespace Api {
37 class ScriptContainer;
38 }
39}
40
41using namespace KFormDesigner;
42
44class FormScript : public TQObject
45{
46 TQ_OBJECT
47
48
49 public:
50 FormScript(Form *form, ScriptManager *manager, const char *name=0);
51 ~FormScript();
52
53 EventList* eventList() { return &m_list; }
54 Kross::Api::ScriptContainer* scriptContainer() { return m_script; }
55
57 TQString getCode(const TQString &functionName=TQString());
60 void setCode(const TQString &code);
62 void appendCode(const TQString &code);
63
66 bool execute(const TQString &functionName);
70 void connectEvents();
71
72 private:
73 ScriptManager *m_manager;
74 Form *m_form;
75 TDESharedPtr<Kross::Api::ScriptContainer> m_script;
76 EventList m_list;
77};
78
79#endif
bool execute(const TQString &functionName)
TQString getCode(const TQString &functionName=TQString())
void connectEvents()
void setCode(const TQString &code)
void appendCode(const TQString &code)
A simple class representing a form.
Definition form.h:136