diff options
author | Slávek Banko <[email protected]> | 2016-03-26 13:50:43 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2016-03-26 13:50:43 +0100 |
commit | d62c8c002c51fb7c36487839eeeb4ac89f044dee (patch) | |
tree | bb4d1f5c631ab1f22a3018ba39e6a806035f80fd /part/kxenewfilesettings.h | |
download | kxmleditor-d62c8c002c51fb7c36487839eeeb4ac89f044dee.tar.gz kxmleditor-d62c8c002c51fb7c36487839eeeb4ac89f044dee.zip |
Initial import of kxmleditor 1.1.4
Diffstat (limited to 'part/kxenewfilesettings.h')
-rw-r--r-- | part/kxenewfilesettings.h | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/part/kxenewfilesettings.h b/part/kxenewfilesettings.h new file mode 100644 index 0000000..b1203ec --- /dev/null +++ b/part/kxenewfilesettings.h @@ -0,0 +1,111 @@ +/*************************************************************************** + kxenewfilesettings.h + -------------------- + begin : Tue Dec 02 2003 + copyright : (C) 2003 by The KXMLEditor Team + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 KXENEWFILESETTINGS_H +#define KXENEWFILESETTINGS_H + +#include "kxesettings.h" + +class KXENewFileSettingsPage; + +/** + * This class represents the group of configuration settings for + * new files. + * + * @author Olaf Hartig + */ +class KXENewFileSettings : public KXESettings +{ + public: + + enum NewFileCreationBehaviour + { + CreateEmptyFile, + CreateWithAssistance, + UseDefaults + }; + + KXENewFileSettings( QObject * pParent = 0, const char * pszName = 0 ); + + // The following functions can be used to access this object's settings. + QString dfltVersion() const { return m_strDfltVersion; } + QString dfltEncoding() const { return m_strDfltEncoding; } + NewFileCreationBehaviour newFileCreaBehav() const { return m_enmNewFileCreaBehav; } + + /** + * Returns a list of all possible encodings. + */ + static QStringList encodings(); + + /** + * Sets this object's new file creation behavior to the given one, + * updates the corresponding widget (in the config.dialog page + * @ref m_pDialogPage), stores this value to the given config.file + * and emits the signal @ref KXESettings::sigChanged. + */ + void setNewFileCreaBehav( NewFileCreationBehaviour, KConfig * ); + + /** + * Derived from @ref KXESettings + */ + virtual QString dialogPageName() const; + /** + * Derived from @ref KXESettings + */ + virtual QString dialogPageHeader() const; + /** + * Derived from @ref KXESettings + */ + virtual QString dialogPageIcon() const; + /** + * Derived from @ref KXESettings + */ + virtual QWidget * dialogPage( QFrame * pParent ); + + protected: + + /** + * Derived from @ref KXESettings + */ + virtual void write( KConfig * ) const; + /** + * Derived from @ref KXESettings + */ + virtual void read( const KConfig * ); + /** + * Derived from @ref KXESettings + */ + virtual void setFromPage(); + /** + * Derived from @ref KXESettings + */ + virtual void updatePage() const; + + // the settings itself + QString m_strDfltVersion; + QString m_strDfltEncoding; + NewFileCreationBehaviour m_enmNewFileCreaBehav; + + /** + * the corresponding configuration dialog page + * It is created on demand by @ref dialogPage. + */ + KXENewFileSettingsPage * m_pDialogPage; + +}; + +#endif |