Eneboo - Documentación para desarrolladores
src/qt/tools/designer/designer/multilineeditorimpl.h
Ir a la documentación de este archivo.
00001 /**********************************************************************
00002 ** Copyright (C) 2005-2007 Trolltech ASA.  All rights reserved.
00003 **
00004 ** This file is part of Qt Designer.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00012 ** licenses may use this file in accordance with the Qt Commercial License
00013 ** Agreement provided with the Software.
00014 **
00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017 **
00018 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00019 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00020 **   information about Qt Commercial License Agreements.
00021 **
00022 ** Contact info@trolltech.com if any conditions of this licensing are
00023 ** not clear to you.
00024 **
00025 **********************************************************************/
00026 
00027 #ifndef MULTILINEEDITORIMPL_H
00028 #define MULTILINEEDITORIMPL_H
00029 
00030 #include <qaction.h>
00031 #include <qtextedit.h>
00032 #include <private/qrichtext_p.h>
00033 #include "multilineeditor.h"
00034 
00035 class FormWindow;
00036 class QToolBar;
00037 class QTextDocument;
00038 
00039 class TextEdit : public QTextEdit
00040 {
00041     Q_OBJECT
00042 
00043 public:
00044     TextEdit( QWidget *parent = 0, const char *name = 0 );
00045     QTextDocument *document() const { return QTextEdit::document(); }
00046     QTextParagraph *paragraph();
00047 
00048 };
00049 
00050 class ToolBarItem : public QAction
00051 {
00052     Q_OBJECT
00053 
00054 public:
00055     ToolBarItem( QWidget *parent, QWidget *toolBar,
00056                  const QString &label, const QString &tagstr,
00057                  const QIconSet &icon, const QKeySequence &key = 0 );
00058     ~ToolBarItem();
00059 signals:
00060     void clicked( const QString &t );
00061 
00062 protected slots:
00063     void wasActivated();
00064 private:
00065     QString tag;
00066 };
00067 
00068 
00069 class MultiLineEditor : public MultiLineEditorBase
00070 {
00071     Q_OBJECT
00072 
00073 public:
00074     MultiLineEditor( bool call_static, bool richtextMode, QWidget *parent, QWidget *editWidget,
00075                      FormWindow *fw, const QString &text = QString::null );
00076     bool useWrapping() const;
00077     void setUseWrapping( bool );
00078     static QString getText( QWidget *parent, const QString &text, bool richtextMode, bool *useWrap );
00079     int exec();
00080 
00081 protected slots:
00082     void okClicked();
00083     void applyClicked();
00084     void cancelClicked();
00085     void insertTags( const QString& );
00086     void insertBR();
00087     void showFontDialog();
00088     void changeWrapMode( bool );
00089 
00090     void closeEvent( QCloseEvent *e );
00091 
00092 private:
00093     QString getStaticText();
00094     TextEdit *textEdit;
00095     QTextEdit *mlined;
00096     FormWindow *formwindow;
00097     QToolBar *basicToolBar;
00098     QToolBar *fontToolBar;
00099     QToolBar *optionsToolBar;
00100     QAction *wrapAction;
00101     int res;
00102     QString staticText;
00103     bool callStatic;
00104     bool oldDoWrap, doWrap;
00105     QVariant oldWrapMode;
00106     QString oldWrapString;
00107 };
00108 
00109 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'