summaryrefslogtreecommitdiffstats
path: root/part/kxechardatadialog.h
blob: aad82d439b167169c162b99c4218029b9c19d128 (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
73
74
75
76
77
78
79
80
81
82
83
/***************************************************************************
                          kxechardatadialog.h  -  description
                          -------------------
    begin                : Don Apr 25 2002
    copyright            : (C) 2002, 2003 by The KXMLEditor Team
    email                : lvanek@users.sourceforge.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef KXECHARDATADIALOG_H
#define KXECHARDATADIALOG_H

#include "kxechardatadialogbase.h"

enum CharDataKind
	{
		CharDataTextNode = 0,
		CharDataCDATASection,
		CharDataComment
	};

class KXECharDataDialog : public KXECharDataDialogBase
{
		TQ_OBJECT

	public:
		KXECharDataDialog( TQWidget * pParent = 0, const char * pszName = 0, bool fModal = true, WFlags fl = 0 );

//    const CharDataKind charDataKind() const { return m_eCharDataKind; }
    const bool atTop() const { return m_bAtTop; }
    const TQString contents() const { return m_strContents; }

    void setContents(const TQString strContents) { m_strContents = strContents; }
//    void setCharDataKind(const CharDataKind eCharDataKind) { m_eCharDataKind = eCharDataKind; }

	public:
		
		/**
		 * To be used for inserting the given XML character data as child
		 * of the given parent element.
		 *
		 * @return see @ref TQDialog::exec
		 */
		int exec( bool );
		
		/**
		 * Clears the dialogs widgets.
		 */
		void clearDialog();

    // check contents
    static TQString checkContents(const TQString);
		
	protected:
		/**
		 * Don't use this function directly, it's for internal use only.
		 * Use one of the other @ref DlgXMLCharData::exec functions instead.
		 */
		int exec();

  protected slots:
		/**
		 * Called, when the data in the text edit @ref DlgXMLCharDataBase::m_pEditData
		 * is changed.
		 * Disables the OK button, if the given string is empty.
		 */
		void slotDataChanged();

    protected:
      //CharDataKind m_eCharDataKind;
      bool m_bAtTop;
      TQString m_strContents;
};

#endif