/* * Alabastra Project - C++ Editor writed with QT Library V.4 * Copyright (C) Igor Maculan - geocronos@gmail.com Marco Buoncristiano - marco.buoncristiano@gmail.com * 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. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ALTEXTEDIT_H #define ALTEXTEDIT_H #include #include #include #include #include #include #include #include "AlDocument.h" class AlTextEdit : public QTextEdit { Q_OBJECT public: AlTextEdit(QWidget*); AlTextEdit(); void common(); void setCompleter(QCompleter *); QCompleter* getCompleter() const; AlDocument *doc; QListWidgetItem *lit; void setListWidgetItem(QListWidgetItem*); QListWidgetItem* getListWidgetItem(); bool isConnected(); void setConnected(bool); protected: void keyPressEvent(QKeyEvent *e); void mousePressEvent(QMouseEvent *e); private slots: void insertCompletion(const QString &str); void setFileName(); private: char ar_par[3][2]; QTextCursor cur; QString textUnderCursor() const; QCompleter *c; QTextCharFormat defFormat; bool connected; void completition(QKeyEvent *e); void selectParentesi(QChar); void selpar(QTextCursor); void unSelPar(); void indent(); void deindent(); bool isParentesi(QChar ); QKeyEvent *lastKeyEvent; //memorizzo l'ultima pressione di un tasto bool modifiedKey(int); public slots: void cursorMove(); void comment(); AlDocument * getAlDocument(); signals: void fileNameChanged(AlTextEdit*); }; #endif