summaryrefslogtreecommitdiffstats
path: root/languages/cpp/app_templates/tdeapp/app.h
diff options
context:
space:
mode:
Diffstat (limited to 'languages/cpp/app_templates/tdeapp/app.h')
-rw-r--r--languages/cpp/app_templates/tdeapp/app.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/tdeapp/app.h b/languages/cpp/app_templates/tdeapp/app.h
new file mode 100644
index 00000000..5f39dd11
--- /dev/null
+++ b/languages/cpp/app_templates/tdeapp/app.h
@@ -0,0 +1,90 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}_H_
+#define _%{APPNAMEUC}_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <tdeapplication.h>
+#include <tdemainwindow.h>
+
+#include "%{APPNAMELC}view.h"
+
+class KPrinter;
+class KURL;
+
+/**
+ * This class serves as the main window for %{APPNAME}. It handles the
+ * menus, toolbars, and status bars.
+ *
+ * @short Main window class
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAME} : public TDEMainWindow
+{
+ Q_OBJECT
+
+public:
+ /**
+ * Default Constructor
+ */
+ %{APPNAME}();
+
+ /**
+ * Default Destructor
+ */
+ virtual ~%{APPNAME}();
+
+ /**
+ * Use this method to load whatever file/URL you have
+ */
+ void load(const KURL& url);
+
+protected:
+ /**
+ * Overridden virtuals for TQt drag 'n drop (XDND)
+ */
+ virtual void dragEnterEvent(TQDragEnterEvent *event);
+ virtual void dropEvent(TQDropEvent *event);
+
+protected:
+ /**
+ * This function is called when it is time for the app to save its
+ * properties for session management purposes.
+ */
+ void saveProperties(TDEConfig *);
+
+ /**
+ * This function is called when this app is restored. The TDEConfig
+ * object points to the session management config file that was saved
+ * with @ref saveProperties
+ */
+ void readProperties(TDEConfig *);
+
+
+private slots:
+ void fileNew();
+ void fileOpen();
+ void fileSave();
+ void fileSaveAs();
+ void filePrint();
+ void optionsPreferences();
+
+ void changeStatusbar(const TQString& text);
+ void changeCaption(const TQString& text);
+
+private:
+ void setupAccel();
+ void setupActions();
+
+private:
+ %{APPNAME}View *m_view;
+
+ KPrinter *m_printer;
+};
+
+#endif // _%{APPNAMEUC}_H_
+