1
/***************************************************************************
2
rkmdiwindow - description
4
begin : Tue Sep 26 2006
5
copyright : (C) 2006 by Thomas Friedrichsmeier
6
email : tfry@users.sourceforge.net
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
23
#include <kparts/part.h>
27
/** Base class for rkward document mdi windows */
28
class RKMDIWindow : public QWidget {
33
CommandEditorWindow=2,
36
AnyType=DataEditorWindow | CommandEditorWindow | OutputWindow | HelpWindow
42
AnyState=Attached | Detached
46
@param parent parent widget
47
@param type Type of window */
48
RKMDIWindow (QWidget *parent, Type type);
49
virtual ~RKMDIWindow ();
51
/** @returns true, if the window's document was modified (and would need to be saved) */
52
virtual bool isModified () = 0;
53
/** @returns A long / complete caption. Default implementation simply calls shortCaption () */
54
virtual QString fullCaption ();
55
/** @returns A short caption (e.g. only the filename without the path). Default implementation simply calls QWidget::caption () */
56
virtual QString shortCaption ();
57
/** @returns The corresponding KPart for this window */
58
virtual KParts::Part *getPart () = 0;
59
/** This is used in RKWorkplace::saveWorkplace () to save the info about the workplace. Make sure to add corresponding code to RKWorkplace::restoreWorkplace (), so your window(s) get restored when loading a Workspace
60
@returns An internal descriptive string suitable for storage in R. */
61
virtual QString getRDescription () = 0;
62
/** Reimplemented from QWidget::setCaption () to emit the signal captionChanged () when the caption is changed. */
63
void setCaption (const QString &caption);
64
/** Is this window attached (or detached)?
65
@returns true if attached, false if detached */
66
bool isAttached () { return (state == Attached); };
68
/** This signal is emitted, whenever the window caption was changed.
69
@param RKMDIWindow* a pointer to this window */
70
void captionChanged (RKMDIWindow *);
72
friend class RKWorkplace;
73
/** type of this window */
76
/** state of this window (attached / detached). This is set from the RKWorkplace */